@schukai/monster 4.49.0 → 4.50.0
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 +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.50.0] - 2025-12-21
|
|
6
|
+
|
|
7
|
+
### Add Features
|
|
8
|
+
|
|
9
|
+
- Refactor login component to centralize field mappings
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [4.49.1] - 2025-12-21
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- missing comma
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
5
21
|
## [4.49.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.50.0"}
|
|
@@ -214,9 +214,6 @@ class Login extends CustomElement {
|
|
|
214
214
|
* @property {boolean} features.redirectToFirstSuccessUrl If true, redirects to the first success URL after login
|
|
215
215
|
* @property {Object} actions Action definitions for custom event handling
|
|
216
216
|
* @property {Function} actions.click Callback function for generic click actions within the login component
|
|
217
|
-
* @property {Object} fields Field mappings for form inputs
|
|
218
|
-
* @property {string} fields.identifier Name of the identifier field (username/email)
|
|
219
|
-
* @property {string} fields.password Name of the password field
|
|
220
217
|
* @property {Object} callbacks Optional callback hooks for modifying internal behavior
|
|
221
218
|
* @property {Function} callbacks.username A function that receives and can transform the entered username before submission
|
|
222
219
|
* @property {Function} callbacks.forgotPassword A function that receives and can transform the entered email before submission
|
|
@@ -247,6 +244,9 @@ class Login extends CustomElement {
|
|
|
247
244
|
* @property {string} fetch.login.headers.accept Accept header value
|
|
248
245
|
* @property {string} fetch.login.headers.Content-Type Content-Type header value
|
|
249
246
|
* @property {string} fetch.login.credentials Credential mode (e.g., "same-origin")
|
|
247
|
+
* @property {Object} fetch.login.payload Field mappings for form inputs
|
|
248
|
+
* @property {string} fetch.login.payload.identifier Name of the identifier field (username/email)
|
|
249
|
+
* @property {string} fetch.login.payload.password Name of the password field
|
|
250
250
|
* @property {Object} fetch.forgotPassword Fetch config for password reset code request
|
|
251
251
|
* @property {string} fetch.forgotPassword.url Endpoint to request a reset link/code
|
|
252
252
|
* @property {string} fetch.forgotPassword.method HTTP method
|
|
@@ -291,11 +291,6 @@ class Login extends CustomElement {
|
|
|
291
291
|
},
|
|
292
292
|
actions: {},
|
|
293
293
|
|
|
294
|
-
fields: {
|
|
295
|
-
identifier: "username",
|
|
296
|
-
password: "password",
|
|
297
|
-
}
|
|
298
|
-
|
|
299
294
|
callbacks: {
|
|
300
295
|
username: null,
|
|
301
296
|
forgotPassword: null,
|
|
@@ -345,6 +340,11 @@ class Login extends CustomElement {
|
|
|
345
340
|
"Content-Type": "application/json; charset=utf-8",
|
|
346
341
|
},
|
|
347
342
|
credentials: "same-origin",
|
|
343
|
+
|
|
344
|
+
payload: {
|
|
345
|
+
identifier: "identifier",
|
|
346
|
+
password: "password",
|
|
347
|
+
},
|
|
348
348
|
},
|
|
349
349
|
forgotPassword: {
|
|
350
350
|
url: "",
|
|
@@ -1134,7 +1134,7 @@ function initEventHandler() {
|
|
|
1134
1134
|
|
|
1135
1135
|
const type = "click";
|
|
1136
1136
|
|
|
1137
|
-
element.addEventListener(type, function(event) {
|
|
1137
|
+
element.addEventListener(type, function (event) {
|
|
1138
1138
|
const callback = self.getOption("actions.click");
|
|
1139
1139
|
|
|
1140
1140
|
fireCustomEvent(self, "monster-login-clicked", {
|
|
@@ -1302,10 +1302,10 @@ function initEventHandler() {
|
|
|
1302
1302
|
}
|
|
1303
1303
|
|
|
1304
1304
|
const identifierField =
|
|
1305
|
-
this.getOption("
|
|
1305
|
+
this.getOption("fetch.login.payload.identifier") || "username";
|
|
1306
1306
|
|
|
1307
1307
|
const passwordField =
|
|
1308
|
-
this.getOption("
|
|
1308
|
+
this.getOption("fetch.login.payload.password") || "password";
|
|
1309
1309
|
|
|
1310
1310
|
const payload = {
|
|
1311
1311
|
[identifierField]: username,
|