@schukai/monster 4.2.0 → 4.3.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 CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.3.0] - 2025-05-12
6
+
7
+ ### Add Features
8
+
9
+ - Add support for array-list filter serialization in Datatable
10
+ ### Changes
11
+
12
+ - Enhance documentation for login component properties
13
+
14
+
15
+
5
16
  ## [4.2.0] - 2025-05-12
6
17
 
7
18
  ### 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.2.0"}
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.0"}
@@ -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 Main template
170
- * @property {Object} labels Label definitions
171
- * @property {Object} classes Class definitions
172
- * @property {string} classes.usernameInvalid Class for invalid
173
- * @property {string} classes.passwordInvalid Class for invalid
174
- * @property {string} classes.emailInvalid Class for invalid
175
- * @property {boolean} disabled Disabled
176
- * @property {Object} features Feature definitions
177
- * @property {boolean} features.forgotPassword Forgot Password enabled
178
- * @property {boolean} features.redirectToFirstSuccessUrl Redirect to first success URL
179
- * @property {Object} actions Action definitions
180
- * @property {number} digits Digits
181
- * @property {Object[]} successUrls Success URLs
182
- * @property {string} successUrls.label Label
183
- * @property {string} successUrls.url URL
184
- * @property {number} timeoutForMessage Timeout for message
185
- * @property {number} timeoutForSuccess Timeout for success
186
- * @property {Object} accessKeys Access keys
187
- * @property {string} accessKeys.loginLink Login link
188
- * @property {string} accessKeys.username Username
189
- * @property {string} accessKeys.password Password
190
- * @property {Object} fetch Fetch definitions
191
- * @property {Object} fetch.login Login fetch
192
- * @property {string} fetch.login.url URL
193
- * @property {string} fetch.login.method Method
194
- * @property {string} fetch.login.mode Mode
195
- * @property {Object} fetch.login.headers Headers
196
- * @property {string} fetch.login.headers.accept Accept
197
- * @property {string} fetch.login.credentials Credentials
198
- * @property {Object} fetch.forgotPassword Forgot Password fetch
199
- * @property {string} fetch.forgotPassword.url URL
200
- * @property {string} fetch.forgotPassword.method Method
201
- * @property {string} fetch.forgotPassword.mode Mode
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.credentials Credentials
205
- * @property {Object} fetch.digits Digits fetch
206
- * @property {string} fetch.digits.url URL
207
- * @property {string} fetch.digits.method Method
208
- * @property {string} fetch.digits.mode Mode
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.credentials Credentials
212
- * @property {Object} fetch.secondFactor Second Factor fetch
213
- * @property {string} fetch.secondFactor.url URL
214
- * @property {string} fetch.secondFactor.method Method
215
- * @property {string} fetch.secondFactor.mode Mode
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.credentials Credentials
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, {