@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.
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/keycloakify-vue/account/DefaultPage.vue +55 -0
- package/keycloakify-vue/account/DefaultPage.vue.d.ts +14 -0
- package/keycloakify-vue/account/KcContext/index.d.ts +1 -0
- package/keycloakify-vue/account/KcContext/index.js +0 -0
- package/keycloakify-vue/account/Template.useInitialize.d.ts +13 -0
- package/keycloakify-vue/account/Template.useInitialize.js +20 -0
- package/keycloakify-vue/account/Template.vue +178 -0
- package/keycloakify-vue/account/Template.vue.d.ts +17 -0
- package/keycloakify-vue/account/TemplateProps.d.ts +9 -0
- package/keycloakify-vue/account/TemplateProps.js +0 -0
- package/keycloakify-vue/account/i18n/i18n.d.ts +11 -0
- package/keycloakify-vue/account/i18n/i18n.js +0 -0
- package/keycloakify-vue/account/i18n/i18nBuilder.d.ts +18 -0
- package/keycloakify-vue/account/i18n/i18nBuilder.js +29 -0
- package/keycloakify-vue/account/i18n/index.d.ts +1 -0
- package/keycloakify-vue/account/i18n/index.js +1 -0
- package/keycloakify-vue/account/i18n/useI18n.d.ts +28 -0
- package/keycloakify-vue/account/i18n/useI18n.js +67 -0
- package/keycloakify-vue/account/index.d.ts +4 -0
- package/keycloakify-vue/account/index.js +8 -0
- package/keycloakify-vue/account/pages/Account.vue +182 -0
- package/keycloakify-vue/account/pages/Account.vue.d.ts +9 -0
- package/keycloakify-vue/account/pages/Applications.vue +192 -0
- package/keycloakify-vue/account/pages/Applications.vue.d.ts +9 -0
- package/keycloakify-vue/account/pages/FederatedIdentity.vue +123 -0
- package/keycloakify-vue/account/pages/FederatedIdentity.vue.d.ts +9 -0
- package/keycloakify-vue/account/pages/Log.vue +64 -0
- package/keycloakify-vue/account/pages/Log.vue.d.ts +9 -0
- package/keycloakify-vue/account/pages/NotImplemented.vue +24 -0
- package/keycloakify-vue/account/pages/NotImplemented.vue.d.ts +6 -0
- package/keycloakify-vue/account/pages/PageProps.d.ts +9 -0
- package/keycloakify-vue/account/pages/PageProps.js +0 -0
- package/keycloakify-vue/account/pages/Password.vue +247 -0
- package/keycloakify-vue/account/pages/Password.vue.d.ts +9 -0
- package/keycloakify-vue/account/pages/Sessions.vue +84 -0
- package/keycloakify-vue/account/pages/Sessions.vue.d.ts +9 -0
- package/keycloakify-vue/account/pages/Totp.vue +308 -0
- package/keycloakify-vue/account/pages/Totp.vue.d.ts +9 -0
- package/keycloakify-vue/bin/index.js +14 -0
- package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcContext.js +0 -0
- package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcPage.vue +23 -0
- package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcPageStory.js +18 -0
- package/keycloakify-vue/bin/initialize-account-theme/boilerplate/KcPageStory.vue +13 -0
- package/keycloakify-vue/bin/initialize-account-theme/boilerplate/i18n.js +5 -0
- package/keycloakify-vue/login/DefaultPage.vue +167 -0
- package/keycloakify-vue/login/DefaultPage.vue.d.ts +20 -0
- package/keycloakify-vue/login/Template.useInitialize.d.ts +18 -0
- package/keycloakify-vue/login/Template.useInitialize.js +49 -0
- package/keycloakify-vue/login/Template.vue +239 -0
- package/keycloakify-vue/login/Template.vue.d.ts +26 -0
- package/keycloakify-vue/login/TemplateProps.d.ts +14 -0
- package/keycloakify-vue/login/TemplateProps.js +0 -0
- package/keycloakify-vue/login/components/AddRemoveButtonsMultiValuedAttribute.vue +59 -0
- package/keycloakify-vue/login/components/AddRemoveButtonsMultiValuedAttribute.vue.d.ts +15 -0
- package/keycloakify-vue/login/components/FieldErrors.vue +35 -0
- package/keycloakify-vue/login/components/FieldErrors.vue.d.ts +14 -0
- package/keycloakify-vue/login/components/GroupLabel.vue +68 -0
- package/keycloakify-vue/login/components/GroupLabel.vue.d.ts +14 -0
- package/keycloakify-vue/login/components/InputFieldByType.vue +94 -0
- package/keycloakify-vue/login/components/InputFieldByType.vue.d.ts +4 -0
- package/keycloakify-vue/login/components/InputFieldByTypeProps.d.ts +12 -0
- package/keycloakify-vue/login/components/InputFieldByTypeProps.js +0 -0
- package/keycloakify-vue/login/components/InputTag.vue +105 -0
- package/keycloakify-vue/login/components/InputTag.vue.d.ts +7 -0
- package/keycloakify-vue/login/components/InputTagSelects.vue +108 -0
- package/keycloakify-vue/login/components/InputTagSelects.vue.d.ts +4 -0
- package/keycloakify-vue/login/components/LogoutOtherSessions.vue +27 -0
- package/keycloakify-vue/login/components/LogoutOtherSessions.vue.d.ts +9 -0
- package/keycloakify-vue/login/components/PasswordWrapper.vue +42 -0
- package/keycloakify-vue/login/components/PasswordWrapper.vue.d.ts +20 -0
- package/keycloakify-vue/login/components/SelectTag.vue +74 -0
- package/keycloakify-vue/login/components/SelectTag.vue.d.ts +4 -0
- package/keycloakify-vue/login/components/TermsAcceptance.vue +59 -0
- package/keycloakify-vue/login/components/TermsAcceptance.vue.d.ts +13 -0
- package/keycloakify-vue/login/components/TextareaTag.vue +47 -0
- package/keycloakify-vue/login/components/TextareaTag.vue.d.ts +4 -0
- package/keycloakify-vue/login/components/UserProfileFormFields.vue +119 -0
- package/keycloakify-vue/login/components/UserProfileFormFields.vue.d.ts +33 -0
- package/keycloakify-vue/login/components/UserProfileFormFieldsProps.d.ts +22 -0
- package/keycloakify-vue/login/components/UserProfileFormFieldsProps.js +0 -0
- package/keycloakify-vue/login/components/inputLabel.d.ts +4 -0
- package/keycloakify-vue/login/components/inputLabel.js +15 -0
- package/keycloakify-vue/login/i18n/i18n.d.ts +11 -0
- package/keycloakify-vue/login/i18n/i18n.js +0 -0
- package/keycloakify-vue/login/i18n/i18nBuilder.d.ts +18 -0
- package/keycloakify-vue/login/i18n/i18nBuilder.js +29 -0
- package/keycloakify-vue/login/i18n/index.d.ts +1 -0
- package/keycloakify-vue/login/i18n/index.js +1 -0
- package/keycloakify-vue/login/i18n/useI18n.d.ts +28 -0
- package/keycloakify-vue/login/i18n/useI18n.js +67 -0
- package/keycloakify-vue/login/index.d.ts +5 -0
- package/keycloakify-vue/login/index.js +10 -0
- package/keycloakify-vue/login/lib/useUserProfileForm.d.ts +53 -0
- package/keycloakify-vue/login/lib/useUserProfileForm.js +50 -0
- package/keycloakify-vue/login/pages/Code.vue +54 -0
- package/keycloakify-vue/login/pages/Code.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/DeleteAccountConfirm.vue +69 -0
- package/keycloakify-vue/login/pages/DeleteAccountConfirm.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/DeleteCredential.vue +56 -0
- package/keycloakify-vue/login/pages/DeleteCredential.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/Error.vue +41 -0
- package/keycloakify-vue/login/pages/Error.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/FrontchannelLogout.vue +67 -0
- package/keycloakify-vue/login/pages/FrontchannelLogout.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/IdpReviewUserProfile.vue +77 -0
- package/keycloakify-vue/login/pages/IdpReviewUserProfile.vue.d.ts +14 -0
- package/keycloakify-vue/login/pages/Info.vue +61 -0
- package/keycloakify-vue/login/pages/Info.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LinkIdpAction.vue +66 -0
- package/keycloakify-vue/login/pages/LinkIdpAction.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/Login.vue +230 -0
- package/keycloakify-vue/login/pages/Login.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginConfigTotp.vue +233 -0
- package/keycloakify-vue/login/pages/LoginConfigTotp.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginIdpLinkConfirm.vue +57 -0
- package/keycloakify-vue/login/pages/LoginIdpLinkConfirm.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginIdpLinkConfirmOverride.vue +56 -0
- package/keycloakify-vue/login/pages/LoginIdpLinkConfirmOverride.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginIdpLinkEmail.vue +52 -0
- package/keycloakify-vue/login/pages/LoginIdpLinkEmail.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginOauth2DeviceVerifyUserCode.vue +82 -0
- package/keycloakify-vue/login/pages/LoginOauth2DeviceVerifyUserCode.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginOauthGrant.vue +131 -0
- package/keycloakify-vue/login/pages/LoginOauthGrant.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginOtp.vue +135 -0
- package/keycloakify-vue/login/pages/LoginOtp.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginPageExpired.vue +44 -0
- package/keycloakify-vue/login/pages/LoginPageExpired.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.useScript.d.ts +21 -0
- package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js +74 -0
- package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.vue +255 -0
- package/keycloakify-vue/login/pages/LoginPasskeysConditionalAuthenticate.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginPassword.useScript.d.ts +23 -0
- package/keycloakify-vue/login/pages/LoginPassword.useScript.js +64 -0
- package/keycloakify-vue/login/pages/LoginPassword.vue +191 -0
- package/keycloakify-vue/login/pages/LoginPassword.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.useScript.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js +139 -0
- package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.vue +183 -0
- package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeConfig.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeInput.vue +90 -0
- package/keycloakify-vue/login/pages/LoginRecoveryAuthnCodeInput.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginResetOtp.vue +88 -0
- package/keycloakify-vue/login/pages/LoginResetOtp.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginResetPassword.vue +114 -0
- package/keycloakify-vue/login/pages/LoginResetPassword.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginUpdatePassword.vue +145 -0
- package/keycloakify-vue/login/pages/LoginUpdatePassword.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginUpdateProfile.vue +94 -0
- package/keycloakify-vue/login/pages/LoginUpdateProfile.vue.d.ts +14 -0
- package/keycloakify-vue/login/pages/LoginUsername.useScript.d.ts +23 -0
- package/keycloakify-vue/login/pages/LoginUsername.useScript.js +64 -0
- package/keycloakify-vue/login/pages/LoginUsername.vue +263 -0
- package/keycloakify-vue/login/pages/LoginUsername.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginVerifyEmail.vue +39 -0
- package/keycloakify-vue/login/pages/LoginVerifyEmail.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LoginX509Info.vue +120 -0
- package/keycloakify-vue/login/pages/LoginX509Info.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/LogoutConfirm.vue +73 -0
- package/keycloakify-vue/login/pages/LogoutConfirm.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/NotImplemented.vue +12 -0
- package/keycloakify-vue/login/pages/NotImplemented.vue.d.ts +6 -0
- package/keycloakify-vue/login/pages/PageProps.d.ts +9 -0
- package/keycloakify-vue/login/pages/PageProps.js +0 -0
- package/keycloakify-vue/login/pages/Register.vue +158 -0
- package/keycloakify-vue/login/pages/Register.vue.d.ts +14 -0
- package/keycloakify-vue/login/pages/SamlPostForm.vue +75 -0
- package/keycloakify-vue/login/pages/SamlPostForm.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/SelectAuthenticator.vue +65 -0
- package/keycloakify-vue/login/pages/SelectAuthenticator.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/SelectOrganization.vue +89 -0
- package/keycloakify-vue/login/pages/SelectOrganization.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/Terms.vue +56 -0
- package/keycloakify-vue/login/pages/Terms.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/UpdateEmail.vue +100 -0
- package/keycloakify-vue/login/pages/UpdateEmail.vue.d.ts +14 -0
- package/keycloakify-vue/login/pages/WebauthnAuthenticate.useScript.d.ts +22 -0
- package/keycloakify-vue/login/pages/WebauthnAuthenticate.useScript.js +53 -0
- package/keycloakify-vue/login/pages/WebauthnAuthenticate.vue +186 -0
- package/keycloakify-vue/login/pages/WebauthnAuthenticate.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/WebauthnError.vue +84 -0
- package/keycloakify-vue/login/pages/WebauthnError.vue.d.ts +9 -0
- package/keycloakify-vue/login/pages/WebauthnRegister.useScript.d.ts +28 -0
- package/keycloakify-vue/login/pages/WebauthnRegister.useScript.js +75 -0
- package/keycloakify-vue/login/pages/WebauthnRegister.vue +105 -0
- package/keycloakify-vue/login/pages/WebauthnRegister.vue.d.ts +9 -0
- package/keycloakify-vue/tools/useInsertLinkTags.d.ts +12 -0
- package/keycloakify-vue/tools/useInsertLinkTags.js +47 -0
- package/keycloakify-vue/tools/useInsertScriptTags.d.ts +19 -0
- package/keycloakify-vue/tools/useInsertScriptTags.js +56 -0
- package/keycloakify-vue/tools/useSetClassName.d.ts +4 -0
- package/keycloakify-vue/tools/useSetClassName.js +16 -0
- package/package.json +553 -0
- package/src/account/DefaultPage.vue +55 -0
- package/src/account/KcContext/index.ts +1 -0
- package/src/account/Template.useInitialize.ts +34 -0
- package/src/account/Template.vue +178 -0
- package/src/account/TemplateProps.ts +11 -0
- package/src/account/i18n/i18n.ts +16 -0
- package/src/account/i18n/i18nBuilder.ts +100 -0
- package/src/account/i18n/index.ts +1 -0
- package/src/account/i18n/useI18n.ts +128 -0
- package/src/account/index.ts +4 -0
- package/src/account/pages/Account.vue +182 -0
- package/src/account/pages/Applications.vue +192 -0
- package/src/account/pages/FederatedIdentity.vue +123 -0
- package/src/account/pages/Log.vue +64 -0
- package/src/account/pages/NotImplemented.vue +24 -0
- package/src/account/pages/PageProps.ts +10 -0
- package/src/account/pages/Password.vue +247 -0
- package/src/account/pages/Sessions.vue +84 -0
- package/src/account/pages/Totp.vue +308 -0
- package/src/bin/initialize-account-theme/boilerplate/KcContext.ts +11 -0
- package/src/bin/initialize-account-theme/boilerplate/KcPage.vue +23 -0
- package/src/bin/initialize-account-theme/boilerplate/KcPageStory.ts +22 -0
- package/src/bin/initialize-account-theme/boilerplate/KcPageStory.vue +13 -0
- package/src/bin/initialize-account-theme/boilerplate/i18n.ts +8 -0
- package/src/login/DefaultPage.vue +167 -0
- package/src/login/Template.useInitialize.ts +71 -0
- package/src/login/Template.vue +239 -0
- package/src/login/TemplateProps.ts +17 -0
- package/src/login/components/AddRemoveButtonsMultiValuedAttribute.vue +59 -0
- package/src/login/components/FieldErrors.vue +35 -0
- package/src/login/components/GroupLabel.vue +68 -0
- package/src/login/components/InputFieldByType.vue +94 -0
- package/src/login/components/InputFieldByTypeProps.ts +13 -0
- package/src/login/components/InputTag.vue +105 -0
- package/src/login/components/InputTagSelects.vue +108 -0
- package/src/login/components/LogoutOtherSessions.vue +27 -0
- package/src/login/components/PasswordWrapper.vue +42 -0
- package/src/login/components/SelectTag.vue +74 -0
- package/src/login/components/TermsAcceptance.vue +59 -0
- package/src/login/components/TextareaTag.vue +47 -0
- package/src/login/components/UserProfileFormFields.vue +119 -0
- package/src/login/components/UserProfileFormFieldsProps.ts +22 -0
- package/src/login/components/inputLabel.ts +18 -0
- package/src/login/i18n/i18n.ts +16 -0
- package/src/login/i18n/i18nBuilder.ts +100 -0
- package/src/login/i18n/index.ts +1 -0
- package/src/login/i18n/useI18n.ts +128 -0
- package/src/login/index.ts +5 -0
- package/src/login/lib/useUserProfileForm.ts +121 -0
- package/src/login/pages/Code.vue +54 -0
- package/src/login/pages/DeleteAccountConfirm.vue +69 -0
- package/src/login/pages/DeleteCredential.vue +56 -0
- package/src/login/pages/Error.vue +41 -0
- package/src/login/pages/FrontchannelLogout.vue +67 -0
- package/src/login/pages/IdpReviewUserProfile.vue +77 -0
- package/src/login/pages/Info.vue +61 -0
- package/src/login/pages/LinkIdpAction.vue +66 -0
- package/src/login/pages/Login.vue +230 -0
- package/src/login/pages/LoginConfigTotp.vue +233 -0
- package/src/login/pages/LoginIdpLinkConfirm.vue +57 -0
- package/src/login/pages/LoginIdpLinkConfirmOverride.vue +56 -0
- package/src/login/pages/LoginIdpLinkEmail.vue +52 -0
- package/src/login/pages/LoginOauth2DeviceVerifyUserCode.vue +82 -0
- package/src/login/pages/LoginOauthGrant.vue +131 -0
- package/src/login/pages/LoginOtp.vue +135 -0
- package/src/login/pages/LoginPageExpired.vue +44 -0
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.ts +96 -0
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.vue +255 -0
- package/src/login/pages/LoginPassword.useScript.ts +88 -0
- package/src/login/pages/LoginPassword.vue +191 -0
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.useScript.ts +152 -0
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.vue +183 -0
- package/src/login/pages/LoginRecoveryAuthnCodeInput.vue +90 -0
- package/src/login/pages/LoginResetOtp.vue +88 -0
- package/src/login/pages/LoginResetPassword.vue +114 -0
- package/src/login/pages/LoginUpdatePassword.vue +145 -0
- package/src/login/pages/LoginUpdateProfile.vue +94 -0
- package/src/login/pages/LoginUsername.useScript.ts +88 -0
- package/src/login/pages/LoginUsername.vue +263 -0
- package/src/login/pages/LoginVerifyEmail.vue +39 -0
- package/src/login/pages/LoginX509Info.vue +120 -0
- package/src/login/pages/LogoutConfirm.vue +73 -0
- package/src/login/pages/NotImplemented.vue +12 -0
- package/src/login/pages/PageProps.ts +10 -0
- package/src/login/pages/Register.vue +158 -0
- package/src/login/pages/SamlPostForm.vue +75 -0
- package/src/login/pages/SelectAuthenticator.vue +65 -0
- package/src/login/pages/SelectOrganization.vue +89 -0
- package/src/login/pages/Terms.vue +56 -0
- package/src/login/pages/UpdateEmail.vue +100 -0
- package/src/login/pages/WebauthnAuthenticate.useScript.ts +75 -0
- package/src/login/pages/WebauthnAuthenticate.vue +186 -0
- package/src/login/pages/WebauthnError.vue +84 -0
- package/src/login/pages/WebauthnRegister.useScript.ts +109 -0
- package/src/login/pages/WebauthnRegister.vue +105 -0
- package/src/tools/useInsertLinkTags.ts +62 -0
- package/src/tools/useInsertScriptTags.ts +75 -0
- package/src/tools/useSetClassName.ts +15 -0
- package/stories/account/KcContext.ts +13 -0
- package/stories/account/KcContextMock.ts +26 -0
- package/stories/account/KcPage.vue +26 -0
- package/stories/account/KcPageStory.vue +13 -0
- package/stories/account/i18n.ts +7 -0
- package/stories/account/pages/Account.stories.ts +22 -0
- package/stories/account/pages/Applications.stories.ts +70 -0
- package/stories/account/pages/FederatedIdentity.stories.ts +64 -0
- package/stories/account/pages/Log.stories.ts +42 -0
- package/stories/account/pages/Password.stories.ts +22 -0
- package/stories/account/pages/Sessions.stories.ts +41 -0
- package/stories/account/pages/Totp.stories.ts +33 -0
- package/stories/kc.gen.ts +17 -0
- package/stories/login/KcContext.ts +13 -0
- package/stories/login/KcContextMock.ts +26 -0
- package/stories/login/KcPage.vue +28 -0
- package/stories/login/KcPageStory.vue +13 -0
- package/stories/login/i18n.ts +7 -0
- package/stories/login/pages/Code.stories.ts +50 -0
- package/stories/login/pages/DeleteAccountConfirm.stories.ts +32 -0
- package/stories/login/pages/DeleteCredential.stories.ts +23 -0
- package/stories/login/pages/Error.stories.ts +53 -0
- package/stories/login/pages/FrontchannelLogout.stories.ts +24 -0
- package/stories/login/pages/IdpReviewUserProfile.stories.ts +56 -0
- package/stories/login/pages/Info.stories.ts +52 -0
- package/stories/login/pages/LinkIdpAction.stories.ts +30 -0
- package/stories/login/pages/Login.stories.ts +76 -0
- package/stories/login/pages/LoginConfigTotp.stories.ts +53 -0
- package/stories/login/pages/LoginIdpLinkConfirm.stories.ts +34 -0
- package/stories/login/pages/LoginIdpLinkConfirmOverride.stories.ts +14 -0
- package/stories/login/pages/LoginIdpLinkEmail.stories.ts +60 -0
- package/stories/login/pages/LoginOauth2DeviceVerifyUserCode.stories.ts +42 -0
- package/stories/login/pages/LoginOauthGrant.stories.ts +95 -0
- package/stories/login/pages/LoginOtp.stories.ts +92 -0
- package/stories/login/pages/LoginPageExpired.stories.ts +29 -0
- package/stories/login/pages/LoginPasskeysConditionalAuthenticate.stories.ts +14 -0
- package/stories/login/pages/LoginPassword.stories.ts +49 -0
- package/stories/login/pages/LoginRecoveryAuthnCodeConfig.stories.ts +28 -0
- package/stories/login/pages/LoginRecoveryAuthnCodeInput.stories.ts +14 -0
- package/stories/login/pages/LoginResetOtp.stories.ts +69 -0
- package/stories/login/pages/LoginResetPassword.stories.ts +48 -0
- package/stories/login/pages/LoginUpdatePassword.stories.ts +52 -0
- package/stories/login/pages/LoginUpdateProfile.stories.ts +29 -0
- package/stories/login/pages/LoginUsername.stories.ts +25 -0
- package/stories/login/pages/LoginVerifyEmail.stories.ts +63 -0
- package/stories/login/pages/LoginX509Info.stories.ts +29 -0
- package/stories/login/pages/LogoutConfirm.stories.ts +35 -0
- package/stories/login/pages/Register.stories.ts +76 -0
- package/stories/login/pages/SamlPostForm.stories.ts +14 -0
- package/stories/login/pages/SelectAuthenticator.stories.ts +89 -0
- package/stories/login/pages/SelectOrganization.stories.ts +63 -0
- package/stories/login/pages/Terms.stories.ts +78 -0
- package/stories/login/pages/UpdateEmail.stories.ts +28 -0
- package/stories/login/pages/WebauthnAuthenticate.stories.ts +147 -0
- package/stories/login/pages/WebauthnError.stories.ts +77 -0
- package/stories/login/pages/WebauthnRegister.stories.ts +54 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { assert } from 'keycloakify/tools/assert';
|
|
2
|
+
import { watch, type Ref } from 'vue';
|
|
3
|
+
import { useInsertLinkTags } from '../tools/useInsertLinkTags';
|
|
4
|
+
import { useInsertScriptTags } from '../tools/useInsertScriptTags';
|
|
5
|
+
import type { KcContext } from 'keycloakify/login/KcContext';
|
|
6
|
+
|
|
7
|
+
export type KcContextLike = {
|
|
8
|
+
url: {
|
|
9
|
+
resourcesCommonPath: string;
|
|
10
|
+
resourcesPath: string;
|
|
11
|
+
ssoLoginInOtherTabsUrl: string;
|
|
12
|
+
};
|
|
13
|
+
scripts?: string[];
|
|
14
|
+
authenticationSession?: {
|
|
15
|
+
authSessionIdHash: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
assert<keyof KcContextLike extends keyof KcContext ? true : false>();
|
|
20
|
+
assert<KcContext extends KcContextLike ? true : false>();
|
|
21
|
+
|
|
22
|
+
export function useInitialize(params: { kcContext: KcContextLike; doUseDefaultCss: boolean }): {
|
|
23
|
+
isReadyToRender: Ref<boolean>;
|
|
24
|
+
} {
|
|
25
|
+
const { kcContext, doUseDefaultCss } = params;
|
|
26
|
+
const { url, scripts } = kcContext;
|
|
27
|
+
|
|
28
|
+
const { areAllStyleSheetsLoaded } = useInsertLinkTags({
|
|
29
|
+
componentOrHookName: 'Template',
|
|
30
|
+
hrefs: !doUseDefaultCss
|
|
31
|
+
? []
|
|
32
|
+
: [
|
|
33
|
+
`${url.resourcesCommonPath}/node_modules/@patternfly/patternfly/patternfly.min.css`,
|
|
34
|
+
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`,
|
|
35
|
+
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`,
|
|
36
|
+
`${url.resourcesCommonPath}/lib/pficon/pficon.css`,
|
|
37
|
+
`${url.resourcesPath}/css/login.css`,
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const { insertScriptTags } = useInsertScriptTags({
|
|
42
|
+
componentOrHookName: 'Template',
|
|
43
|
+
scriptTags: [
|
|
44
|
+
{ type: 'module', src: `${url.resourcesPath}/js/menu-button-links.js` },
|
|
45
|
+
...(scripts === undefined ? [] : scripts.map((src) => ({ type: 'text/javascript' as const, src }))),
|
|
46
|
+
{
|
|
47
|
+
type: 'module',
|
|
48
|
+
textContent: [
|
|
49
|
+
`import { startSessionPolling, checkAuthSession } from "${url.resourcesPath}/js/authChecker.js";`,
|
|
50
|
+
``,
|
|
51
|
+
`startSessionPolling("${kcContext.url.ssoLoginInOtherTabsUrl}");`,
|
|
52
|
+
kcContext.authenticationSession === undefined
|
|
53
|
+
? ''
|
|
54
|
+
: `checkAuthSession("${kcContext.authenticationSession.authSessionIdHash}");`,
|
|
55
|
+
].join('\n'),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
watch(
|
|
61
|
+
areAllStyleSheetsLoaded,
|
|
62
|
+
(isReadyToRender) => {
|
|
63
|
+
if (isReadyToRender) {
|
|
64
|
+
insertScriptTags();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{ immediate: true },
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return { isReadyToRender: areAllStyleSheetsLoaded };
|
|
71
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { kcSanitize } from 'keycloakify/lib/kcSanitize';
|
|
3
|
+
import { getKcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
4
|
+
import { clsx } from 'keycloakify/tools/clsx';
|
|
5
|
+
import { computed, h, onMounted, useSlots } from 'vue';
|
|
6
|
+
import type { KcContext } from 'keycloakify/login/KcContext';
|
|
7
|
+
import type { I18n } from './i18n/i18n';
|
|
8
|
+
import type { TemplateProps } from './TemplateProps';
|
|
9
|
+
import { useInitialize } from './Template.useInitialize';
|
|
10
|
+
import { useSetClassName } from '../tools/useSetClassName';
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<TemplateProps<KcContext, I18n>>(), {
|
|
13
|
+
displayInfo: false,
|
|
14
|
+
displayMessage: true,
|
|
15
|
+
displayRequiredFields: false,
|
|
16
|
+
showAnotherWayIfPresent: true,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const { kcClsx } = getKcClsx({
|
|
20
|
+
doUseDefaultCss: props.doUseDefaultCss,
|
|
21
|
+
classes: props.classes,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const kcContext = props.kcContext;
|
|
25
|
+
const { realm, auth, url, message, isAppInitiatedAction } = kcContext;
|
|
26
|
+
|
|
27
|
+
const slots = useSlots();
|
|
28
|
+
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
document.title = props.documentTitle ?? props.i18n.msgStr('loginTitle', kcContext.realm.displayName);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
useSetClassName({ qualifiedName: 'html', className: kcClsx('kcHtmlClass') });
|
|
34
|
+
useSetClassName({
|
|
35
|
+
qualifiedName: 'body',
|
|
36
|
+
className: props.bodyClassName ?? kcClsx('kcBodyClass'),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const { isReadyToRender } = useInitialize({
|
|
40
|
+
kcContext,
|
|
41
|
+
doUseDefaultCss: props.doUseDefaultCss,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const showUsernameNode = computed(() => auth !== undefined && auth.showUsername && !auth.showResetCredentials);
|
|
45
|
+
|
|
46
|
+
const headerSection = () => {
|
|
47
|
+
if (!showUsernameNode.value) {
|
|
48
|
+
return h('h1', { id: 'kc-page-title' }, slots.header?.());
|
|
49
|
+
}
|
|
50
|
+
return h('div', { id: 'kc-username', class: kcClsx('kcFormGroupClass') }, [
|
|
51
|
+
h('label', { id: 'kc-attempted-username' }, auth!.attemptedUsername),
|
|
52
|
+
h(
|
|
53
|
+
'a',
|
|
54
|
+
{
|
|
55
|
+
id: 'reset-login',
|
|
56
|
+
href: url.loginRestartFlowUrl,
|
|
57
|
+
'aria-label': props.i18n.msgStr('restartLoginTooltip'),
|
|
58
|
+
},
|
|
59
|
+
h('div', { class: 'kc-login-tooltip' }, [
|
|
60
|
+
h('i', { class: kcClsx('kcResetFlowIcon') }),
|
|
61
|
+
h('span', { class: 'kc-tooltip-text' }, props.i18n.msgStr('restartLoginTooltip')),
|
|
62
|
+
]),
|
|
63
|
+
),
|
|
64
|
+
]);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function onTryAnotherWay() {
|
|
68
|
+
(document.getElementById('kc-select-try-another-way-form') as HTMLFormElement).requestSubmit();
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<div
|
|
74
|
+
v-if="isReadyToRender"
|
|
75
|
+
:class="kcClsx('kcLoginClass')"
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
id="kc-header"
|
|
79
|
+
:class="kcClsx('kcHeaderClass')"
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
id="kc-header-wrapper"
|
|
83
|
+
:class="kcClsx('kcHeaderWrapperClass')"
|
|
84
|
+
>
|
|
85
|
+
{{ i18n.msgStr('loginTitleHtml', realm.displayNameHtml) }}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div :class="kcClsx('kcFormCardClass')">
|
|
90
|
+
<header :class="kcClsx('kcFormHeaderClass')">
|
|
91
|
+
<div
|
|
92
|
+
v-if="i18n.enabledLanguages.length > 1"
|
|
93
|
+
:class="kcClsx('kcLocaleMainClass')"
|
|
94
|
+
id="kc-locale"
|
|
95
|
+
>
|
|
96
|
+
<div
|
|
97
|
+
id="kc-locale-wrapper"
|
|
98
|
+
:class="kcClsx('kcLocaleWrapperClass')"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
id="kc-locale-dropdown"
|
|
102
|
+
:class="clsx('menu-button-links', kcClsx('kcLocaleDropDownClass'))"
|
|
103
|
+
>
|
|
104
|
+
<button
|
|
105
|
+
:tabindex="1"
|
|
106
|
+
id="kc-current-locale-link"
|
|
107
|
+
:aria-label="i18n.msgStr('languages')"
|
|
108
|
+
aria-haspopup="true"
|
|
109
|
+
aria-expanded="false"
|
|
110
|
+
aria-controls="language-switch1"
|
|
111
|
+
>
|
|
112
|
+
{{ i18n.currentLanguage.label }}
|
|
113
|
+
</button>
|
|
114
|
+
<ul
|
|
115
|
+
role="menu"
|
|
116
|
+
:tabindex="-1"
|
|
117
|
+
aria-labelledby="kc-current-locale-link"
|
|
118
|
+
aria-activedescendant=""
|
|
119
|
+
id="language-switch1"
|
|
120
|
+
:class="kcClsx('kcLocaleListClass')"
|
|
121
|
+
>
|
|
122
|
+
<li
|
|
123
|
+
v-for="(enabledLanguage, i) in i18n.enabledLanguages"
|
|
124
|
+
:key="enabledLanguage.languageTag"
|
|
125
|
+
:class="kcClsx('kcLocaleListItemClass')"
|
|
126
|
+
role="none"
|
|
127
|
+
>
|
|
128
|
+
<a
|
|
129
|
+
role="menuitem"
|
|
130
|
+
:id="`language-${i + 1}`"
|
|
131
|
+
:class="kcClsx('kcLocaleItemClass')"
|
|
132
|
+
:href="enabledLanguage.href"
|
|
133
|
+
>
|
|
134
|
+
{{ enabledLanguage.label }}
|
|
135
|
+
</a>
|
|
136
|
+
</li>
|
|
137
|
+
</ul>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<template v-if="displayRequiredFields">
|
|
143
|
+
<div :class="kcClsx('kcContentWrapperClass')">
|
|
144
|
+
<div :class="clsx(kcClsx('kcLabelWrapperClass'), 'subtitle')">
|
|
145
|
+
<span class="subtitle">
|
|
146
|
+
<span class="required">*</span>
|
|
147
|
+
{{ i18n.msgStr('requiredFields') }}
|
|
148
|
+
</span>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="col-md-10">
|
|
151
|
+
<component :is="headerSection" />
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
<component
|
|
156
|
+
v-else
|
|
157
|
+
:is="headerSection"
|
|
158
|
+
/>
|
|
159
|
+
</header>
|
|
160
|
+
|
|
161
|
+
<div id="kc-content">
|
|
162
|
+
<div id="kc-content-wrapper">
|
|
163
|
+
<div
|
|
164
|
+
v-if="displayMessage && message !== undefined && (message.type !== 'warning' || !isAppInitiatedAction)"
|
|
165
|
+
:class="
|
|
166
|
+
clsx(
|
|
167
|
+
`alert-${message.type}`,
|
|
168
|
+
kcClsx('kcAlertClass'),
|
|
169
|
+
`pf-m-${message?.type === 'error' ? 'danger' : message.type}`,
|
|
170
|
+
)
|
|
171
|
+
"
|
|
172
|
+
>
|
|
173
|
+
<div class="pf-c-alert__icon">
|
|
174
|
+
<span
|
|
175
|
+
v-if="message.type === 'success'"
|
|
176
|
+
:class="kcClsx('kcFeedbackSuccessIcon')"
|
|
177
|
+
></span>
|
|
178
|
+
<span
|
|
179
|
+
v-else-if="message.type === 'warning'"
|
|
180
|
+
:class="kcClsx('kcFeedbackWarningIcon')"
|
|
181
|
+
></span>
|
|
182
|
+
<span
|
|
183
|
+
v-else-if="message.type === 'error'"
|
|
184
|
+
:class="kcClsx('kcFeedbackErrorIcon')"
|
|
185
|
+
></span>
|
|
186
|
+
<span
|
|
187
|
+
v-else-if="message.type === 'info'"
|
|
188
|
+
:class="kcClsx('kcFeedbackInfoIcon')"
|
|
189
|
+
></span>
|
|
190
|
+
</div>
|
|
191
|
+
<span
|
|
192
|
+
:class="kcClsx('kcAlertTitleClass')"
|
|
193
|
+
v-html="kcSanitize(message.summary)"
|
|
194
|
+
></span>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<slot />
|
|
198
|
+
|
|
199
|
+
<form
|
|
200
|
+
v-if="auth !== undefined && auth.showTryAnotherWayLink"
|
|
201
|
+
id="kc-select-try-another-way-form"
|
|
202
|
+
:action="url.loginAction"
|
|
203
|
+
method="post"
|
|
204
|
+
>
|
|
205
|
+
<div :class="kcClsx('kcFormGroupClass')">
|
|
206
|
+
<input
|
|
207
|
+
type="hidden"
|
|
208
|
+
name="tryAnotherWay"
|
|
209
|
+
value="on"
|
|
210
|
+
/>
|
|
211
|
+
<a
|
|
212
|
+
href="#"
|
|
213
|
+
id="try-another-way"
|
|
214
|
+
@click.prevent="onTryAnotherWay"
|
|
215
|
+
>
|
|
216
|
+
{{ i18n.msgStr('doTryAnotherWay') }}
|
|
217
|
+
</a>
|
|
218
|
+
</div>
|
|
219
|
+
</form>
|
|
220
|
+
|
|
221
|
+
<slot name="socialProviders" />
|
|
222
|
+
|
|
223
|
+
<div
|
|
224
|
+
v-if="displayInfo"
|
|
225
|
+
id="kc-info"
|
|
226
|
+
:class="kcClsx('kcSignUpClass')"
|
|
227
|
+
>
|
|
228
|
+
<div
|
|
229
|
+
id="kc-info-wrapper"
|
|
230
|
+
:class="kcClsx('kcInfoAreaWrapperClass')"
|
|
231
|
+
>
|
|
232
|
+
<slot name="info" />
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ClassKey } from 'keycloakify/login/lib/kcClsx';
|
|
2
|
+
|
|
3
|
+
export type TemplateProps<KcContext, I18n> = {
|
|
4
|
+
kcContext: KcContext;
|
|
5
|
+
i18n: I18n;
|
|
6
|
+
doUseDefaultCss: boolean;
|
|
7
|
+
classes?: Partial<Record<ClassKey, string>>;
|
|
8
|
+
|
|
9
|
+
displayInfo?: boolean;
|
|
10
|
+
displayMessage?: boolean;
|
|
11
|
+
displayRequiredFields?: boolean;
|
|
12
|
+
showAnotherWayIfPresent?: boolean;
|
|
13
|
+
documentTitle?: string;
|
|
14
|
+
bodyClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type { ClassKey };
|
|
@@ -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"> | </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,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,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,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,13 @@
|
|
|
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 InputFieldByTypeProps = {
|
|
7
|
+
attribute: Attribute;
|
|
8
|
+
valueOrValues: string | string[];
|
|
9
|
+
displayableErrors: FormFieldError[];
|
|
10
|
+
dispatchFormAction: (action: FormAction) => void;
|
|
11
|
+
i18n: I18n;
|
|
12
|
+
kcClsx: KcClsx;
|
|
13
|
+
};
|