@schukai/monster 4.2.0 → 4.3.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
CHANGED
@@ -2,6 +2,25 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## [4.3.1] - 2025-05-12
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- Improve structure and port attributes in login and password components
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## [4.3.0] - 2025-05-12
|
14
|
+
|
15
|
+
### Add Features
|
16
|
+
|
17
|
+
- Add support for array-list filter serialization in Datatable
|
18
|
+
### Changes
|
19
|
+
|
20
|
+
- Enhance documentation for login component properties
|
21
|
+
|
22
|
+
|
23
|
+
|
5
24
|
## [4.2.0] - 2025-05-12
|
6
25
|
|
7
26
|
### Add Features
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.0","@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.0","@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.3.1"}
|
@@ -1231,6 +1231,25 @@ function collectSearchQueries() {
|
|
1231
1231
|
.join(",")
|
1232
1232
|
);
|
1233
1233
|
},
|
1234
|
+
"array-list": (value, key) => {
|
1235
|
+
if (isString(value)) {
|
1236
|
+
value = value.split(",");
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
if (!isArray(value)) {
|
1240
|
+
return "";
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
return (
|
1244
|
+
key +
|
1245
|
+
"=" +
|
1246
|
+
value
|
1247
|
+
.map((v) => {
|
1248
|
+
return `"${encodeURIComponent(v)}"`;
|
1249
|
+
})
|
1250
|
+
.join(",")
|
1251
|
+
);
|
1252
|
+
},
|
1234
1253
|
"date-range": (value, key) => {
|
1235
1254
|
const query = parseDateInput(value, key);
|
1236
1255
|
if (!query || query === "false") {
|
@@ -166,56 +166,88 @@ class Login extends CustomElement {
|
|
166
166
|
* The individual configuration values can be found in the table.
|
167
167
|
*
|
168
168
|
* @property {Object} templates Template definitions
|
169
|
-
* @property {string} templates.main
|
170
|
-
* @property {Object} labels Label definitions
|
171
|
-
* @property {
|
172
|
-
* @property {string}
|
173
|
-
* @property {string}
|
174
|
-
* @property {string}
|
175
|
-
* @property {
|
176
|
-
* @property {
|
177
|
-
* @property {
|
178
|
-
* @property {
|
179
|
-
* @property {
|
180
|
-
* @property {
|
181
|
-
* @property {
|
182
|
-
* @property {string}
|
183
|
-
* @property {string}
|
184
|
-
* @property {
|
185
|
-
* @property {
|
186
|
-
* @property {
|
187
|
-
* @property {string}
|
188
|
-
* @property {string}
|
189
|
-
* @property {string}
|
190
|
-
* @property {
|
191
|
-
* @property {
|
192
|
-
* @property {string}
|
193
|
-
* @property {string}
|
194
|
-
* @property {string}
|
195
|
-
* @property {Object}
|
196
|
-
* @property {string}
|
197
|
-
* @property {string}
|
198
|
-
* @property {
|
199
|
-
* @property {string}
|
200
|
-
* @property {
|
201
|
-
* @property {
|
169
|
+
* @property {string} templates.main The main HTML template used for rendering the login form
|
170
|
+
* @property {Object} labels Label definitions used for localization and form messages
|
171
|
+
* @property {string} labels.username Label for the username or email field
|
172
|
+
* @property {string} labels.password Label for the password field
|
173
|
+
* @property {string} labels.login Label for the login button
|
174
|
+
* @property {string} labels.forgotPasswordLink Text for the "forgot password" link
|
175
|
+
* @property {string} labels.mailAddress Label for the email input in password reset flow
|
176
|
+
* @property {string} labels.requestLink Label for the button that sends a password reset code
|
177
|
+
* @property {string} labels.digits Label for the digits input field
|
178
|
+
* @property {string} labels.loginLink Label for the back-to-login link
|
179
|
+
* @property {string} labels.secondFactor Label for the second factor authentication input
|
180
|
+
* @property {string} labels.sendDigits Label for the button that submits the digits input
|
181
|
+
* @property {string} labels.sendSecondFactorDigits Label for the button that submits the second factor code
|
182
|
+
* @property {string} labels.resetLoginProcess Label for the link to return to the login form
|
183
|
+
* @property {string} labels.messageEmptyUserName Message shown when username is empty
|
184
|
+
* @property {string} labels.messageEmptyPassword Message shown when password is empty
|
185
|
+
* @property {string} labels.messageEmptyBoth Message shown when both username and password are empty
|
186
|
+
* @property {string} labels.messageEmptyEmail Message shown when email field is empty
|
187
|
+
* @property {string} labels.messageInvalidEmail Message shown when an invalid email address is entered
|
188
|
+
* @property {string} labels.digitsEmpty Message shown when digits field is empty
|
189
|
+
* @property {string} labels.digitsInvalid Message shown when digits input is invalid
|
190
|
+
* @property {string} labels.messageLoginFailed Message shown on failed login attempt
|
191
|
+
* @property {string} labels.messageForbidden Message shown on successful login with insufficient permissions
|
192
|
+
* @property {string} labels.messageSomethingWentWrong Fallback error message
|
193
|
+
* @property {string} labels.messageThisFormIsNotConfigured Message shown if no backend URL is configured
|
194
|
+
* @property {string} labels.messagePasswordResetDisabled Message shown if password reset is disabled due to 2FA
|
195
|
+
* @property {Object} classes Class definitions for visual styling
|
196
|
+
* @property {string} classes.usernameInvalid CSS class applied when username is invalid
|
197
|
+
* @property {string} classes.passwordInvalid CSS class applied when password is invalid
|
198
|
+
* @property {string} classes.emailInvalid CSS class applied when email input is invalid
|
199
|
+
* @property {string} classes.button CSS class applied to all form buttons
|
200
|
+
* @property {boolean} disabled If true, disables interaction with the component
|
201
|
+
* @property {Object} features Feature flags to toggle optional behavior
|
202
|
+
* @property {boolean} features.forgotPassword Enables the forgot password flow
|
203
|
+
* @property {boolean} features.redirectToFirstSuccessUrl If true, redirects to the first success URL after login
|
204
|
+
* @property {Object} actions Action definitions for custom event handling
|
205
|
+
* @property {Function} actions.click Callback function for generic click actions within the login component
|
206
|
+
* @property {Object} callbacks Optional callback hooks for modifying internal behavior
|
207
|
+
* @property {Function} callbacks.username A function that receives and can transform the entered username before submission
|
208
|
+
* @property {number} digits Number of digits required for second factor or password reset code input
|
209
|
+
* @property {Object[]} successUrls List of URLs shown after successful login (e.g., home or logout)
|
210
|
+
* @property {string} successUrls.label Label for the success URL (displayed)
|
211
|
+
* @property {string} successUrls.url Actual target URL
|
212
|
+
* @property {number} timeoutForMessage Duration in milliseconds to show error messages
|
213
|
+
* @property {number} timeoutForSuccess Duration in milliseconds before triggering the post-login success state
|
214
|
+
* @property {Object} accessKeys Keyboard access keys for accessibility and shortcuts
|
215
|
+
* @property {string} accessKeys.loginLink Access key for switching to login form
|
216
|
+
* @property {string} accessKeys.username Access key for focusing the username field
|
217
|
+
* @property {string} accessKeys.password Access key for focusing the password field
|
218
|
+
* @property {Object} fetch Definitions for backend requests to support login workflows
|
219
|
+
* @property {Object} fetch.login Fetch config for login request
|
220
|
+
* @property {string} fetch.login.url Endpoint to post login credentials to
|
221
|
+
* @property {string} fetch.login.method HTTP method for login (e.g., "POST")
|
222
|
+
* @property {string} fetch.login.mode Fetch mode (e.g., "same-origin")
|
223
|
+
* @property {Object} fetch.login.headers HTTP headers to be sent with the login request
|
224
|
+
* @property {string} fetch.login.headers.accept Accept header value
|
225
|
+
* @property {string} fetch.login.headers.Content-Type Content-Type header value
|
226
|
+
* @property {string} fetch.login.credentials Credential mode (e.g., "same-origin")
|
227
|
+
* @property {Object} fetch.forgotPassword Fetch config for password reset code request
|
228
|
+
* @property {string} fetch.forgotPassword.url Endpoint to request a reset link/code
|
229
|
+
* @property {string} fetch.forgotPassword.method HTTP method
|
230
|
+
* @property {string} fetch.forgotPassword.mode Fetch mode
|
202
231
|
* @property {Object} fetch.forgotPassword.headers Headers
|
203
|
-
* @property {string} fetch.forgotPassword.headers.accept Accept
|
204
|
-
* @property {string} fetch.forgotPassword.
|
205
|
-
* @property {
|
206
|
-
* @property {
|
207
|
-
* @property {string} fetch.digits.
|
208
|
-
* @property {string} fetch.digits.
|
232
|
+
* @property {string} fetch.forgotPassword.headers.accept Accept header
|
233
|
+
* @property {string} fetch.forgotPassword.headers.Content-Type Content-Type header
|
234
|
+
* @property {string} fetch.forgotPassword.credentials Credential mode
|
235
|
+
* @property {Object} fetch.digits Fetch config for submitting password reset code
|
236
|
+
* @property {string} fetch.digits.url Endpoint for validating the code
|
237
|
+
* @property {string} fetch.digits.method HTTP method
|
238
|
+
* @property {string} fetch.digits.mode Fetch mode
|
209
239
|
* @property {Object} fetch.digits.headers Headers
|
210
|
-
* @property {string} fetch.digits.headers.accept Accept
|
211
|
-
* @property {string} fetch.digits.
|
212
|
-
* @property {
|
213
|
-
* @property {
|
214
|
-
* @property {string} fetch.secondFactor.
|
215
|
-
* @property {string} fetch.secondFactor.
|
240
|
+
* @property {string} fetch.digits.headers.accept Accept header
|
241
|
+
* @property {string} fetch.digits.headers.Content-Type Content-Type header
|
242
|
+
* @property {string} fetch.digits.credentials Credential mode
|
243
|
+
* @property {Object} fetch.secondFactor Fetch config for submitting second factor code
|
244
|
+
* @property {string} fetch.secondFactor.url Endpoint to validate second factor code
|
245
|
+
* @property {string} fetch.secondFactor.method HTTP method
|
246
|
+
* @property {string} fetch.secondFactor.mode Fetch mode
|
216
247
|
* @property {Object} fetch.secondFactor.headers Headers
|
217
|
-
* @property {string} fetch.secondFactor.headers.accept Accept
|
218
|
-
* @property {string} fetch.secondFactor.
|
248
|
+
* @property {string} fetch.secondFactor.headers.accept Accept header
|
249
|
+
* @property {string} fetch.secondFactor.headers.Content-Type Content-Type header
|
250
|
+
* @property {string} fetch.secondFactor.credentials Credential mode
|
219
251
|
*/
|
220
252
|
get defaults() {
|
221
253
|
return Object.assign({}, super.defaults, {
|
@@ -1565,8 +1597,7 @@ function getTemplate() {
|
|
1565
1597
|
exportparts="control:collapse-login-control,
|
1566
1598
|
container:collapse-login-container,
|
1567
1599
|
deco:collapse-login-deco"
|
1568
|
-
part="login-collapse"
|
1569
|
-
>
|
1600
|
+
part="login-collapse">
|
1570
1601
|
<monster-field-set
|
1571
1602
|
exportparts="
|
1572
1603
|
control:field-set-login-control,
|
@@ -1578,10 +1609,14 @@ function getTemplate() {
|
|
1578
1609
|
part="login-field-set">
|
1579
1610
|
<slot name="login-header"></slot>
|
1580
1611
|
<label part="login-label" data-monster-replace="path:labels.username"></label>
|
1581
|
-
<input type="text" name="username" autofocus autocomplete="off">
|
1612
|
+
<input part="login-username" type="text" name="username" autofocus autocomplete="off">
|
1582
1613
|
<div data-monster-attributes="class path:classes.usernameInvalid"></div>
|
1583
1614
|
<label part="login-password-label" data-monster-replace="path:labels.password"></label>
|
1584
|
-
<monster-password
|
1615
|
+
<monster-password
|
1616
|
+
exportparts="input-group:input-group-password,
|
1617
|
+
control:input-group-password-control,
|
1618
|
+
input:input-group-password-input" part="login-password"
|
1619
|
+
data-monster-bind="path:password"></monster-password>
|
1585
1620
|
<div data-monster-attributes="class path:classes.passwordInvalid"></div>
|
1586
1621
|
<monster-message-state-button id="loginButton"
|
1587
1622
|
part="login-button"
|
@@ -1619,6 +1654,7 @@ function getTemplate() {
|
|
1619
1654
|
<slot name="forgot-password-header"></slot>
|
1620
1655
|
<label part="forgot-password-label" data-monster-replace="path:labels.mailAddress"></label>
|
1621
1656
|
<input type="email" name="email"
|
1657
|
+
part="field-set-forgot-password-email"
|
1622
1658
|
data-monster-attributes="accesskey path:accessKeys.username"
|
1623
1659
|
autocomplete="off">
|
1624
1660
|
<div data-monster-attributes="class path:classes.emailInvalid"></div>
|
@@ -1661,6 +1697,7 @@ function getTemplate() {
|
|
1661
1697
|
<label part="second-factor-label" data-monster-replace="path:labels.secondFactor"></label>
|
1662
1698
|
<div>
|
1663
1699
|
<monster-digits data-monster-attributes="data-monster-option-digits path:digits"
|
1700
|
+
part="second-factor-digits-control"
|
1664
1701
|
id="secondFactorControl"></monster-digits>
|
1665
1702
|
</div>
|
1666
1703
|
<!-- SECOND FACTOR COLLAPSE -->
|
@@ -1700,7 +1737,8 @@ function getTemplate() {
|
|
1700
1737
|
<slot name="digits-header"></slot>
|
1701
1738
|
<label part="digits-label" data-monster-replace="path:labels.digits"></label>
|
1702
1739
|
<div>
|
1703
|
-
<monster-digits
|
1740
|
+
<monster-digits part="digits-control"
|
1741
|
+
data-monster-attributes="data-monster-option-digits path:digits"
|
1704
1742
|
id="digitsControl"></monster-digits>
|
1705
1743
|
</div>
|
1706
1744
|
<monster-message-state-button id="digitsButton"
|
@@ -251,8 +251,9 @@ function getTemplate() {
|
|
251
251
|
// language=HTML
|
252
252
|
return `
|
253
253
|
<div data-monster-role="control" part="control">
|
254
|
-
<monster-input-group>
|
254
|
+
<monster-input-group part="input-group">
|
255
255
|
<input data-monster-role="input"
|
256
|
+
part="input"
|
256
257
|
style="border:0"
|
257
258
|
data-monster-attributes="
|
258
259
|
type path:type,
|
@@ -261,9 +262,7 @@ function getTemplate() {
|
|
261
262
|
autocomplete path:autocomplete,
|
262
263
|
inputmode path:inputmode,
|
263
264
|
aria-required path:aria.required,
|
264
|
-
aria-placeholder path:aria.placeholder"
|
265
|
-
>
|
266
|
-
|
265
|
+
aria-placeholder path:aria.placeholder">
|
267
266
|
<svg viewBox="0 0 16 16" data-monster-role="visible-icon" class="hidden">
|
268
267
|
\${visible-icon}
|
269
268
|
</svg>
|