keycloakify 10.0.0-rc.17 → 10.0.0-rc.18

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.
Files changed (205) hide show
  1. package/PUBLIC_URL.js.map +1 -1
  2. package/account/Template.js +5 -5
  3. package/account/Template.js.map +1 -1
  4. package/account/i18n/i18n.js +37 -29
  5. package/account/i18n/i18n.js.map +1 -1
  6. package/account/kcContext/KcContext.js.map +1 -1
  7. package/account/kcContext/createGetKcContext.js +20 -15
  8. package/account/kcContext/createGetKcContext.js.map +1 -1
  9. package/account/kcContext/getKcContext.js.map +1 -1
  10. package/account/kcContext/getKcContextFromWindow.d.ts +3 -1
  11. package/account/kcContext/getKcContextFromWindow.js.map +1 -1
  12. package/account/kcContext/kcContextMocks.js +148 -144
  13. package/account/kcContext/kcContextMocks.js.map +1 -1
  14. package/account/lib/useGetClassName.js +14 -14
  15. package/account/lib/useGetClassName.js.map +1 -1
  16. package/account/pages/Account.js +1 -1
  17. package/account/pages/Account.js.map +1 -1
  18. package/account/pages/Password.js +7 -7
  19. package/account/pages/Password.js.map +1 -1
  20. package/account/pages/Totp.js +4 -4
  21. package/account/pages/Totp.js.map +1 -1
  22. package/bin/main.js +2066 -2165
  23. package/bin/shared/constants.d.ts +1 -0
  24. package/bin/shared/constants.js +4 -3
  25. package/bin/shared/constants.js.map +1 -1
  26. package/lib/isStorybook.js +2 -1
  27. package/lib/isStorybook.js.map +1 -1
  28. package/lib/useGetClassName.js.map +1 -1
  29. package/login/Template.js +13 -13
  30. package/login/Template.js.map +1 -1
  31. package/login/UserProfileFormFields.js +43 -41
  32. package/login/UserProfileFormFields.js.map +1 -1
  33. package/login/i18n/baseMessages/ca.d.ts +1 -1
  34. package/login/i18n/baseMessages/ca.js +1 -1
  35. package/login/i18n/baseMessages/el.d.ts +0 -1
  36. package/login/i18n/baseMessages/el.js +0 -1
  37. package/login/i18n/baseMessages/el.js.map +1 -1
  38. package/login/i18n/baseMessages/en.d.ts +1 -1
  39. package/login/i18n/baseMessages/en.js +1 -1
  40. package/login/i18n/baseMessages/es.d.ts +1 -1
  41. package/login/i18n/baseMessages/es.js +1 -1
  42. package/login/i18n/baseMessages/fa.d.ts +0 -1
  43. package/login/i18n/baseMessages/fa.js +0 -1
  44. package/login/i18n/baseMessages/fa.js.map +1 -1
  45. package/login/i18n/baseMessages/hu.d.ts +1 -1
  46. package/login/i18n/baseMessages/hu.js +1 -1
  47. package/login/i18n/baseMessages/index.d.ts +1 -2
  48. package/login/i18n/baseMessages/zh-CN.d.ts +1 -1
  49. package/login/i18n/baseMessages/zh-CN.js +1 -1
  50. package/login/i18n/i18n.js +39 -31
  51. package/login/i18n/i18n.js.map +1 -1
  52. package/login/kcContext/KcContext.js.map +1 -1
  53. package/login/kcContext/createGetKcContext.js +30 -22
  54. package/login/kcContext/createGetKcContext.js.map +1 -1
  55. package/login/kcContext/getKcContext.js.map +1 -1
  56. package/login/kcContext/getKcContextFromWindow.d.ts +3 -1
  57. package/login/kcContext/getKcContextFromWindow.js.map +1 -1
  58. package/login/kcContext/kcContextMocks.js +233 -231
  59. package/login/kcContext/kcContextMocks.js.map +1 -1
  60. package/login/lib/useDownloadTerms.js.map +1 -1
  61. package/login/lib/useGetClassName.js +112 -112
  62. package/login/lib/useGetClassName.js.map +1 -1
  63. package/login/lib/useUserProfileForm.js +181 -181
  64. package/login/lib/useUserProfileForm.js.map +1 -1
  65. package/login/pages/DeleteAccountConfirm.js +5 -1
  66. package/login/pages/DeleteAccountConfirm.js.map +1 -1
  67. package/login/pages/FrontchannelLogout.js +1 -1
  68. package/login/pages/FrontchannelLogout.js.map +1 -1
  69. package/login/pages/Login.js.map +1 -1
  70. package/login/pages/LoginRecoveryAuthnCodeConfig.js +3 -3
  71. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
  72. package/login/pages/LoginResetPassword.js.map +1 -1
  73. package/login/pages/LoginUsername.js.map +1 -1
  74. package/login/pages/WebauthnAuthenticate.js +11 -8
  75. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  76. package/login/pages/WebauthnRegister.js +7 -7
  77. package/login/pages/WebauthnRegister.js.map +1 -1
  78. package/package.json +230 -226
  79. package/src/PUBLIC_URL.ts +4 -1
  80. package/src/account/Template.tsx +5 -5
  81. package/src/account/TemplateProps.ts +4 -1
  82. package/src/account/i18n/i18n.tsx +40 -30
  83. package/src/account/kcContext/KcContext.ts +4 -1
  84. package/src/account/kcContext/createGetKcContext.ts +48 -22
  85. package/src/account/kcContext/getKcContext.ts +3 -1
  86. package/src/account/kcContext/getKcContextFromWindow.ts +6 -2
  87. package/src/account/kcContext/kcContextMocks.ts +164 -160
  88. package/src/account/lib/useGetClassName.ts +15 -14
  89. package/src/account/pages/Account.tsx +2 -2
  90. package/src/account/pages/Password.tsx +8 -8
  91. package/src/account/pages/Totp.tsx +4 -6
  92. package/src/bin/copy-keycloak-resources-to-public.ts +2 -2
  93. package/src/bin/download-keycloak-default-theme.ts +30 -8
  94. package/src/bin/eject-page.ts +48 -11
  95. package/src/bin/initialize-email-theme.ts +25 -17
  96. package/src/bin/keycloakify/buildJars/buildJar.ts +179 -104
  97. package/src/bin/keycloakify/buildJars/buildJars.ts +35 -16
  98. package/src/bin/keycloakify/buildJars/extensionVersions.ts +2 -1
  99. package/src/bin/keycloakify/buildJars/generatePom.ts +11 -3
  100. package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +33 -8
  101. package/src/bin/keycloakify/generateFtl/generateFtl.ts +49 -12
  102. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +29 -18
  103. package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +35 -12
  104. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +3 -1
  105. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +86 -41
  106. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +39 -15
  107. package/src/bin/keycloakify/generateSrcMainResources/readExtraPageNames.ts +21 -7
  108. package/src/bin/keycloakify/generateSrcMainResources/readFieldNameUsage.ts +34 -7
  109. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +19 -5
  110. package/src/bin/keycloakify/keycloakify.ts +28 -9
  111. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +24 -5
  112. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +6 -2
  113. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +6 -3
  114. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +24 -6
  115. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +49 -11
  116. package/src/bin/main.ts +78 -41
  117. package/src/bin/shared/KeycloakVersionRange.ts +3 -1
  118. package/src/bin/shared/buildOptions.ts +70 -43
  119. package/src/bin/shared/constants.ts +4 -2
  120. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +27 -13
  121. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +161 -218
  122. package/src/bin/shared/downloadKeycloakStaticResources.ts +25 -21
  123. package/src/bin/shared/getJarFileBasename.ts +3 -1
  124. package/src/bin/shared/getThemeSrcDirPath.ts +5 -2
  125. package/src/bin/shared/metaInfKeycloakThemes.ts +35 -8
  126. package/src/bin/shared/promptKeycloakVersion.ts +33 -14
  127. package/src/bin/start-keycloak/index.ts +1 -0
  128. package/src/bin/start-keycloak/myrealm-realm-23.json +2142 -0
  129. package/src/bin/start-keycloak/myrealm-realm-24.json +2318 -0
  130. package/src/bin/start-keycloak/start-keycloak.ts +467 -0
  131. package/src/bin/tools/SemVer.ts +32 -13
  132. package/src/bin/tools/String.prototype.replaceAll.ts +9 -2
  133. package/src/bin/tools/crawl.ts +4 -1
  134. package/src/bin/tools/crc32.ts +42 -24
  135. package/src/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.ts +262 -0
  136. package/src/bin/tools/downloadAndExtractArchive/fetchProxyOptions.ts +96 -0
  137. package/src/bin/tools/downloadAndExtractArchive/index.ts +1 -0
  138. package/src/bin/tools/extractArchive.ts +120 -0
  139. package/src/bin/tools/fetchProxyOptions.ts +31 -8
  140. package/src/bin/tools/getAbsoluteAndInOsFormatPath.ts +10 -2
  141. package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +18 -5
  142. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +8 -2
  143. package/src/bin/tools/octokit-addons/listTags.ts +15 -4
  144. package/src/bin/tools/partitionPromiseSettledResults.ts +12 -3
  145. package/src/bin/tools/readThisNpmPackageVersion.ts +5 -1
  146. package/src/bin/tools/transformCodebase.ts +29 -10
  147. package/src/bin/tools/trimIndent.ts +4 -1
  148. package/src/lib/isStorybook.ts +3 -1
  149. package/src/lib/useGetClassName.ts +12 -3
  150. package/src/login/Template.tsx +14 -14
  151. package/src/login/TemplateProps.ts +4 -1
  152. package/src/login/UserProfileFormFields.tsx +44 -42
  153. package/src/login/i18n/baseMessages/ca.ts +1 -1
  154. package/src/login/i18n/baseMessages/el.ts +0 -1
  155. package/src/login/i18n/baseMessages/en.ts +1 -1
  156. package/src/login/i18n/baseMessages/es.ts +1 -1
  157. package/src/login/i18n/baseMessages/fa.ts +0 -1
  158. package/src/login/i18n/baseMessages/hu.ts +1 -1
  159. package/src/login/i18n/baseMessages/zh-CN.ts +1 -1
  160. package/src/login/i18n/i18n.tsx +42 -32
  161. package/src/login/kcContext/KcContext.ts +8 -2
  162. package/src/login/kcContext/createGetKcContext.ts +84 -37
  163. package/src/login/kcContext/getKcContext.ts +3 -1
  164. package/src/login/kcContext/getKcContextFromWindow.ts +6 -2
  165. package/src/login/kcContext/kcContextMocks.ts +339 -325
  166. package/src/login/lib/useDownloadTerms.ts +6 -4
  167. package/src/login/lib/useGetClassName.ts +119 -112
  168. package/src/login/lib/useUserProfileForm.tsx +219 -205
  169. package/src/login/pages/DeleteAccountConfirm.tsx +9 -3
  170. package/src/login/pages/FrontchannelLogout.tsx +1 -1
  171. package/src/login/pages/Login.tsx +2 -2
  172. package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +3 -3
  173. package/src/login/pages/LoginResetPassword.tsx +2 -2
  174. package/src/login/pages/LoginUsername.tsx +2 -2
  175. package/src/login/pages/WebauthnAuthenticate.tsx +11 -8
  176. package/src/login/pages/WebauthnRegister.tsx +7 -7
  177. package/src/tools/AndByDiscriminatingKey.ts +12 -6
  178. package/src/tools/Array.prototype.every.ts +4 -1
  179. package/src/tools/LazyOrNot.ts +3 -1
  180. package/src/tools/clsx.ts +7 -1
  181. package/src/tools/deepAssign.ts +15 -8
  182. package/src/tools/deepClone.ts +3 -1
  183. package/src/tools/formatNumber.ts +4 -1
  184. package/src/tools/useConstCallback.ts +3 -1
  185. package/src/tools/useInsertLinkTags.ts +20 -7
  186. package/src/tools/useInsertScriptTags.ts +7 -2
  187. package/src/tools/useSetClassName.ts +4 -1
  188. package/src/vite-plugin/vite-plugin.ts +45 -21
  189. package/tools/Array.prototype.every.js +2 -1
  190. package/tools/Array.prototype.every.js.map +1 -1
  191. package/tools/clsx.js.map +1 -1
  192. package/tools/deepAssign.js +9 -7
  193. package/tools/deepAssign.js.map +1 -1
  194. package/tools/deepClone.js.map +1 -1
  195. package/tools/formatNumber.js.map +1 -1
  196. package/tools/useConstCallback.js.map +1 -1
  197. package/tools/useInsertLinkTags.js +5 -4
  198. package/tools/useInsertLinkTags.js.map +1 -1
  199. package/tools/useInsertScriptTags.js +5 -2
  200. package/tools/useInsertScriptTags.js.map +1 -1
  201. package/tools/useSetClassName.js.map +1 -1
  202. package/vite-plugin/index.js +975 -1651
  203. package/src/bin/shared/downloadAndUnzip.ts +0 -203
  204. package/src/bin/start-keycloak.ts +0 -309
  205. package/src/bin/tools/unzip.ts +0 -141
@@ -23,11 +23,11 @@ export function useUserProfileForm(params) {
23
23
  var _a, _b;
24
24
  const { kcContext, i18n, doMakeUserConfirmPassword } = params;
25
25
  const { insertScriptTags } = useInsertScriptTags({
26
- "scriptTags": Object.keys((_b = (_a = kcContext.profile) === null || _a === void 0 ? void 0 : _a.html5DataAnnotations) !== null && _b !== void 0 ? _b : {})
26
+ scriptTags: Object.keys((_b = (_a = kcContext.profile) === null || _a === void 0 ? void 0 : _a.html5DataAnnotations) !== null && _b !== void 0 ? _b : {})
27
27
  .filter(key => key !== "kcMultivalued" && key !== "kcNumberFormat") // NOTE: Keycloakify handles it.
28
28
  .map(key => ({
29
- "type": "module",
30
- "src": `${kcContext.url.resourcesPath}/js/${key}.js`
29
+ type: "module",
30
+ src: `${kcContext.url.resourcesPath}/js/${key}.js`
31
31
  }))
32
32
  });
33
33
  useEffect(() => {
@@ -58,15 +58,15 @@ export function useUserProfileForm(params) {
58
58
  .map(name => {
59
59
  var _a;
60
60
  return id({
61
- "name": name,
62
- "displayName": id(`\${${name}}`),
63
- "required": true,
64
- "value": (_a = kcContext.register.formData[name]) !== null && _a !== void 0 ? _a : "",
65
- "html5DataAnnotations": {},
66
- "readOnly": false,
67
- "validators": {},
68
- "annotations": {},
69
- "autocomplete": (() => {
61
+ name: name,
62
+ displayName: id(`\${${name}}`),
63
+ required: true,
64
+ value: (_a = kcContext.register.formData[name]) !== null && _a !== void 0 ? _a : "",
65
+ html5DataAnnotations: {},
66
+ readOnly: false,
67
+ validators: {},
68
+ annotations: {},
69
+ autocomplete: (() => {
70
70
  switch (name) {
71
71
  case "email":
72
72
  return "email";
@@ -86,15 +86,15 @@ export function useUserProfileForm(params) {
86
86
  .map(name => {
87
87
  var _a;
88
88
  return id({
89
- "name": name,
90
- "displayName": id(`\${${name}}`),
91
- "required": true,
92
- "value": (_a = kcContext.user[name]) !== null && _a !== void 0 ? _a : "",
93
- "html5DataAnnotations": {},
94
- "readOnly": false,
95
- "validators": {},
96
- "annotations": {},
97
- "autocomplete": (() => {
89
+ name: name,
90
+ displayName: id(`\${${name}}`),
91
+ required: true,
92
+ value: (_a = kcContext.user[name]) !== null && _a !== void 0 ? _a : "",
93
+ html5DataAnnotations: {},
94
+ readOnly: false,
95
+ validators: {},
96
+ annotations: {},
97
+ autocomplete: (() => {
98
98
  switch (name) {
99
99
  case "email":
100
100
  return "email";
@@ -111,15 +111,15 @@ export function useUserProfileForm(params) {
111
111
  //NOTE: Handle legacy update-email.ftl
112
112
  return [
113
113
  id({
114
- "name": "email",
115
- "displayName": id(`\${email}`),
116
- "required": true,
117
- "value": (_a = kcContext.email.value) !== null && _a !== void 0 ? _a : "",
118
- "html5DataAnnotations": {},
119
- "readOnly": false,
120
- "validators": {},
121
- "annotations": {},
122
- "autocomplete": "email"
114
+ name: "email",
115
+ displayName: id(`\${email}`),
116
+ required: true,
117
+ value: (_a = kcContext.email.value) !== null && _a !== void 0 ? _a : "",
118
+ html5DataAnnotations: {},
119
+ readOnly: false,
120
+ validators: {},
121
+ annotations: {},
122
+ autocomplete: "email"
123
123
  })
124
124
  ];
125
125
  }
@@ -128,11 +128,11 @@ export function useUserProfileForm(params) {
128
128
  return kcContext.profile.attributes.map(attribute_pre_group_patch => {
129
129
  if (typeof attribute_pre_group_patch.group === "string" && attribute_pre_group_patch.group !== "") {
130
130
  const _a = attribute_pre_group_patch, { group, groupDisplayHeader, groupDisplayDescription, groupAnnotations } = _a, rest = __rest(_a, ["group", "groupDisplayHeader", "groupDisplayDescription", "groupAnnotations"]);
131
- return id(Object.assign(Object.assign({}, rest), { "group": {
132
- "name": group,
133
- "displayHeader": groupDisplayHeader,
134
- "displayDescription": groupDisplayDescription,
135
- "html5DataAnnotations": {}
131
+ return id(Object.assign(Object.assign({}, rest), { group: {
132
+ name: group,
133
+ displayHeader: groupDisplayHeader,
134
+ displayDescription: groupDisplayDescription,
135
+ html5DataAnnotations: {}
136
136
  } }));
137
137
  }
138
138
  return attribute_pre_group_patch;
@@ -149,7 +149,7 @@ export function useUserProfileForm(params) {
149
149
  // It's either email or username.
150
150
  break add_password_and_password_confirm;
151
151
  }
152
- syntheticAttributes.push(Object.assign({ "name": "password", "displayName": id("${password}"), "required": true, "readOnly": false, "validators": {}, "annotations": {}, "autocomplete": "new-password", "html5DataAnnotations": {} }, { "groupAnnotations": {} }), Object.assign({ "name": "password-confirm", "displayName": id("${passwordConfirm}"), "required": true, "readOnly": false, "validators": {}, "annotations": {}, "html5DataAnnotations": {}, "autocomplete": "new-password" }, { "groupAnnotations": {} }));
152
+ syntheticAttributes.push(Object.assign({ name: "password", displayName: id("${password}"), required: true, readOnly: false, validators: {}, annotations: {}, autocomplete: "new-password", html5DataAnnotations: {} }, { groupAnnotations: {} }), Object.assign({ name: "password-confirm", displayName: id("${passwordConfirm}"), required: true, readOnly: false, validators: {}, annotations: {}, html5DataAnnotations: {}, autocomplete: "new-password" }, { groupAnnotations: {} }));
153
153
  }
154
154
  }
155
155
  return syntheticAttributes;
@@ -172,7 +172,7 @@ export function useUserProfileForm(params) {
172
172
  break apply_validator_min_range;
173
173
  }
174
174
  const { min: minStr } = validator;
175
- if (minStr === undefined) {
175
+ if (!minStr) {
176
176
  break apply_validator_min_range;
177
177
  }
178
178
  const min = parseInt(`${minStr}`);
@@ -182,26 +182,26 @@ export function useUserProfileForm(params) {
182
182
  }
183
183
  out.push({
184
184
  attribute,
185
- "valueOrValues": values
185
+ valueOrValues: values
186
186
  });
187
187
  continue;
188
188
  }
189
189
  out.push({
190
190
  attribute,
191
- "valueOrValues": (_c = attribute.value) !== null && _c !== void 0 ? _c : ""
191
+ valueOrValues: (_c = attribute.value) !== null && _c !== void 0 ? _c : ""
192
192
  });
193
193
  }
194
194
  return out;
195
195
  })();
196
196
  const initialState = {
197
- "formFieldStates": initialFormFieldState.map(({ attribute, valueOrValues }) => ({
197
+ formFieldStates: initialFormFieldState.map(({ attribute, valueOrValues }) => ({
198
198
  attribute,
199
- "errors": getErrors({
200
- "attributeName": attribute.name,
201
- "formFieldStates": initialFormFieldState
199
+ errors: getErrors({
200
+ attributeName: attribute.name,
201
+ formFieldStates: initialFormFieldState
202
202
  }),
203
- "hasLostFocusAtLeastOnce": valueOrValues instanceof Array ? valueOrValues.map(() => false) : false,
204
- "valueOrValues": valueOrValues
203
+ hasLostFocusAtLeastOnce: valueOrValues instanceof Array ? valueOrValues.map(() => false) : false,
204
+ valueOrValues: valueOrValues
205
205
  }))
206
206
  };
207
207
  return initialState;
@@ -217,7 +217,7 @@ export function useUserProfileForm(params) {
217
217
  apply_formatters: {
218
218
  const { attribute } = formFieldState;
219
219
  const { kcNumberFormat } = (_a = attribute.html5DataAnnotations) !== null && _a !== void 0 ? _a : {};
220
- if (kcNumberFormat === undefined) {
220
+ if (!kcNumberFormat) {
221
221
  break apply_formatters;
222
222
  }
223
223
  if (formFieldState.valueOrValues instanceof Array) {
@@ -228,8 +228,8 @@ export function useUserProfileForm(params) {
228
228
  }
229
229
  }
230
230
  formFieldState.errors = getErrors({
231
- "attributeName": formAction.name,
232
- "formFieldStates": state.formFieldStates
231
+ attributeName: formAction.name,
232
+ formFieldStates: state.formFieldStates
233
233
  });
234
234
  update_password_confirm: {
235
235
  if (doMakeUserConfirmPassword) {
@@ -239,9 +239,9 @@ export function useUserProfileForm(params) {
239
239
  break update_password_confirm;
240
240
  }
241
241
  state = reducer(state, {
242
- "action": "update",
243
- "name": "password-confirm",
244
- "valueOrValues": formAction.valueOrValues
242
+ action: "update",
243
+ name: "password-confirm",
244
+ valueOrValues: formAction.valueOrValues
245
245
  });
246
246
  }
247
247
  return;
@@ -260,9 +260,9 @@ export function useUserProfileForm(params) {
260
260
  return Object.assign({}, state);
261
261
  }, initialState);
262
262
  const formState = useMemo(() => ({
263
- "formFieldStates": state.formFieldStates.map((_a) => {
263
+ formFieldStates: state.formFieldStates.map((_a) => {
264
264
  var { errors, hasLostFocusAtLeastOnce: hasLostFocusAtLeastOnceOrArr, attribute } = _a, valueOrValuesWrap = __rest(_a, ["errors", "hasLostFocusAtLeastOnce", "attribute"]);
265
- return (Object.assign({ "displayableErrors": errors.filter(error => {
265
+ return (Object.assign({ displayableErrors: errors.filter(error => {
266
266
  const hasLostFocusAtLeastOnce = typeof hasLostFocusAtLeastOnceOrArr === "boolean"
267
267
  ? hasLostFocusAtLeastOnceOrArr
268
268
  : error.fieldIndex !== undefined
@@ -316,7 +316,7 @@ export function useUserProfileForm(params) {
316
316
  }
317
317
  }), attribute }, valueOrValuesWrap));
318
318
  }),
319
- "isFormSubmittable": state.formFieldStates.every(({ errors }) => errors.length === 0)
319
+ isFormSubmittable: state.formFieldStates.every(({ errors }) => errors.length === 0)
320
320
  }), [state]);
321
321
  return {
322
322
  formState,
@@ -338,7 +338,7 @@ function useGetErrors(params) {
338
338
  let { valueOrValues } = formFieldState;
339
339
  unFormat_number: {
340
340
  const { kcNumberUnFormat } = (_a = attribute.html5DataAnnotations) !== null && _a !== void 0 ? _a : {};
341
- if (kcNumberUnFormat === undefined) {
341
+ if (!kcNumberUnFormat) {
342
342
  break unFormat_number;
343
343
  }
344
344
  if (valueOrValues instanceof Array) {
@@ -382,10 +382,10 @@ function useGetErrors(params) {
382
382
  return [
383
383
  {
384
384
  errorMessageStr,
385
- "errorMessage": _jsx("span", { children: errorMessageStr }, 0),
386
- "fieldIndex": undefined,
387
- "source": {
388
- "type": "server"
385
+ errorMessage: _jsx("span", { children: errorMessageStr }, 0),
386
+ fieldIndex: undefined,
387
+ source: {
388
+ type: "server"
389
389
  }
390
390
  }
391
391
  ];
@@ -403,12 +403,12 @@ function useGetErrors(params) {
403
403
  .map((...[, index]) => {
404
404
  const specificValueErrors = getErrors({
405
405
  attributeName,
406
- "formFieldStates": formFieldStates.map(formFieldState => {
406
+ formFieldStates: formFieldStates.map(formFieldState => {
407
407
  if (formFieldState.attribute.name === attributeName) {
408
408
  assert(formFieldState.valueOrValues instanceof Array);
409
409
  return {
410
- "attribute": Object.assign(Object.assign({}, attribute), { "annotations": Object.assign(Object.assign({}, attribute.annotations), { "inputType": undefined }), "multivalued": false }),
411
- "valueOrValues": formFieldState.valueOrValues[index]
410
+ attribute: Object.assign(Object.assign({}, attribute), { annotations: Object.assign(Object.assign({}, attribute.annotations), { inputType: undefined }), multivalued: false }),
411
+ valueOrValues: formFieldState.valueOrValues[index]
412
412
  };
413
413
  }
414
414
  return formFieldState;
@@ -421,7 +421,7 @@ function useGetErrors(params) {
421
421
  }
422
422
  return true;
423
423
  })
424
- .map((error) => (Object.assign(Object.assign({}, error), { "fieldIndex": index })));
424
+ .map((error) => (Object.assign(Object.assign({}, error), { fieldIndex: index })));
425
425
  })
426
426
  .reduce((acc, errors) => [...acc, ...errors], []);
427
427
  required_field: {
@@ -433,12 +433,12 @@ function useGetErrors(params) {
433
433
  }
434
434
  const msgArgs = ["error-user-attribute-required"];
435
435
  errors.push({
436
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
437
- "errorMessageStr": msgStr(...msgArgs),
438
- "fieldIndex": undefined,
439
- "source": {
440
- "type": "other",
441
- "rule": "requiredField"
436
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
437
+ errorMessageStr: msgStr(...msgArgs),
438
+ fieldIndex: undefined,
439
+ source: {
440
+ type: "other",
441
+ rule: "requiredField"
442
442
  }
443
443
  });
444
444
  }
@@ -457,10 +457,10 @@ function useGetErrors(params) {
457
457
  return [];
458
458
  }
459
459
  const { min: minStr } = validator;
460
- const min = minStr !== undefined ? parseInt(`${minStr}`) : attribute.required ? 1 : 0;
460
+ const min = minStr ? parseInt(`${minStr}`) : attribute.required ? 1 : 0;
461
461
  assert(!isNaN(min));
462
462
  const { max: maxStr } = validator;
463
- const max = maxStr === undefined ? Infinity : parseInt(`${maxStr}`);
463
+ const max = !maxStr ? Infinity : parseInt(`${maxStr}`);
464
464
  assert(!isNaN(max));
465
465
  assert(valueOrValues instanceof Array);
466
466
  const values = valueOrValues;
@@ -470,12 +470,12 @@ function useGetErrors(params) {
470
470
  const msgArgs = ["error-invalid-multivalued-size", `${min}`, `${max}`];
471
471
  return [
472
472
  {
473
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, 0),
474
- "errorMessageStr": msgStr(...msgArgs),
475
- "fieldIndex": undefined,
476
- "source": {
477
- "type": "validator",
478
- "name": validatorName
473
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, 0),
474
+ errorMessageStr: msgStr(...msgArgs),
475
+ fieldIndex: undefined,
476
+ source: {
477
+ type: "validator",
478
+ name: validatorName
479
479
  }
480
480
  }
481
481
  ];
@@ -493,7 +493,7 @@ function useGetErrors(params) {
493
493
  check_password_policy_x: {
494
494
  const policyName = "length";
495
495
  const policy = passwordPolicies[policyName];
496
- if (policy === undefined) {
496
+ if (!policy) {
497
497
  break check_password_policy_x;
498
498
  }
499
499
  const minLength = policy;
@@ -502,19 +502,19 @@ function useGetErrors(params) {
502
502
  }
503
503
  const msgArgs = ["invalidPasswordMinLengthMessage", `${minLength}`];
504
504
  errors.push({
505
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
506
- "errorMessageStr": msgStr(...msgArgs),
507
- "fieldIndex": undefined,
508
- "source": {
509
- "type": "passwordPolicy",
510
- "name": policyName
505
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
506
+ errorMessageStr: msgStr(...msgArgs),
507
+ fieldIndex: undefined,
508
+ source: {
509
+ type: "passwordPolicy",
510
+ name: policyName
511
511
  }
512
512
  });
513
513
  }
514
514
  check_password_policy_x: {
515
515
  const policyName = "digits";
516
516
  const policy = passwordPolicies[policyName];
517
- if (policy === undefined) {
517
+ if (!policy) {
518
518
  break check_password_policy_x;
519
519
  }
520
520
  const minNumberOfDigits = policy;
@@ -523,19 +523,19 @@ function useGetErrors(params) {
523
523
  }
524
524
  const msgArgs = ["invalidPasswordMinDigitsMessage", `${minNumberOfDigits}`];
525
525
  errors.push({
526
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
527
- "errorMessageStr": msgStr(...msgArgs),
528
- "fieldIndex": undefined,
529
- "source": {
530
- "type": "passwordPolicy",
531
- "name": policyName
526
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
527
+ errorMessageStr: msgStr(...msgArgs),
528
+ fieldIndex: undefined,
529
+ source: {
530
+ type: "passwordPolicy",
531
+ name: policyName
532
532
  }
533
533
  });
534
534
  }
535
535
  check_password_policy_x: {
536
536
  const policyName = "lowerCase";
537
537
  const policy = passwordPolicies[policyName];
538
- if (policy === undefined) {
538
+ if (!policy) {
539
539
  break check_password_policy_x;
540
540
  }
541
541
  const minNumberOfLowerCaseChar = policy;
@@ -544,19 +544,19 @@ function useGetErrors(params) {
544
544
  }
545
545
  const msgArgs = ["invalidPasswordMinLowerCaseCharsMessage", `${minNumberOfLowerCaseChar}`];
546
546
  errors.push({
547
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
548
- "errorMessageStr": msgStr(...msgArgs),
549
- "fieldIndex": undefined,
550
- "source": {
551
- "type": "passwordPolicy",
552
- "name": policyName
547
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
548
+ errorMessageStr: msgStr(...msgArgs),
549
+ fieldIndex: undefined,
550
+ source: {
551
+ type: "passwordPolicy",
552
+ name: policyName
553
553
  }
554
554
  });
555
555
  }
556
556
  check_password_policy_x: {
557
557
  const policyName = "upperCase";
558
558
  const policy = passwordPolicies[policyName];
559
- if (policy === undefined) {
559
+ if (!policy) {
560
560
  break check_password_policy_x;
561
561
  }
562
562
  const minNumberOfUpperCaseChar = policy;
@@ -565,19 +565,19 @@ function useGetErrors(params) {
565
565
  }
566
566
  const msgArgs = ["invalidPasswordMinUpperCaseCharsMessage", `${minNumberOfUpperCaseChar}`];
567
567
  errors.push({
568
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
569
- "errorMessageStr": msgStr(...msgArgs),
570
- "fieldIndex": undefined,
571
- "source": {
572
- "type": "passwordPolicy",
573
- "name": policyName
568
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
569
+ errorMessageStr: msgStr(...msgArgs),
570
+ fieldIndex: undefined,
571
+ source: {
572
+ type: "passwordPolicy",
573
+ name: policyName
574
574
  }
575
575
  });
576
576
  }
577
577
  check_password_policy_x: {
578
578
  const policyName = "specialChars";
579
579
  const policy = passwordPolicies[policyName];
580
- if (policy === undefined) {
580
+ if (!policy) {
581
581
  break check_password_policy_x;
582
582
  }
583
583
  const minNumberOfSpecialChar = policy;
@@ -586,12 +586,12 @@ function useGetErrors(params) {
586
586
  }
587
587
  const msgArgs = ["invalidPasswordMinSpecialCharsMessage", `${minNumberOfSpecialChar}`];
588
588
  errors.push({
589
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
590
- "errorMessageStr": msgStr(...msgArgs),
591
- "fieldIndex": undefined,
592
- "source": {
593
- "type": "passwordPolicy",
594
- "name": policyName
589
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
590
+ errorMessageStr: msgStr(...msgArgs),
591
+ fieldIndex: undefined,
592
+ source: {
593
+ type: "passwordPolicy",
594
+ name: policyName
595
595
  }
596
596
  });
597
597
  }
@@ -602,7 +602,7 @@ function useGetErrors(params) {
602
602
  break check_password_policy_x;
603
603
  }
604
604
  const usernameFormFieldState = formFieldStates.find(formFieldState => formFieldState.attribute.name === "username");
605
- if (usernameFormFieldState === undefined) {
605
+ if (!usernameFormFieldState) {
606
606
  break check_password_policy_x;
607
607
  }
608
608
  const usernameValue = (() => {
@@ -611,7 +611,7 @@ function useGetErrors(params) {
611
611
  assert(typeof valueOrValues === "string");
612
612
  unFormat_number: {
613
613
  const { kcNumberUnFormat } = (_a = attribute.html5DataAnnotations) !== null && _a !== void 0 ? _a : {};
614
- if (kcNumberUnFormat === undefined) {
614
+ if (!kcNumberUnFormat) {
615
615
  break unFormat_number;
616
616
  }
617
617
  valueOrValues = formatNumber(valueOrValues, kcNumberUnFormat);
@@ -623,12 +623,12 @@ function useGetErrors(params) {
623
623
  }
624
624
  const msgArgs = ["invalidPasswordNotUsernameMessage"];
625
625
  errors.push({
626
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
627
- "errorMessageStr": msgStr(...msgArgs),
628
- "fieldIndex": undefined,
629
- "source": {
630
- "type": "passwordPolicy",
631
- "name": policyName
626
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
627
+ errorMessageStr: msgStr(...msgArgs),
628
+ fieldIndex: undefined,
629
+ source: {
630
+ type: "passwordPolicy",
631
+ name: policyName
632
632
  }
633
633
  });
634
634
  }
@@ -639,7 +639,7 @@ function useGetErrors(params) {
639
639
  break check_password_policy_x;
640
640
  }
641
641
  const emailFormFieldState = formFieldStates.find(formFieldState => formFieldState.attribute.name === "email");
642
- if (emailFormFieldState === undefined) {
642
+ if (!emailFormFieldState) {
643
643
  break check_password_policy_x;
644
644
  }
645
645
  assert(typeof emailFormFieldState.valueOrValues === "string");
@@ -651,12 +651,12 @@ function useGetErrors(params) {
651
651
  }
652
652
  const msgArgs = ["invalidPasswordNotEmailMessage"];
653
653
  errors.push({
654
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
655
- "errorMessageStr": msgStr(...msgArgs),
656
- "fieldIndex": undefined,
657
- "source": {
658
- "type": "passwordPolicy",
659
- "name": policyName
654
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
655
+ errorMessageStr: msgStr(...msgArgs),
656
+ fieldIndex: undefined,
657
+ source: {
658
+ type: "passwordPolicy",
659
+ name: policyName
660
660
  }
661
661
  });
662
662
  }
@@ -676,12 +676,12 @@ function useGetErrors(params) {
676
676
  }
677
677
  const msgArgs = ["invalidPasswordConfirmMessage"];
678
678
  errors.push({
679
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
680
- "errorMessageStr": msgStr(...msgArgs),
681
- "fieldIndex": undefined,
682
- "source": {
683
- "type": "other",
684
- "rule": "passwordConfirmMatchesPassword"
679
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
680
+ errorMessageStr: msgStr(...msgArgs),
681
+ fieldIndex: undefined,
682
+ source: {
683
+ type: "other",
684
+ rule: "passwordConfirmMatchesPassword"
685
685
  }
686
686
  });
687
687
  }
@@ -695,19 +695,19 @@ function useGetErrors(params) {
695
695
  }
696
696
  const msgArgs = ["error-user-attribute-required"];
697
697
  errors.push({
698
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
699
- "errorMessageStr": msgStr(...msgArgs),
700
- "fieldIndex": undefined,
701
- "source": {
702
- "type": "other",
703
- "rule": "requiredField"
698
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
699
+ errorMessageStr: msgStr(...msgArgs),
700
+ fieldIndex: undefined,
701
+ source: {
702
+ type: "other",
703
+ rule: "requiredField"
704
704
  }
705
705
  });
706
706
  }
707
707
  validator_x: {
708
708
  const validatorName = "length";
709
709
  const validator = validators[validatorName];
710
- if (validator === undefined) {
710
+ if (!validator) {
711
711
  break validator_x;
712
712
  }
713
713
  const { "ignore.empty.value": ignoreEmptyValue = false, max, min } = validator;
@@ -715,24 +715,24 @@ function useGetErrors(params) {
715
715
  break validator_x;
716
716
  }
717
717
  const source = {
718
- "type": "validator",
719
- "name": validatorName
718
+ type: "validator",
719
+ name: validatorName
720
720
  };
721
- if (max !== undefined && value.length > parseInt(`${max}`)) {
721
+ if (max && value.length > parseInt(`${max}`)) {
722
722
  const msgArgs = ["error-invalid-length-too-long", `${max}`];
723
723
  errors.push({
724
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
725
- "errorMessageStr": msgStr(...msgArgs),
726
- "fieldIndex": undefined,
724
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
725
+ errorMessageStr: msgStr(...msgArgs),
726
+ fieldIndex: undefined,
727
727
  source
728
728
  });
729
729
  }
730
- if (min !== undefined && value.length < parseInt(`${min}`)) {
730
+ if (min && value.length < parseInt(`${min}`)) {
731
731
  const msgArgs = ["error-invalid-length-too-short", `${min}`];
732
732
  errors.push({
733
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
734
- "errorMessageStr": msgStr(...msgArgs),
735
- "fieldIndex": undefined,
733
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
734
+ errorMessageStr: msgStr(...msgArgs),
735
+ fieldIndex: undefined,
736
736
  source
737
737
  });
738
738
  }
@@ -752,12 +752,12 @@ function useGetErrors(params) {
752
752
  }
753
753
  const msgArgs = [errorMessageKey !== null && errorMessageKey !== void 0 ? errorMessageKey : id("shouldMatchPattern"), pattern];
754
754
  errors.push({
755
- "errorMessage": _jsx(Fragment, { children: advancedMsg(...msgArgs) }, `${attributeName}-${errors.length}`),
756
- "errorMessageStr": advancedMsgStr(...msgArgs),
757
- "fieldIndex": undefined,
758
- "source": {
759
- "type": "validator",
760
- "name": validatorName
755
+ errorMessage: _jsx(Fragment, { children: advancedMsg(...msgArgs) }, `${attributeName}-${errors.length}`),
756
+ errorMessageStr: advancedMsgStr(...msgArgs),
757
+ fieldIndex: undefined,
758
+ source: {
759
+ type: "validator",
760
+ name: validatorName
761
761
  }
762
762
  });
763
763
  }
@@ -782,12 +782,12 @@ function useGetErrors(params) {
782
782
  }
783
783
  const msgArgs = [id("invalidEmailMessage")];
784
784
  errors.push({
785
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
786
- "errorMessageStr": msgStr(...msgArgs),
787
- "fieldIndex": undefined,
788
- "source": {
789
- "type": "validator",
790
- "name": validatorName
785
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
786
+ errorMessageStr: msgStr(...msgArgs),
787
+ fieldIndex: undefined,
788
+ source: {
789
+ type: "validator",
790
+ name: validatorName
791
791
  }
792
792
  });
793
793
  }
@@ -803,35 +803,35 @@ function useGetErrors(params) {
803
803
  }
804
804
  const intValue = parseInt(value);
805
805
  const source = {
806
- "type": "validator",
807
- "name": validatorName
806
+ type: "validator",
807
+ name: validatorName
808
808
  };
809
809
  if (isNaN(intValue)) {
810
810
  const msgArgs = ["mustBeAnInteger"];
811
811
  errors.push({
812
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
813
- "errorMessageStr": msgStr(...msgArgs),
814
- "fieldIndex": undefined,
812
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
813
+ errorMessageStr: msgStr(...msgArgs),
814
+ fieldIndex: undefined,
815
815
  source
816
816
  });
817
817
  break validator_x;
818
818
  }
819
- if (max !== undefined && intValue > parseInt(`${max}`)) {
819
+ if (max && intValue > parseInt(`${max}`)) {
820
820
  const msgArgs = ["error-number-out-of-range-too-big", `${max}`];
821
821
  errors.push({
822
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
823
- "errorMessageStr": msgStr(...msgArgs),
824
- "fieldIndex": undefined,
822
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
823
+ errorMessageStr: msgStr(...msgArgs),
824
+ fieldIndex: undefined,
825
825
  source
826
826
  });
827
827
  break validator_x;
828
828
  }
829
- if (min !== undefined && intValue < parseInt(`${min}`)) {
829
+ if (min && intValue < parseInt(`${min}`)) {
830
830
  const msgArgs = ["error-number-out-of-range-too-small", `${min}`];
831
831
  errors.push({
832
- "errorMessage": _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
833
- "errorMessageStr": msgStr(...msgArgs),
834
- "fieldIndex": undefined,
832
+ errorMessage: _jsx(Fragment, { children: msg(...msgArgs) }, `${attributeName}-${errors.length}`),
833
+ errorMessageStr: msgStr(...msgArgs),
834
+ fieldIndex: undefined,
835
835
  source
836
836
  });
837
837
  break validator_x;
@@ -851,12 +851,12 @@ function useGetErrors(params) {
851
851
  }
852
852
  const msgArgs = [id("notAValidOption")];
853
853
  errors.push({
854
- "errorMessage": _jsx(Fragment, { children: advancedMsg(...msgArgs) }, `${attributeName}-${errors.length}`),
855
- "errorMessageStr": advancedMsgStr(...msgArgs),
856
- "fieldIndex": undefined,
857
- "source": {
858
- "type": "validator",
859
- "name": validatorName
854
+ errorMessage: _jsx(Fragment, { children: advancedMsg(...msgArgs) }, `${attributeName}-${errors.length}`),
855
+ errorMessageStr: advancedMsgStr(...msgArgs),
856
+ fieldIndex: undefined,
857
+ source: {
858
+ type: "validator",
859
+ name: validatorName
860
860
  }
861
861
  });
862
862
  }