@andreyyolkin/keycloakify-vue 0.1.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.
Files changed (349) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +109 -0
  3. package/keycloakify-vue/account/DefaultPage.vue +55 -0
  4. package/keycloakify-vue/account/DefaultPage.vue.d.ts +14 -0
  5. package/keycloakify-vue/account/KcContext/index.d.ts +1 -0
  6. package/keycloakify-vue/account/KcContext/index.js +0 -0
  7. package/keycloakify-vue/account/Template.useInitialize.d.ts +13 -0
  8. package/keycloakify-vue/account/Template.useInitialize.js +20 -0
  9. package/keycloakify-vue/account/Template.vue +178 -0
  10. package/keycloakify-vue/account/Template.vue.d.ts +17 -0
  11. package/keycloakify-vue/account/TemplateProps.d.ts +9 -0
  12. package/keycloakify-vue/account/TemplateProps.js +0 -0
  13. package/keycloakify-vue/account/i18n/i18n.d.ts +11 -0
  14. package/keycloakify-vue/account/i18n/i18n.js +0 -0
  15. package/keycloakify-vue/account/i18n/i18nBuilder.d.ts +18 -0
  16. package/keycloakify-vue/account/i18n/i18nBuilder.js +29 -0
  17. package/keycloakify-vue/account/i18n/index.d.ts +1 -0
  18. package/keycloakify-vue/account/i18n/index.js +1 -0
  19. package/keycloakify-vue/account/i18n/useI18n.d.ts +28 -0
  20. package/keycloakify-vue/account/i18n/useI18n.js +67 -0
  21. package/keycloakify-vue/account/index.d.ts +4 -0
  22. package/keycloakify-vue/account/index.js +8 -0
  23. package/keycloakify-vue/account/pages/Account.vue +182 -0
  24. package/keycloakify-vue/account/pages/Account.vue.d.ts +9 -0
  25. package/keycloakify-vue/account/pages/Applications.vue +192 -0
  26. package/keycloakify-vue/account/pages/Applications.vue.d.ts +9 -0
  27. package/keycloakify-vue/account/pages/FederatedIdentity.vue +123 -0
  28. package/keycloakify-vue/account/pages/FederatedIdentity.vue.d.ts +9 -0
  29. package/keycloakify-vue/account/pages/Log.vue +64 -0
  30. package/keycloakify-vue/account/pages/Log.vue.d.ts +9 -0
  31. package/keycloakify-vue/account/pages/NotImplemented.vue +24 -0
  32. package/keycloakify-vue/account/pages/NotImplemented.vue.d.ts +6 -0
  33. package/keycloakify-vue/account/pages/PageProps.d.ts +9 -0
  34. package/keycloakify-vue/account/pages/PageProps.js +0 -0
  35. package/keycloakify-vue/account/pages/Password.vue +247 -0
  36. package/keycloakify-vue/account/pages/Password.vue.d.ts +9 -0
  37. package/keycloakify-vue/account/pages/Sessions.vue +84 -0
  38. package/keycloakify-vue/account/pages/Sessions.vue.d.ts +9 -0
  39. package/keycloakify-vue/account/pages/Totp.vue +308 -0
  40. package/keycloakify-vue/account/pages/Totp.vue.d.ts +9 -0
  41. package/keycloakify-vue/bin/index.js +14 -0
  42. package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcContext.js +0 -0
  43. package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcPage.vue +23 -0
  44. package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcPageStory.js +18 -0
  45. package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcPageStory.vue +13 -0
  46. package/keycloakify-vue/bin/initialize-account-theme/boilerplate/i18n.js +5 -0
  47. package/keycloakify-vue/login/DefaultPage.vue +167 -0
  48. package/keycloakify-vue/login/DefaultPage.vue.d.ts +20 -0
  49. package/keycloakify-vue/login/Template.useInitialize.d.ts +18 -0
  50. package/keycloakify-vue/login/Template.useInitialize.js +49 -0
  51. package/keycloakify-vue/login/Template.vue +239 -0
  52. package/keycloakify-vue/login/Template.vue.d.ts +26 -0
  53. package/keycloakify-vue/login/TemplateProps.d.ts +14 -0
  54. package/keycloakify-vue/login/TemplateProps.js +0 -0
  55. package/keycloakify-vue/login/components/AddRemoveButtonsMultiValuedAttribute.vue +59 -0
  56. package/keycloakify-vue/login/components/AddRemoveButtonsMultiValuedAttribute.vue.d.ts +15 -0
  57. package/keycloakify-vue/login/components/FieldErrors.vue +35 -0
  58. package/keycloakify-vue/login/components/FieldErrors.vue.d.ts +14 -0
  59. package/keycloakify-vue/login/components/GroupLabel.vue +68 -0
  60. package/keycloakify-vue/login/components/GroupLabel.vue.d.ts +14 -0
  61. package/keycloakify-vue/login/components/InputFieldByType.vue +94 -0
  62. package/keycloakify-vue/login/components/InputFieldByType.vue.d.ts +4 -0
  63. package/keycloakify-vue/login/components/InputFieldByTypeProps.d.ts +12 -0
  64. package/keycloakify-vue/login/components/InputFieldByTypeProps.js +0 -0
  65. package/keycloakify-vue/login/components/InputTag.vue +105 -0
  66. package/keycloakify-vue/login/components/InputTag.vue.d.ts +7 -0
  67. package/keycloakify-vue/login/components/InputTagSelects.vue +108 -0
  68. package/keycloakify-vue/login/components/InputTagSelects.vue.d.ts +4 -0
  69. package/keycloakify-vue/login/components/LogoutOtherSessions.vue +27 -0
  70. package/keycloakify-vue/login/components/LogoutOtherSessions.vue.d.ts +9 -0
  71. package/keycloakify-vue/login/components/PasswordWrapper.vue +42 -0
  72. package/keycloakify-vue/login/components/PasswordWrapper.vue.d.ts +20 -0
  73. package/keycloakify-vue/login/components/SelectTag.vue +74 -0
  74. package/keycloakify-vue/login/components/SelectTag.vue.d.ts +4 -0
  75. package/keycloakify-vue/login/components/TermsAcceptance.vue +59 -0
  76. package/keycloakify-vue/login/components/TermsAcceptance.vue.d.ts +13 -0
  77. package/keycloakify-vue/login/components/TextareaTag.vue +47 -0
  78. package/keycloakify-vue/login/components/TextareaTag.vue.d.ts +4 -0
  79. package/keycloakify-vue/login/components/UserProfileFormFields.vue +119 -0
  80. package/keycloakify-vue/login/components/UserProfileFormFields.vue.d.ts +33 -0
  81. package/keycloakify-vue/login/components/UserProfileFormFieldsProps.d.ts +22 -0
  82. package/keycloakify-vue/login/components/UserProfileFormFieldsProps.js +0 -0
  83. package/keycloakify-vue/login/components/inputLabel.d.ts +4 -0
  84. package/keycloakify-vue/login/components/inputLabel.js +15 -0
  85. package/keycloakify-vue/login/i18n/i18n.d.ts +11 -0
  86. package/keycloakify-vue/login/i18n/i18n.js +0 -0
  87. package/keycloakify-vue/login/i18n/i18nBuilder.d.ts +18 -0
  88. package/keycloakify-vue/login/i18n/i18nBuilder.js +29 -0
  89. package/keycloakify-vue/login/i18n/index.d.ts +1 -0
  90. package/keycloakify-vue/login/i18n/index.js +1 -0
  91. package/keycloakify-vue/login/i18n/useI18n.d.ts +28 -0
  92. package/keycloakify-vue/login/i18n/useI18n.js +67 -0
  93. package/keycloakify-vue/login/index.d.ts +5 -0
  94. package/keycloakify-vue/login/index.js +10 -0
  95. package/keycloakify-vue/login/lib/useUserProfileForm.d.ts +53 -0
  96. package/keycloakify-vue/login/lib/useUserProfileForm.js +50 -0
  97. package/keycloakify-vue/login/pages/Code.vue +54 -0
  98. package/keycloakify-vue/login/pages/Code.vue.d.ts +9 -0
  99. package/keycloakify-vue/login/pages/DeleteAccountConfirm.vue +69 -0
  100. package/keycloakify-vue/login/pages/DeleteAccountConfirm.vue.d.ts +9 -0
  101. package/keycloakify-vue/login/pages/DeleteCredential.vue +56 -0
  102. package/keycloakify-vue/login/pages/DeleteCredential.vue.d.ts +9 -0
  103. package/keycloakify-vue/login/pages/Error.vue +41 -0
  104. package/keycloakify-vue/login/pages/Error.vue.d.ts +9 -0
  105. package/keycloakify-vue/login/pages/FrontchannelLogout.vue +67 -0
  106. package/keycloakify-vue/login/pages/FrontchannelLogout.vue.d.ts +9 -0
  107. package/keycloakify-vue/login/pages/IdpReviewUserProfile.vue +77 -0
  108. package/keycloakify-vue/login/pages/IdpReviewUserProfile.vue.d.ts +14 -0
  109. package/keycloakify-vue/login/pages/Info.vue +61 -0
  110. package/keycloakify-vue/login/pages/Info.vue.d.ts +9 -0
  111. package/keycloakify-vue/login/pages/LinkIdpAction.vue +66 -0
  112. package/keycloakify-vue/login/pages/LinkIdpAction.vue.d.ts +9 -0
  113. package/keycloakify-vue/login/pages/Login.vue +230 -0
  114. package/keycloakify-vue/login/pages/Login.vue.d.ts +9 -0
  115. package/keycloakify-vue/login/pages/LoginConfigTotp.vue +233 -0
  116. package/keycloakify-vue/login/pages/LoginConfigTotp.vue.d.ts +9 -0
  117. package/keycloakify-vue/login/pages/LoginIdpLinkConfirm.vue +57 -0
  118. package/keycloakify-vue/login/pages/LoginIdpLinkConfirm.vue.d.ts +9 -0
  119. package/keycloakify-vue/login/pages/LoginIdpLinkConfirmOverride.vue +56 -0
  120. package/keycloakify-vue/login/pages/LoginIdpLinkConfirmOverride.vue.d.ts +9 -0
  121. package/keycloakify-vue/login/pages/LoginIdpLinkEmail.vue +52 -0
  122. package/keycloakify-vue/login/pages/LoginIdpLinkEmail.vue.d.ts +9 -0
  123. package/keycloakify-vue/login/pages/LoginOauth2DeviceVerifyUserCode.vue +82 -0
  124. package/keycloakify-vue/login/pages/LoginOauth2DeviceVerifyUserCode.vue.d.ts +9 -0
  125. package/keycloakify-vue/login/pages/LoginOauthGrant.vue +131 -0
  126. package/keycloakify-vue/login/pages/LoginOauthGrant.vue.d.ts +9 -0
  127. package/keycloakify-vue/login/pages/LoginOtp.vue +135 -0
  128. package/keycloakify-vue/login/pages/LoginOtp.vue.d.ts +9 -0
  129. package/keycloakify-vue/login/pages/LoginPageExpired.vue +44 -0
  130. package/keycloakify-vue/login/pages/LoginPageExpired.vue.d.ts +9 -0
  131. package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.useScript.d.ts +21 -0
  132. package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js +74 -0
  133. package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.vue +255 -0
  134. package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.vue.d.ts +9 -0
  135. package/keycloakify-vue/login/pages/LoginPassword.useScript.d.ts +23 -0
  136. package/keycloakify-vue/login/pages/LoginPassword.useScript.js +64 -0
  137. package/keycloakify-vue/login/pages/LoginPassword.vue +191 -0
  138. package/keycloakify-vue/login/pages/LoginPassword.vue.d.ts +9 -0
  139. package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.useScript.d.ts +9 -0
  140. package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js +139 -0
  141. package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.vue +183 -0
  142. package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.vue.d.ts +9 -0
  143. package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeInput.vue +90 -0
  144. package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeInput.vue.d.ts +9 -0
  145. package/keycloakify-vue/login/pages/LoginResetOtp.vue +88 -0
  146. package/keycloakify-vue/login/pages/LoginResetOtp.vue.d.ts +9 -0
  147. package/keycloakify-vue/login/pages/LoginResetPassword.vue +114 -0
  148. package/keycloakify-vue/login/pages/LoginResetPassword.vue.d.ts +9 -0
  149. package/keycloakify-vue/login/pages/LoginUpdatePassword.vue +145 -0
  150. package/keycloakify-vue/login/pages/LoginUpdatePassword.vue.d.ts +9 -0
  151. package/keycloakify-vue/login/pages/LoginUpdateProfile.vue +94 -0
  152. package/keycloakify-vue/login/pages/LoginUpdateProfile.vue.d.ts +14 -0
  153. package/keycloakify-vue/login/pages/LoginUsername.useScript.d.ts +23 -0
  154. package/keycloakify-vue/login/pages/LoginUsername.useScript.js +64 -0
  155. package/keycloakify-vue/login/pages/LoginUsername.vue +263 -0
  156. package/keycloakify-vue/login/pages/LoginUsername.vue.d.ts +9 -0
  157. package/keycloakify-vue/login/pages/LoginVerifyEmail.vue +39 -0
  158. package/keycloakify-vue/login/pages/LoginVerifyEmail.vue.d.ts +9 -0
  159. package/keycloakify-vue/login/pages/LoginX509Info.vue +120 -0
  160. package/keycloakify-vue/login/pages/LoginX509Info.vue.d.ts +9 -0
  161. package/keycloakify-vue/login/pages/LogoutConfirm.vue +73 -0
  162. package/keycloakify-vue/login/pages/LogoutConfirm.vue.d.ts +9 -0
  163. package/keycloakify-vue/login/pages/NotImplemented.vue +12 -0
  164. package/keycloakify-vue/login/pages/NotImplemented.vue.d.ts +6 -0
  165. package/keycloakify-vue/login/pages/PageProps.d.ts +9 -0
  166. package/keycloakify-vue/login/pages/PageProps.js +0 -0
  167. package/keycloakify-vue/login/pages/Register.vue +158 -0
  168. package/keycloakify-vue/login/pages/Register.vue.d.ts +14 -0
  169. package/keycloakify-vue/login/pages/SamlPostForm.vue +75 -0
  170. package/keycloakify-vue/login/pages/SamlPostForm.vue.d.ts +9 -0
  171. package/keycloakify-vue/login/pages/SelectAuthenticator.vue +65 -0
  172. package/keycloakify-vue/login/pages/SelectAuthenticator.vue.d.ts +9 -0
  173. package/keycloakify-vue/login/pages/SelectOrganization.vue +89 -0
  174. package/keycloakify-vue/login/pages/SelectOrganization.vue.d.ts +9 -0
  175. package/keycloakify-vue/login/pages/Terms.vue +56 -0
  176. package/keycloakify-vue/login/pages/Terms.vue.d.ts +9 -0
  177. package/keycloakify-vue/login/pages/UpdateEmail.vue +100 -0
  178. package/keycloakify-vue/login/pages/UpdateEmail.vue.d.ts +14 -0
  179. package/keycloakify-vue/login/pages/WebauthnAuthenticate.useScript.d.ts +22 -0
  180. package/keycloakify-vue/login/pages/WebauthnAuthenticate.useScript.js +53 -0
  181. package/keycloakify-vue/login/pages/WebauthnAuthenticate.vue +186 -0
  182. package/keycloakify-vue/login/pages/WebauthnAuthenticate.vue.d.ts +9 -0
  183. package/keycloakify-vue/login/pages/WebauthnError.vue +84 -0
  184. package/keycloakify-vue/login/pages/WebauthnError.vue.d.ts +9 -0
  185. package/keycloakify-vue/login/pages/WebauthnRegister.useScript.d.ts +28 -0
  186. package/keycloakify-vue/login/pages/WebauthnRegister.useScript.js +75 -0
  187. package/keycloakify-vue/login/pages/WebauthnRegister.vue +105 -0
  188. package/keycloakify-vue/login/pages/WebauthnRegister.vue.d.ts +9 -0
  189. package/keycloakify-vue/tools/useInsertLinkTags.d.ts +12 -0
  190. package/keycloakify-vue/tools/useInsertLinkTags.js +47 -0
  191. package/keycloakify-vue/tools/useInsertScriptTags.d.ts +19 -0
  192. package/keycloakify-vue/tools/useInsertScriptTags.js +56 -0
  193. package/keycloakify-vue/tools/useSetClassName.d.ts +4 -0
  194. package/keycloakify-vue/tools/useSetClassName.js +16 -0
  195. package/package.json +553 -0
  196. package/src/account/DefaultPage.vue +55 -0
  197. package/src/account/KcContext/index.ts +1 -0
  198. package/src/account/Template.useInitialize.ts +34 -0
  199. package/src/account/Template.vue +178 -0
  200. package/src/account/TemplateProps.ts +11 -0
  201. package/src/account/i18n/i18n.ts +16 -0
  202. package/src/account/i18n/i18nBuilder.ts +100 -0
  203. package/src/account/i18n/index.ts +1 -0
  204. package/src/account/i18n/useI18n.ts +128 -0
  205. package/src/account/index.ts +4 -0
  206. package/src/account/pages/Account.vue +182 -0
  207. package/src/account/pages/Applications.vue +192 -0
  208. package/src/account/pages/FederatedIdentity.vue +123 -0
  209. package/src/account/pages/Log.vue +64 -0
  210. package/src/account/pages/NotImplemented.vue +24 -0
  211. package/src/account/pages/PageProps.ts +10 -0
  212. package/src/account/pages/Password.vue +247 -0
  213. package/src/account/pages/Sessions.vue +84 -0
  214. package/src/account/pages/Totp.vue +308 -0
  215. package/src/bin/initialize-account-theme/boilerplate/KcContext.ts +11 -0
  216. package/src/bin/initialize-account-theme/boilerplate/KcPage.vue +23 -0
  217. package/src/bin/initialize-account-theme/boilerplate/KcPageStory.ts +22 -0
  218. package/src/bin/initialize-account-theme/boilerplate/KcPageStory.vue +13 -0
  219. package/src/bin/initialize-account-theme/boilerplate/i18n.ts +8 -0
  220. package/src/login/DefaultPage.vue +167 -0
  221. package/src/login/Template.useInitialize.ts +71 -0
  222. package/src/login/Template.vue +239 -0
  223. package/src/login/TemplateProps.ts +17 -0
  224. package/src/login/components/AddRemoveButtonsMultiValuedAttribute.vue +59 -0
  225. package/src/login/components/FieldErrors.vue +35 -0
  226. package/src/login/components/GroupLabel.vue +68 -0
  227. package/src/login/components/InputFieldByType.vue +94 -0
  228. package/src/login/components/InputFieldByTypeProps.ts +13 -0
  229. package/src/login/components/InputTag.vue +105 -0
  230. package/src/login/components/InputTagSelects.vue +108 -0
  231. package/src/login/components/LogoutOtherSessions.vue +27 -0
  232. package/src/login/components/PasswordWrapper.vue +42 -0
  233. package/src/login/components/SelectTag.vue +74 -0
  234. package/src/login/components/TermsAcceptance.vue +59 -0
  235. package/src/login/components/TextareaTag.vue +47 -0
  236. package/src/login/components/UserProfileFormFields.vue +119 -0
  237. package/src/login/components/UserProfileFormFieldsProps.ts +22 -0
  238. package/src/login/components/inputLabel.ts +18 -0
  239. package/src/login/i18n/i18n.ts +16 -0
  240. package/src/login/i18n/i18nBuilder.ts +100 -0
  241. package/src/login/i18n/index.ts +1 -0
  242. package/src/login/i18n/useI18n.ts +128 -0
  243. package/src/login/index.ts +5 -0
  244. package/src/login/lib/useUserProfileForm.ts +121 -0
  245. package/src/login/pages/Code.vue +54 -0
  246. package/src/login/pages/DeleteAccountConfirm.vue +69 -0
  247. package/src/login/pages/DeleteCredential.vue +56 -0
  248. package/src/login/pages/Error.vue +41 -0
  249. package/src/login/pages/FrontchannelLogout.vue +67 -0
  250. package/src/login/pages/IdpReviewUserProfile.vue +77 -0
  251. package/src/login/pages/Info.vue +61 -0
  252. package/src/login/pages/LinkIdpAction.vue +66 -0
  253. package/src/login/pages/Login.vue +230 -0
  254. package/src/login/pages/LoginConfigTotp.vue +233 -0
  255. package/src/login/pages/LoginIdpLinkConfirm.vue +57 -0
  256. package/src/login/pages/LoginIdpLinkConfirmOverride.vue +56 -0
  257. package/src/login/pages/LoginIdpLinkEmail.vue +52 -0
  258. package/src/login/pages/LoginOauth2DeviceVerifyUserCode.vue +82 -0
  259. package/src/login/pages/LoginOauthGrant.vue +131 -0
  260. package/src/login/pages/LoginOtp.vue +135 -0
  261. package/src/login/pages/LoginPageExpired.vue +44 -0
  262. package/src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.ts +96 -0
  263. package/src/login/pages/LoginPasskeysConditionalAuthenticate.vue +255 -0
  264. package/src/login/pages/LoginPassword.useScript.ts +88 -0
  265. package/src/login/pages/LoginPassword.vue +191 -0
  266. package/src/login/pages/LoginRecoveryAuthnCodeConfig.useScript.ts +152 -0
  267. package/src/login/pages/LoginRecoveryAuthnCodeConfig.vue +183 -0
  268. package/src/login/pages/LoginRecoveryAuthnCodeInput.vue +90 -0
  269. package/src/login/pages/LoginResetOtp.vue +88 -0
  270. package/src/login/pages/LoginResetPassword.vue +114 -0
  271. package/src/login/pages/LoginUpdatePassword.vue +145 -0
  272. package/src/login/pages/LoginUpdateProfile.vue +94 -0
  273. package/src/login/pages/LoginUsername.useScript.ts +88 -0
  274. package/src/login/pages/LoginUsername.vue +263 -0
  275. package/src/login/pages/LoginVerifyEmail.vue +39 -0
  276. package/src/login/pages/LoginX509Info.vue +120 -0
  277. package/src/login/pages/LogoutConfirm.vue +73 -0
  278. package/src/login/pages/NotImplemented.vue +12 -0
  279. package/src/login/pages/PageProps.ts +10 -0
  280. package/src/login/pages/Register.vue +158 -0
  281. package/src/login/pages/SamlPostForm.vue +75 -0
  282. package/src/login/pages/SelectAuthenticator.vue +65 -0
  283. package/src/login/pages/SelectOrganization.vue +89 -0
  284. package/src/login/pages/Terms.vue +56 -0
  285. package/src/login/pages/UpdateEmail.vue +100 -0
  286. package/src/login/pages/WebauthnAuthenticate.useScript.ts +75 -0
  287. package/src/login/pages/WebauthnAuthenticate.vue +186 -0
  288. package/src/login/pages/WebauthnError.vue +84 -0
  289. package/src/login/pages/WebauthnRegister.useScript.ts +109 -0
  290. package/src/login/pages/WebauthnRegister.vue +105 -0
  291. package/src/tools/useInsertLinkTags.ts +62 -0
  292. package/src/tools/useInsertScriptTags.ts +75 -0
  293. package/src/tools/useSetClassName.ts +15 -0
  294. package/stories/account/KcContext.ts +13 -0
  295. package/stories/account/KcContextMock.ts +26 -0
  296. package/stories/account/KcPage.vue +26 -0
  297. package/stories/account/KcPageStory.vue +13 -0
  298. package/stories/account/i18n.ts +7 -0
  299. package/stories/account/pages/Account.stories.ts +22 -0
  300. package/stories/account/pages/Applications.stories.ts +70 -0
  301. package/stories/account/pages/FederatedIdentity.stories.ts +64 -0
  302. package/stories/account/pages/Log.stories.ts +42 -0
  303. package/stories/account/pages/Password.stories.ts +22 -0
  304. package/stories/account/pages/Sessions.stories.ts +41 -0
  305. package/stories/account/pages/Totp.stories.ts +33 -0
  306. package/stories/kc.gen.ts +17 -0
  307. package/stories/login/KcContext.ts +13 -0
  308. package/stories/login/KcContextMock.ts +26 -0
  309. package/stories/login/KcPage.vue +28 -0
  310. package/stories/login/KcPageStory.vue +13 -0
  311. package/stories/login/i18n.ts +7 -0
  312. package/stories/login/pages/Code.stories.ts +50 -0
  313. package/stories/login/pages/DeleteAccountConfirm.stories.ts +32 -0
  314. package/stories/login/pages/DeleteCredential.stories.ts +23 -0
  315. package/stories/login/pages/Error.stories.ts +53 -0
  316. package/stories/login/pages/FrontchannelLogout.stories.ts +24 -0
  317. package/stories/login/pages/IdpReviewUserProfile.stories.ts +56 -0
  318. package/stories/login/pages/Info.stories.ts +52 -0
  319. package/stories/login/pages/LinkIdpAction.stories.ts +30 -0
  320. package/stories/login/pages/Login.stories.ts +76 -0
  321. package/stories/login/pages/LoginConfigTotp.stories.ts +53 -0
  322. package/stories/login/pages/LoginIdpLinkConfirm.stories.ts +34 -0
  323. package/stories/login/pages/LoginIdpLinkConfirmOverride.stories.ts +14 -0
  324. package/stories/login/pages/LoginIdpLinkEmail.stories.ts +60 -0
  325. package/stories/login/pages/LoginOauth2DeviceVerifyUserCode.stories.ts +42 -0
  326. package/stories/login/pages/LoginOauthGrant.stories.ts +95 -0
  327. package/stories/login/pages/LoginOtp.stories.ts +92 -0
  328. package/stories/login/pages/LoginPageExpired.stories.ts +29 -0
  329. package/stories/login/pages/LoginPasskeysConditionalAuthenticate.stories.ts +14 -0
  330. package/stories/login/pages/LoginPassword.stories.ts +49 -0
  331. package/stories/login/pages/LoginRecoveryAuthnCodeConfig.stories.ts +28 -0
  332. package/stories/login/pages/LoginRecoveryAuthnCodeInput.stories.ts +14 -0
  333. package/stories/login/pages/LoginResetOtp.stories.ts +69 -0
  334. package/stories/login/pages/LoginResetPassword.stories.ts +48 -0
  335. package/stories/login/pages/LoginUpdatePassword.stories.ts +52 -0
  336. package/stories/login/pages/LoginUpdateProfile.stories.ts +29 -0
  337. package/stories/login/pages/LoginUsername.stories.ts +25 -0
  338. package/stories/login/pages/LoginVerifyEmail.stories.ts +63 -0
  339. package/stories/login/pages/LoginX509Info.stories.ts +29 -0
  340. package/stories/login/pages/LogoutConfirm.stories.ts +35 -0
  341. package/stories/login/pages/Register.stories.ts +76 -0
  342. package/stories/login/pages/SamlPostForm.stories.ts +14 -0
  343. package/stories/login/pages/SelectAuthenticator.stories.ts +89 -0
  344. package/stories/login/pages/SelectOrganization.stories.ts +63 -0
  345. package/stories/login/pages/Terms.stories.ts +78 -0
  346. package/stories/login/pages/UpdateEmail.stories.ts +28 -0
  347. package/stories/login/pages/WebauthnAuthenticate.stories.ts +147 -0
  348. package/stories/login/pages/WebauthnError.stories.ts +77 -0
  349. package/stories/login/pages/WebauthnRegister.stories.ts +54 -0
@@ -0,0 +1,105 @@
1
+ <script setup lang="ts">
2
+ import { assert } from 'keycloakify/tools/assert';
3
+ import { computed } from 'vue';
4
+ import AddRemoveButtonsMultiValuedAttribute from './AddRemoveButtonsMultiValuedAttribute.vue';
5
+ import FieldErrors from './FieldErrors.vue';
6
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
7
+
8
+ const props = defineProps<InputFieldByTypeProps & { fieldIndex?: number }>();
9
+
10
+ const inputType = computed(() => {
11
+ const t = props.attribute.annotations.inputType;
12
+ return t?.startsWith('html5-') ? t.slice(6) : (t ?? 'text');
13
+ });
14
+
15
+ const value = computed(() => {
16
+ if (props.fieldIndex !== undefined) {
17
+ assert(props.valueOrValues instanceof Array);
18
+ return props.valueOrValues[props.fieldIndex];
19
+ }
20
+ assert(typeof props.valueOrValues === 'string');
21
+ return props.valueOrValues;
22
+ });
23
+
24
+ // NOTE: the input gets the attribute's OWN html5DataAnnotations (e.g. kcNumberFormat),
25
+ // not the group's — matches the React source of truth (the svelte port spreads
26
+ // `attribute.group?.html5DataAnnotations` here, which is a bug; the group annotations
27
+ // belong on the group container, handled in GroupLabel.vue).
28
+ const html5DataAnnotations = computed(() =>
29
+ Object.fromEntries(
30
+ Object.entries(props.attribute.html5DataAnnotations ?? {}).map(([key, val]) => [`data-${key}`, val]),
31
+ ),
32
+ );
33
+
34
+ const ariaInvalid = computed(
35
+ () => props.displayableErrors.find((error) => error.fieldIndex === props.fieldIndex) !== undefined,
36
+ );
37
+
38
+ function onInput(event: Event) {
39
+ const target = event.target as HTMLInputElement;
40
+ props.dispatchFormAction({
41
+ action: 'update',
42
+ name: props.attribute.name,
43
+ valueOrValues: (() => {
44
+ if (props.fieldIndex !== undefined) {
45
+ assert(props.valueOrValues instanceof Array);
46
+ return props.valueOrValues.map((v, i) => (i === props.fieldIndex ? target.value : v));
47
+ }
48
+ return target.value;
49
+ })(),
50
+ });
51
+ }
52
+
53
+ function onBlur() {
54
+ props.dispatchFormAction({
55
+ action: 'focus lost',
56
+ name: props.attribute.name,
57
+ fieldIndex: props.fieldIndex,
58
+ });
59
+ }
60
+
61
+ const numAnno = (v: string | number | undefined) => (v === undefined ? undefined : parseInt(`${v}`));
62
+ </script>
63
+
64
+ <template>
65
+ <input
66
+ :type="inputType"
67
+ :id="attribute.name"
68
+ :name="attribute.name"
69
+ :value="value"
70
+ :class="kcClsx('kcInputClass')"
71
+ :aria-invalid="ariaInvalid"
72
+ :disabled="attribute.readOnly"
73
+ :autocomplete="attribute.autocomplete as any"
74
+ :placeholder="
75
+ attribute.annotations.inputTypePlaceholder === undefined
76
+ ? undefined
77
+ : i18n.advancedMsgStr(attribute.annotations.inputTypePlaceholder)
78
+ "
79
+ :pattern="attribute.annotations.inputTypePattern"
80
+ :size="numAnno(attribute.annotations.inputTypeSize)"
81
+ :maxlength="numAnno(attribute.annotations.inputTypeMaxlength)"
82
+ :minlength="numAnno(attribute.annotations.inputTypeMinlength)"
83
+ :max="attribute.annotations.inputTypeMax"
84
+ :min="attribute.annotations.inputTypeMin"
85
+ :step="attribute.annotations.inputTypeStep"
86
+ v-bind="html5DataAnnotations"
87
+ @input="onInput"
88
+ @blur="onBlur"
89
+ />
90
+ <template v-if="fieldIndex !== undefined && valueOrValues instanceof Array">
91
+ <FieldErrors
92
+ :attribute="attribute"
93
+ :kcClsx="kcClsx"
94
+ :displayableErrors="displayableErrors"
95
+ :fieldIndex="fieldIndex"
96
+ />
97
+ <AddRemoveButtonsMultiValuedAttribute
98
+ :attribute="attribute"
99
+ :values="valueOrValues"
100
+ :fieldIndex="fieldIndex"
101
+ :dispatchFormAction="dispatchFormAction"
102
+ :i18n="i18n"
103
+ />
104
+ </template>
105
+ </template>
@@ -0,0 +1,108 @@
1
+ <script setup lang="ts">
2
+ import { assert } from 'keycloakify/tools/assert';
3
+ import { computed } from 'vue';
4
+ import { inputLabel } from './inputLabel';
5
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
6
+
7
+ const props = defineProps<InputFieldByTypeProps>();
8
+
9
+ const styling = computed(() => {
10
+ const { inputType } = props.attribute.annotations;
11
+ assert(inputType === 'select-radiobuttons' || inputType === 'multiselect-checkboxes');
12
+ switch (inputType) {
13
+ case 'select-radiobuttons':
14
+ return {
15
+ inputType: 'radio',
16
+ classDiv: props.kcClsx('kcInputClassRadio'),
17
+ classInput: props.kcClsx('kcInputClassRadioInput'),
18
+ classLabel: props.kcClsx('kcInputClassRadioLabel'),
19
+ };
20
+ case 'multiselect-checkboxes':
21
+ return {
22
+ inputType: 'checkbox',
23
+ classDiv: props.kcClsx('kcInputClassCheckbox'),
24
+ classInput: props.kcClsx('kcInputClassCheckboxInput'),
25
+ classLabel: props.kcClsx('kcInputClassCheckboxLabel'),
26
+ };
27
+ default:
28
+ return {
29
+ inputType: 'radio',
30
+ classDiv: props.kcClsx('kcInputClassRadio'),
31
+ classInput: props.kcClsx('kcInputClassRadioInput'),
32
+ classLabel: props.kcClsx('kcInputClassRadioLabel'),
33
+ };
34
+ }
35
+ });
36
+
37
+ const options = computed<string[]>(() => {
38
+ const { inputOptionsFromValidation } = props.attribute.annotations;
39
+ if (inputOptionsFromValidation !== undefined) {
40
+ const validator = (props.attribute.validators as Record<string, { options?: string[] }>)[
41
+ inputOptionsFromValidation
42
+ ];
43
+ if (validator?.options !== undefined) {
44
+ return validator.options;
45
+ }
46
+ }
47
+ return props.attribute.validators.options?.options ?? [];
48
+ });
49
+
50
+ function isChecked(option: string) {
51
+ return props.valueOrValues instanceof Array ? props.valueOrValues.includes(option) : props.valueOrValues === option;
52
+ }
53
+
54
+ function onChange(event: Event, option: string) {
55
+ const target = event.target as HTMLInputElement;
56
+ props.dispatchFormAction({
57
+ action: 'update',
58
+ name: props.attribute.name,
59
+ valueOrValues: (() => {
60
+ if (props.valueOrValues instanceof Array) {
61
+ const newValues = [...props.valueOrValues];
62
+ if (target.checked) {
63
+ newValues.push(option);
64
+ } else {
65
+ newValues.splice(newValues.indexOf(option), 1);
66
+ }
67
+ return newValues;
68
+ }
69
+ return target.checked ? option : '';
70
+ })(),
71
+ });
72
+ }
73
+
74
+ function onBlur() {
75
+ props.dispatchFormAction({
76
+ action: 'focus lost',
77
+ name: props.attribute.name,
78
+ fieldIndex: undefined,
79
+ });
80
+ }
81
+ </script>
82
+
83
+ <template>
84
+ <div
85
+ v-for="option in options"
86
+ :key="option"
87
+ :class="styling.classDiv"
88
+ >
89
+ <input
90
+ :type="styling.inputType"
91
+ :id="`${attribute.name}-${option}`"
92
+ :name="attribute.name"
93
+ :value="option"
94
+ :class="styling.classInput"
95
+ :aria-invalid="displayableErrors.length !== 0"
96
+ :disabled="attribute.readOnly"
97
+ :checked="isChecked(option)"
98
+ @change="onChange($event, option)"
99
+ @blur="onBlur"
100
+ />
101
+ <label
102
+ :for="`${attribute.name}-${option}`"
103
+ :class="`${styling.classLabel}${attribute.readOnly ? ` ${kcClsx('kcInputClassRadioCheckboxLabelDisabled')}` : ''}`"
104
+ >
105
+ <component :is="inputLabel(i18n, attribute, option)" />
106
+ </label>
107
+ </div>
108
+ </template>
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
3
+ import type { I18n } from '../i18n/i18n';
4
+
5
+ defineProps<{ kcClsx: KcClsx; i18n: I18n }>();
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ id="kc-form-options"
11
+ :class="kcClsx('kcFormOptionsClass')"
12
+ >
13
+ <div :class="kcClsx('kcFormOptionsWrapperClass')">
14
+ <div class="checkbox">
15
+ <label>
16
+ <input
17
+ type="checkbox"
18
+ id="logout-sessions"
19
+ name="logout-sessions"
20
+ value="on"
21
+ />
22
+ <component :is="i18n.msg('logoutOtherSessions')" />
23
+ </label>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
3
+ import { assert } from 'keycloakify/tools/assert';
4
+ import { ref, watch } from 'vue';
5
+ import type { I18n } from '../i18n/i18n';
6
+
7
+ const props = defineProps<{
8
+ kcClsx: KcClsx;
9
+ i18n: I18n;
10
+ passwordInputId: string;
11
+ }>();
12
+
13
+ const isPasswordRevealed = ref(false);
14
+
15
+ watch(
16
+ isPasswordRevealed,
17
+ (revealed) => {
18
+ const el = document.getElementById(props.passwordInputId);
19
+ assert(el instanceof HTMLInputElement);
20
+ el.type = revealed ? 'text' : 'password';
21
+ },
22
+ { immediate: false },
23
+ );
24
+ </script>
25
+
26
+ <template>
27
+ <div :class="kcClsx('kcInputGroup')">
28
+ <slot />
29
+ <button
30
+ type="button"
31
+ :class="kcClsx('kcFormPasswordVisibilityButtonClass')"
32
+ :aria-label="i18n.msgStr(isPasswordRevealed ? 'hidePassword' : 'showPassword')"
33
+ :aria-controls="passwordInputId"
34
+ @click="isPasswordRevealed = !isPasswordRevealed"
35
+ >
36
+ <i
37
+ :class="kcClsx(isPasswordRevealed ? 'kcFormPasswordVisibilityIconHide' : 'kcFormPasswordVisibilityIconShow')"
38
+ aria-hidden="true"
39
+ ></i>
40
+ </button>
41
+ </div>
42
+ </template>
@@ -0,0 +1,74 @@
1
+ <script setup lang="ts">
2
+ import { assert } from 'keycloakify/tools/assert';
3
+ import { computed } from 'vue';
4
+ import { inputLabel } from './inputLabel';
5
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
6
+
7
+ const props = defineProps<InputFieldByTypeProps>();
8
+
9
+ const isMultiple = computed(() => props.attribute.annotations.inputType === 'multiselect');
10
+
11
+ const options = computed<string[]>(() => {
12
+ const { inputOptionsFromValidation } = props.attribute.annotations;
13
+ if (inputOptionsFromValidation !== undefined) {
14
+ assert(typeof inputOptionsFromValidation === 'string');
15
+ const validator = (props.attribute.validators as Record<string, { options?: string[] }>)[
16
+ inputOptionsFromValidation
17
+ ];
18
+ if (validator?.options !== undefined) {
19
+ return validator.options;
20
+ }
21
+ }
22
+ return props.attribute.validators.options?.options ?? [];
23
+ });
24
+
25
+ function onChange(event: Event) {
26
+ const target = event.target as HTMLSelectElement;
27
+ props.dispatchFormAction({
28
+ action: 'update',
29
+ name: props.attribute.name,
30
+ valueOrValues: isMultiple.value ? Array.from(target.selectedOptions).map((option) => option.value) : target.value,
31
+ });
32
+ }
33
+
34
+ function onBlur() {
35
+ props.dispatchFormAction({
36
+ action: 'focus lost',
37
+ name: props.attribute.name,
38
+ fieldIndex: undefined,
39
+ });
40
+ }
41
+
42
+ const sizeAnno = computed(() =>
43
+ props.attribute.annotations.inputTypeSize === undefined
44
+ ? undefined
45
+ : parseInt(`${props.attribute.annotations.inputTypeSize}`),
46
+ );
47
+ </script>
48
+
49
+ <template>
50
+ <select
51
+ :id="attribute.name"
52
+ :name="attribute.name"
53
+ :class="kcClsx('kcInputClass')"
54
+ :aria-invalid="displayableErrors.length !== 0"
55
+ :disabled="attribute.readOnly"
56
+ :multiple="isMultiple"
57
+ :size="sizeAnno"
58
+ :value="valueOrValues"
59
+ @change="onChange"
60
+ @blur="onBlur"
61
+ >
62
+ <option
63
+ v-if="!isMultiple"
64
+ value=""
65
+ ></option>
66
+ <option
67
+ v-for="option in options"
68
+ :key="option"
69
+ :value="option"
70
+ >
71
+ <component :is="inputLabel(i18n, attribute, option)" />
72
+ </option>
73
+ </select>
74
+ </template>
@@ -0,0 +1,59 @@
1
+ <script setup lang="ts">
2
+ import { kcSanitize } from 'keycloakify/lib/kcSanitize';
3
+ import type { KcContext } from 'keycloakify/login/KcContext';
4
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
5
+ import type { I18n } from '../i18n/i18n';
6
+
7
+ const props = defineProps<{
8
+ i18n: I18n;
9
+ kcClsx: KcClsx;
10
+ messagesPerField: Pick<KcContext['messagesPerField'], 'existsError' | 'get'>;
11
+ areTermsAccepted: boolean;
12
+ onAreTermsAcceptedValueChange: (areTermsAccepted: boolean) => void;
13
+ }>();
14
+
15
+ function onChange(event: Event) {
16
+ props.onAreTermsAcceptedValueChange((event.target as HTMLInputElement).checked);
17
+ }
18
+ </script>
19
+
20
+ <template>
21
+ <div class="form-group">
22
+ <div :class="kcClsx('kcInputWrapperClass')">
23
+ <component :is="i18n.msg('termsTitle')" />
24
+ <div id="kc-registration-terms-text">
25
+ <component :is="i18n.msg('termsText')" />
26
+ </div>
27
+ </div>
28
+ </div>
29
+ <div class="form-group">
30
+ <div :class="kcClsx('kcLabelWrapperClass')">
31
+ <input
32
+ type="checkbox"
33
+ id="termsAccepted"
34
+ name="termsAccepted"
35
+ :class="kcClsx('kcCheckboxInputClass')"
36
+ :checked="areTermsAccepted"
37
+ :aria-invalid="messagesPerField.existsError('termsAccepted')"
38
+ @change="onChange"
39
+ />
40
+ <label
41
+ for="termsAccepted"
42
+ :class="kcClsx('kcLabelClass')"
43
+ >
44
+ <component :is="i18n.msg('acceptTerms')" />
45
+ </label>
46
+ </div>
47
+ <div
48
+ v-if="messagesPerField.existsError('termsAccepted')"
49
+ :class="kcClsx('kcLabelWrapperClass')"
50
+ >
51
+ <span
52
+ id="input-error-terms-accepted"
53
+ :class="kcClsx('kcInputErrorMessageClass')"
54
+ aria-live="polite"
55
+ v-html="kcSanitize(messagesPerField.get('termsAccepted'))"
56
+ ></span>
57
+ </div>
58
+ </div>
59
+ </template>
@@ -0,0 +1,47 @@
1
+ <script setup lang="ts">
2
+ import { assert } from 'keycloakify/tools/assert';
3
+ import { computed } from 'vue';
4
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
5
+
6
+ const props = defineProps<InputFieldByTypeProps>();
7
+
8
+ const value = computed(() => {
9
+ assert(typeof props.valueOrValues === 'string');
10
+ return props.valueOrValues;
11
+ });
12
+
13
+ const numAnno = (v: string | number | undefined) => (v === undefined ? undefined : parseInt(`${v}`));
14
+
15
+ function onChange(event: Event) {
16
+ const target = event.target as HTMLTextAreaElement;
17
+ props.dispatchFormAction({
18
+ action: 'update',
19
+ name: props.attribute.name,
20
+ valueOrValues: target.value,
21
+ });
22
+ }
23
+
24
+ function onBlur() {
25
+ props.dispatchFormAction({
26
+ action: 'focus lost',
27
+ name: props.attribute.name,
28
+ fieldIndex: undefined,
29
+ });
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <textarea
35
+ :id="attribute.name"
36
+ :name="attribute.name"
37
+ :class="kcClsx('kcInputClass')"
38
+ :aria-invalid="displayableErrors.length !== 0"
39
+ :disabled="attribute.readOnly"
40
+ :cols="numAnno(attribute.annotations.inputTypeCols)"
41
+ :rows="numAnno(attribute.annotations.inputTypeRows)"
42
+ :maxlength="numAnno(attribute.annotations.inputTypeMaxlength)"
43
+ :value="value"
44
+ @input="onChange"
45
+ @blur="onBlur"
46
+ ></textarea>
47
+ </template>
@@ -0,0 +1,119 @@
1
+ <script setup lang="ts">
2
+ import type { KcContext } from 'keycloakify/login/KcContext';
3
+ import { computed, watch } from 'vue';
4
+ import FieldErrors from './FieldErrors.vue';
5
+ import GroupLabel from './GroupLabel.vue';
6
+ import InputFieldByType from './InputFieldByType.vue';
7
+ import type { UserProfileFormFieldsProps } from './UserProfileFormFieldsProps';
8
+ import { useUserProfileForm } from '../lib/useUserProfileForm';
9
+ import type { I18n } from '../i18n/i18n';
10
+
11
+ const props = defineProps<UserProfileFormFieldsProps<KcContext, I18n>>();
12
+
13
+ const { formState, dispatchFormAction } = useUserProfileForm({
14
+ kcContext: props.kcContext,
15
+ i18n: props.i18n,
16
+ doMakeUserConfirmPassword: props.doMakeUserConfirmPassword,
17
+ });
18
+
19
+ watch(
20
+ () => formState.value.isFormSubmittable,
21
+ (isFormSubmittable) => props.onIsFormSubmittableValueChange(isFormSubmittable),
22
+ { immediate: true },
23
+ );
24
+
25
+ const groupNameRef = { current: '' };
26
+
27
+ const fieldRows = computed(() =>
28
+ formState.value.formFieldStates.map((formFieldState) => {
29
+ const { attribute, valueOrValues, displayableErrors } = formFieldState;
30
+ const isHidden =
31
+ attribute.annotations.inputType === 'hidden' ||
32
+ (attribute.name === 'password-confirm' && !props.doMakeUserConfirmPassword);
33
+ return { attribute, valueOrValues, displayableErrors, isHidden };
34
+ }),
35
+ );
36
+ </script>
37
+
38
+ <template>
39
+ <template
40
+ v-for="(row, i) in fieldRows"
41
+ :key="i"
42
+ >
43
+ <GroupLabel
44
+ :attribute="row.attribute"
45
+ :groupNameRef="groupNameRef"
46
+ :i18n="i18n"
47
+ :kcClsx="kcClsx"
48
+ />
49
+
50
+ <slot
51
+ name="beforeField"
52
+ :attribute="row.attribute"
53
+ :dispatchFormAction="dispatchFormAction"
54
+ :displayableErrors="row.displayableErrors"
55
+ :valueOrValues="row.valueOrValues"
56
+ :kcClsx="kcClsx"
57
+ :i18n="i18n"
58
+ />
59
+
60
+ <div
61
+ :class="kcClsx('kcFormGroupClass')"
62
+ :style="{ display: row.isHidden ? 'none' : undefined }"
63
+ >
64
+ <div :class="kcClsx('kcLabelWrapperClass')">
65
+ <label
66
+ :for="row.attribute.name"
67
+ :class="kcClsx('kcLabelClass')"
68
+ >
69
+ <component :is="i18n.advancedMsg(row.attribute.displayName ?? '')" />
70
+ </label>
71
+ <template v-if="row.attribute.required">&nbsp;*</template>
72
+ </div>
73
+ <div :class="kcClsx('kcInputWrapperClass')">
74
+ <div
75
+ v-if="row.attribute.annotations.inputHelperTextBefore !== undefined"
76
+ :class="kcClsx('kcInputHelperTextBeforeClass')"
77
+ :id="`form-help-text-before-${row.attribute.name}`"
78
+ aria-live="polite"
79
+ >
80
+ <component :is="i18n.advancedMsg(row.attribute.annotations.inputHelperTextBefore)" />
81
+ </div>
82
+
83
+ <InputFieldByType
84
+ :attribute="row.attribute"
85
+ :valueOrValues="row.valueOrValues"
86
+ :displayableErrors="row.displayableErrors"
87
+ :dispatchFormAction="dispatchFormAction"
88
+ :kcClsx="kcClsx"
89
+ :i18n="i18n"
90
+ />
91
+
92
+ <FieldErrors
93
+ :attribute="row.attribute"
94
+ :displayableErrors="row.displayableErrors"
95
+ :kcClsx="kcClsx"
96
+ />
97
+
98
+ <div
99
+ v-if="row.attribute.annotations.inputHelperTextAfter !== undefined"
100
+ :class="kcClsx('kcInputHelperTextAfterClass')"
101
+ :id="`form-help-text-after-${row.attribute.name}`"
102
+ aria-live="polite"
103
+ >
104
+ <component :is="i18n.advancedMsg(row.attribute.annotations.inputHelperTextAfter)" />
105
+ </div>
106
+
107
+ <slot
108
+ name="afterField"
109
+ :attribute="row.attribute"
110
+ :dispatchFormAction="dispatchFormAction"
111
+ :displayableErrors="row.displayableErrors"
112
+ :valueOrValues="row.valueOrValues"
113
+ :kcClsx="kcClsx"
114
+ :i18n="i18n"
115
+ />
116
+ </div>
117
+ </div>
118
+ </template>
119
+ </template>
@@ -0,0 +1,22 @@
1
+ import type { Attribute } from 'keycloakify/login/KcContext';
2
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
3
+ import type { FormAction, FormFieldError } from '../lib/useUserProfileForm';
4
+ import type { I18n } from '../i18n/i18n';
5
+
6
+ export type UserProfileFormFieldsProps<KcContext = any, I18nType = I18n> = {
7
+ kcContext: Extract<KcContext, { profile: unknown }>;
8
+ i18n: I18nType;
9
+ kcClsx: KcClsx;
10
+ onIsFormSubmittableValueChange: (isFormSubmittable: boolean) => void;
11
+ doMakeUserConfirmPassword: boolean;
12
+ };
13
+
14
+ /** Scoped-slot payload for the optional `beforeField` / `afterField` slots. */
15
+ export type BeforeAfterFieldSlotProps = {
16
+ attribute: Attribute;
17
+ dispatchFormAction: (action: FormAction) => void;
18
+ displayableErrors: FormFieldError[];
19
+ valueOrValues: string | string[];
20
+ kcClsx: KcClsx;
21
+ i18n: I18n;
22
+ };
@@ -0,0 +1,18 @@
1
+ import type { Attribute } from 'keycloakify/login/KcContext';
2
+ import { createTextVNode, type VNode } from 'vue';
3
+ import type { I18n } from '../i18n/i18n';
4
+
5
+ export const inputLabel = (i18n: I18n, attribute: Attribute, option: string): VNode => {
6
+ const { advancedMsg } = i18n;
7
+
8
+ if (attribute.annotations.inputOptionLabels !== undefined) {
9
+ const { inputOptionLabels } = attribute.annotations;
10
+ return advancedMsg(inputOptionLabels[option] ?? option);
11
+ }
12
+
13
+ if (attribute.annotations.inputOptionLabelsI18nPrefix !== undefined) {
14
+ return advancedMsg(`${attribute.annotations.inputOptionLabelsI18nPrefix}.${option}`);
15
+ }
16
+
17
+ return createTextVNode(option);
18
+ };
@@ -0,0 +1,16 @@
1
+ import type { GenericI18n_noJsx } from 'keycloakify/login/i18n/noJsx/GenericI18n_noJsx';
2
+ import { type MessageKey as MessageKey_defaultSet } from 'keycloakify/login/i18n/messages_defaultSet/types';
3
+ import type { VNode } from 'vue';
4
+
5
+ /** INTERNAL: DO NOT IMPORT THIS */
6
+ export type GenericI18n_vue<MessageKey extends string, LanguageTag extends string> = GenericI18n_noJsx<
7
+ MessageKey,
8
+ LanguageTag
9
+ > & {
10
+ /** Same as msgStr but returns a VNode with the html string rendered as html. */
11
+ msg: (key: MessageKey_defaultSet, ...args: (string | undefined)[]) => VNode;
12
+ /** Same as advancedMsgStr but returns a VNode with the html string rendered as html. */
13
+ advancedMsg: (key: string, ...args: (string | undefined)[]) => VNode;
14
+ };
15
+
16
+ export type I18n = GenericI18n_vue<MessageKey_defaultSet, string>;