@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,26 @@
1
+ import type { KcContext } from 'keycloakify/login/KcContext';
2
+ import type { I18n } from './i18n/i18n';
3
+ import type { TemplateProps } from './TemplateProps';
4
+ type __VLS_Props = TemplateProps<KcContext, I18n>;
5
+ declare var __VLS_11: {}, __VLS_13: {}, __VLS_15: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_11) => any;
8
+ } & {
9
+ socialProviders?: (props: typeof __VLS_13) => any;
10
+ } & {
11
+ info?: (props: typeof __VLS_15) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
+ displayInfo: boolean;
15
+ displayMessage: boolean;
16
+ displayRequiredFields: boolean;
17
+ showAnotherWayIfPresent: boolean;
18
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,14 @@
1
+ import type { ClassKey } from 'keycloakify/login/lib/kcClsx';
2
+ export type TemplateProps<KcContext, I18n> = {
3
+ kcContext: KcContext;
4
+ i18n: I18n;
5
+ doUseDefaultCss: boolean;
6
+ classes?: Partial<Record<ClassKey, string>>;
7
+ displayInfo?: boolean;
8
+ displayMessage?: boolean;
9
+ displayRequiredFields?: boolean;
10
+ showAnotherWayIfPresent?: boolean;
11
+ documentTitle?: string;
12
+ bodyClassName?: string;
13
+ };
14
+ export type { ClassKey };
File without changes
@@ -0,0 +1,59 @@
1
+ <script setup lang="ts">
2
+ import type { Attribute } from 'keycloakify/login/KcContext';
3
+ import { computed } from 'vue';
4
+ import { getButtonToDisplayForMultivaluedAttributeField, type FormAction } from '../lib/useUserProfileForm';
5
+ import type { I18n } from '../i18n/i18n';
6
+
7
+ const props = defineProps<{
8
+ attribute: Attribute;
9
+ values: string[];
10
+ fieldIndex: number;
11
+ dispatchFormAction: (action: Extract<FormAction, { action: 'update' }>) => void;
12
+ i18n: I18n;
13
+ }>();
14
+
15
+ const buttons = computed(() =>
16
+ getButtonToDisplayForMultivaluedAttributeField({
17
+ attribute: props.attribute,
18
+ values: props.values,
19
+ fieldIndex: props.fieldIndex,
20
+ }),
21
+ );
22
+
23
+ const idPostfix = `-${props.attribute.name}-${props.fieldIndex + 1}`;
24
+ </script>
25
+
26
+ <template>
27
+ <template v-if="buttons.hasRemove">
28
+ <button
29
+ :id="`kc-remove${idPostfix}`"
30
+ type="button"
31
+ class="pf-c-button pf-m-inline pf-m-link"
32
+ @click="
33
+ dispatchFormAction({
34
+ action: 'update',
35
+ name: attribute.name,
36
+ valueOrValues: values.filter((_, i) => i !== fieldIndex),
37
+ })
38
+ "
39
+ >
40
+ <component :is="i18n.msg('remove')" />
41
+ </button>
42
+ <template v-if="buttons.hasAdd">&nbsp;|&nbsp;</template>
43
+ </template>
44
+ <button
45
+ v-if="buttons.hasAdd"
46
+ :id="`kc-add${idPostfix}`"
47
+ type="button"
48
+ class="pf-c-button pf-m-inline pf-m-link"
49
+ @click="
50
+ dispatchFormAction({
51
+ action: 'update',
52
+ name: attribute.name,
53
+ valueOrValues: [...values, ''],
54
+ })
55
+ "
56
+ >
57
+ <component :is="i18n.msg('addValue')" />
58
+ </button>
59
+ </template>
@@ -0,0 +1,15 @@
1
+ import type { Attribute } from 'keycloakify/login/KcContext';
2
+ import { type FormAction } from '../lib/useUserProfileForm';
3
+ import type { I18n } from '../i18n/i18n';
4
+ type __VLS_Props = {
5
+ attribute: Attribute;
6
+ values: string[];
7
+ fieldIndex: number;
8
+ dispatchFormAction: (action: Extract<FormAction, {
9
+ action: 'update';
10
+ }>) => void;
11
+ i18n: I18n;
12
+ };
13
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -0,0 +1,35 @@
1
+ <script setup lang="ts">
2
+ import type { Attribute } from 'keycloakify/login/KcContext';
3
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
4
+ import { computed } from 'vue';
5
+ import type { FormFieldError } from '../lib/useUserProfileForm';
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ attribute: Attribute;
10
+ displayableErrors: FormFieldError[];
11
+ fieldIndex?: number;
12
+ kcClsx: KcClsx;
13
+ }>(),
14
+ { fieldIndex: undefined },
15
+ );
16
+
17
+ const errors = computed(() => props.displayableErrors.filter((error) => error.fieldIndex === props.fieldIndex));
18
+ </script>
19
+
20
+ <template>
21
+ <span
22
+ v-if="errors.length !== 0"
23
+ :id="`input-error-${attribute.name}${fieldIndex === undefined ? '' : `-${fieldIndex}`}`"
24
+ :class="kcClsx('kcInputErrorMessageClass')"
25
+ aria-live="polite"
26
+ >
27
+ <template
28
+ v-for="(displayableError, i) in errors"
29
+ :key="i"
30
+ >
31
+ <component :is="displayableError.errorMessage" />
32
+ <br v-if="errors.length - 1 !== i" />
33
+ </template>
34
+ </span>
35
+ </template>
@@ -0,0 +1,14 @@
1
+ import type { Attribute } from 'keycloakify/login/KcContext';
2
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
3
+ import type { FormFieldError } from '../lib/useUserProfileForm';
4
+ type __VLS_Props = {
5
+ attribute: Attribute;
6
+ displayableErrors: FormFieldError[];
7
+ fieldIndex?: number;
8
+ kcClsx: KcClsx;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
+ fieldIndex: number;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,68 @@
1
+ <script setup lang="ts">
2
+ import type { Attribute } from 'keycloakify/login/KcContext';
3
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
4
+ import { computed } from 'vue';
5
+ import type { I18n } from '../i18n/i18n';
6
+
7
+ const props = defineProps<{
8
+ attribute: Attribute;
9
+ groupNameRef: { current: string };
10
+ i18n: I18n;
11
+ kcClsx: KcClsx;
12
+ }>();
13
+
14
+ // Mirrors the svelte $effect: the first attribute of each new group renders the
15
+ // group header once. Group structure is static per mount, so compute in setup.
16
+ const isGroupLabel = (() => {
17
+ if (props.attribute.group?.name !== props.groupNameRef.current) {
18
+ // groupNameRef is a mutable ref-object (not a Vue prop value), mutation is intentional
19
+ // eslint-disable-next-line vue/no-mutating-props
20
+ props.groupNameRef.current = props.attribute.group?.name ?? '';
21
+ if (props.groupNameRef.current !== '') {
22
+ return true;
23
+ }
24
+ }
25
+ return false;
26
+ })();
27
+
28
+ const html5DataAnnotations = computed(() =>
29
+ Object.fromEntries(
30
+ Object.entries(props.attribute.group?.html5DataAnnotations ?? {}).map(([key, value]) => [`data-${key}`, value]),
31
+ ),
32
+ );
33
+
34
+ const groupDisplayHeader = computed(() => props.attribute.group?.displayHeader ?? '');
35
+ const groupDisplayDescription = computed(() => props.attribute.group?.displayDescription ?? '');
36
+ </script>
37
+
38
+ <template>
39
+ <div
40
+ v-if="isGroupLabel"
41
+ :class="kcClsx('kcFormGroupClass')"
42
+ v-bind="html5DataAnnotations"
43
+ >
44
+ <div :class="kcClsx('kcContentWrapperClass')">
45
+ <label
46
+ :id="`header-${attribute.group?.name}`"
47
+ :class="kcClsx('kcFormGroupHeader')"
48
+ >
49
+ <component
50
+ v-if="groupDisplayHeader !== ''"
51
+ :is="i18n.advancedMsg(groupDisplayHeader)"
52
+ />
53
+ <template v-else>{{ attribute.group?.name ?? '' }}</template>
54
+ </label>
55
+ </div>
56
+ <div
57
+ v-if="groupDisplayDescription !== ''"
58
+ :class="kcClsx('kcLabelWrapperClass')"
59
+ >
60
+ <label
61
+ :id="`description-${attribute.group?.name}`"
62
+ :class="kcClsx('kcLabelClass')"
63
+ >
64
+ <component :is="i18n.advancedMsg(groupDisplayDescription)" />
65
+ </label>
66
+ </div>
67
+ </div>
68
+ </template>
@@ -0,0 +1,14 @@
1
+ import type { Attribute } from 'keycloakify/login/KcContext';
2
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
3
+ import type { I18n } from '../i18n/i18n';
4
+ type __VLS_Props = {
5
+ attribute: Attribute;
6
+ groupNameRef: {
7
+ current: string;
8
+ };
9
+ i18n: I18n;
10
+ kcClsx: KcClsx;
11
+ };
12
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,94 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue';
3
+ import InputTag from './InputTag.vue';
4
+ import InputTagSelects from './InputTagSelects.vue';
5
+ import PasswordWrapper from './PasswordWrapper.vue';
6
+ import SelectTag from './SelectTag.vue';
7
+ import TextareaTag from './TextareaTag.vue';
8
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
9
+
10
+ const props = defineProps<InputFieldByTypeProps>();
11
+
12
+ const inputType = computed(() => props.attribute.annotations.inputType ?? '');
13
+
14
+ const isPasswordField = computed(() => ['password', 'password-confirm'].includes(props.attribute.name));
15
+ </script>
16
+
17
+ <template>
18
+ <input
19
+ v-if="inputType === 'hidden'"
20
+ type="hidden"
21
+ :name="attribute.name"
22
+ :value="valueOrValues"
23
+ />
24
+
25
+ <TextareaTag
26
+ v-else-if="inputType === 'textarea'"
27
+ :attribute="attribute"
28
+ :valueOrValues="valueOrValues"
29
+ :displayableErrors="displayableErrors"
30
+ :dispatchFormAction="dispatchFormAction"
31
+ :i18n="i18n"
32
+ :kcClsx="kcClsx"
33
+ />
34
+
35
+ <SelectTag
36
+ v-else-if="['select', 'multiselect'].includes(inputType)"
37
+ :attribute="attribute"
38
+ :valueOrValues="valueOrValues"
39
+ :displayableErrors="displayableErrors"
40
+ :dispatchFormAction="dispatchFormAction"
41
+ :i18n="i18n"
42
+ :kcClsx="kcClsx"
43
+ />
44
+
45
+ <InputTagSelects
46
+ v-else-if="['select-radiobuttons', 'multiselect-checkboxes'].includes(inputType)"
47
+ :attribute="attribute"
48
+ :valueOrValues="valueOrValues"
49
+ :displayableErrors="displayableErrors"
50
+ :dispatchFormAction="dispatchFormAction"
51
+ :i18n="i18n"
52
+ :kcClsx="kcClsx"
53
+ />
54
+
55
+ <template v-else-if="valueOrValues instanceof Array">
56
+ <InputTag
57
+ v-for="(_, i) in valueOrValues"
58
+ :key="i"
59
+ :attribute="attribute"
60
+ :valueOrValues="valueOrValues"
61
+ :displayableErrors="displayableErrors"
62
+ :dispatchFormAction="dispatchFormAction"
63
+ :i18n="i18n"
64
+ :kcClsx="kcClsx"
65
+ :fieldIndex="i"
66
+ />
67
+ </template>
68
+
69
+ <PasswordWrapper
70
+ v-else-if="isPasswordField"
71
+ :kcClsx="kcClsx"
72
+ :i18n="i18n"
73
+ :passwordInputId="attribute.name"
74
+ >
75
+ <InputTag
76
+ :attribute="attribute"
77
+ :valueOrValues="valueOrValues"
78
+ :displayableErrors="displayableErrors"
79
+ :dispatchFormAction="dispatchFormAction"
80
+ :i18n="i18n"
81
+ :kcClsx="kcClsx"
82
+ />
83
+ </PasswordWrapper>
84
+
85
+ <InputTag
86
+ v-else
87
+ :attribute="attribute"
88
+ :valueOrValues="valueOrValues"
89
+ :displayableErrors="displayableErrors"
90
+ :dispatchFormAction="dispatchFormAction"
91
+ :i18n="i18n"
92
+ :kcClsx="kcClsx"
93
+ />
94
+ </template>
@@ -0,0 +1,4 @@
1
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
2
+ declare const __VLS_export: import("vue").DefineComponent<InputFieldByTypeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputFieldByTypeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,12 @@
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
+ export type InputFieldByTypeProps = {
6
+ attribute: Attribute;
7
+ valueOrValues: string | string[];
8
+ displayableErrors: FormFieldError[];
9
+ dispatchFormAction: (action: FormAction) => void;
10
+ i18n: I18n;
11
+ kcClsx: KcClsx;
12
+ };
@@ -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,7 @@
1
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
2
+ type __VLS_Props = InputFieldByTypeProps & {
3
+ fieldIndex?: number;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -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,4 @@
1
+ import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
2
+ declare const __VLS_export: import("vue").DefineComponent<InputFieldByTypeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputFieldByTypeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -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,9 @@
1
+ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
2
+ import type { I18n } from '../i18n/i18n';
3
+ type __VLS_Props = {
4
+ kcClsx: KcClsx;
5
+ i18n: I18n;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;