@schukai/monster 4.1.1 → 4.2.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.
@@ -171,7 +171,7 @@ class Header extends Base {
171
171
  }
172
172
 
173
173
  /**
174
- * @param {string} grid
174
+ * @return {string}
175
175
  */
176
176
  get grid() {
177
177
  return this.getInternal("grid");
@@ -191,6 +191,9 @@ class Header extends Base {
191
191
  return this.getInternal("html");
192
192
  }
193
193
 
194
+ /**
195
+ * @return {string}
196
+ */
194
197
  get order() {
195
198
  return this.getInternal("order");
196
199
  }
@@ -236,6 +236,10 @@ class Login extends CustomElement {
236
236
  },
237
237
  actions: {},
238
238
 
239
+ callbacks : {
240
+ username : null,
241
+ },
242
+
239
243
  digits: 6,
240
244
 
241
245
  successUrls: [
@@ -1076,11 +1080,19 @@ function initEventHandler() {
1076
1080
  });
1077
1081
 
1078
1082
  this[loginButtonSymbol].setOption("actions.click", (event) => {
1079
- // get username and password
1080
- const username = this.shadowRoot.querySelector(
1083
+
1084
+ let username = this.shadowRoot.querySelector(
1081
1085
  "input[name='username']",
1082
1086
  ).value;
1083
1087
 
1088
+ const userCallback = this.getOption("callbacks.username");
1089
+ if (isFunction(userCallback)) {
1090
+ const userCallbackResult = userCallback.call(this, username);
1091
+ if (userCallbackResult !== undefined) {
1092
+ username = userCallbackResult;
1093
+ }
1094
+ }
1095
+
1084
1096
  const password = this.shadowRoot.querySelector("monster-password").value;
1085
1097
 
1086
1098
  let missingBits = 0;