@schukai/monster 4.50.0 → 4.51.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 +16 -0
- package/package.json +1 -1
- package/source/components/form/login.mjs +14 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.51.1] - 2025-12-25
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- remove isFunction definition
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [4.51.0] - 2025-12-25
|
|
14
|
+
|
|
15
|
+
### Add Features
|
|
16
|
+
|
|
17
|
+
- Enhance success URL handling in login component
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
5
21
|
## [4.50.0] - 2025-12-21
|
|
6
22
|
|
|
7
23
|
### Add Features
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.4","@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":"4.
|
|
1
|
+
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.4","@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":"4.51.1"}
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
registerCustomElement,
|
|
23
23
|
} from "../../dom/customelement.mjs";
|
|
24
24
|
import { findTargetElementFromEvent, fireEvent } from "../../dom/events.mjs";
|
|
25
|
-
import { isFunction } from "../../types/is.mjs";
|
|
26
25
|
import { LoginStyleSheet } from "./stylesheet/login.mjs";
|
|
27
26
|
import { fireCustomEvent } from "../../dom/events.mjs";
|
|
28
27
|
|
|
@@ -34,6 +33,8 @@ import "./digits.mjs";
|
|
|
34
33
|
import "../layout/collapse.mjs";
|
|
35
34
|
import "../datatable/datasource/rest.mjs";
|
|
36
35
|
|
|
36
|
+
import { isArray, isString, isObject, isFunction } from "../../types/is.mjs";
|
|
37
|
+
|
|
37
38
|
import { InvalidStyleSheet } from "./stylesheet/invalid.mjs";
|
|
38
39
|
import { getLocaleOfDocument } from "../../dom/locale.mjs";
|
|
39
40
|
import { getWindow } from "../../dom/util.mjs";
|
|
@@ -439,11 +440,22 @@ class Login extends CustomElement {
|
|
|
439
440
|
fireEvent(this, "redirect-to-first-success-url");
|
|
440
441
|
|
|
441
442
|
const successUrl = this.getOption("successUrls");
|
|
442
|
-
if (successUrl.length > 0) {
|
|
443
|
+
if (isArray(successUrl) && successUrl.length > 0) {
|
|
443
444
|
const success = successUrl[0].url;
|
|
444
445
|
if (success) {
|
|
445
446
|
getWindow().location.href = success;
|
|
446
447
|
}
|
|
448
|
+
} else if (isFunction(successUrl)) {
|
|
449
|
+
const url = successUrl();
|
|
450
|
+
if (url) {
|
|
451
|
+
getWindow().location.href = url;
|
|
452
|
+
}
|
|
453
|
+
} else if (isString(successUrl)) {
|
|
454
|
+
getWindow().location.href = successUrl;
|
|
455
|
+
} else {
|
|
456
|
+
console.warn(
|
|
457
|
+
"[Monster Login] No valid success URL found for redirection.",
|
|
458
|
+
);
|
|
447
459
|
}
|
|
448
460
|
}, this.getOption("timeoutForSuccess"));
|
|
449
461
|
|