keycloakify 10.0.0-rc.37 → 10.0.0-rc.39
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/account/Fallback.d.ts +1 -2
- package/account/Fallback.js.map +1 -1
- package/account/KcContext/KcContext.d.ts +6 -6
- package/account/KcContext/getKcContextMock.d.ts +9 -9
- package/account/KcContext/getKcContextMock.js +3 -3
- package/account/KcContext/getKcContextMock.js.map +1 -1
- package/account/Template.d.ts +1 -2
- package/account/Template.js +7 -6
- package/account/Template.js.map +1 -1
- package/account/TemplateProps.d.ts +1 -3
- package/account/i18n/i18n.d.ts +9 -4
- package/account/i18n/i18n.js +132 -87
- package/account/i18n/i18n.js.map +1 -1
- package/account/i18n/index.d.ts +9 -2
- package/account/i18n/index.js +5 -1
- package/account/i18n/index.js.map +1 -1
- package/account/lib/kcClsx.d.ts +9 -0
- package/account/lib/{useGetClassName.js → kcClsx.js} +3 -3
- package/account/lib/kcClsx.js.map +1 -0
- package/account/pages/Account.d.ts +1 -2
- package/account/pages/Account.js +9 -7
- package/account/pages/Account.js.map +1 -1
- package/account/pages/Applications.d.ts +1 -2
- package/account/pages/Applications.js +7 -7
- package/account/pages/Applications.js.map +1 -1
- package/account/pages/FederatedIdentity.d.ts +1 -2
- package/account/pages/FederatedIdentity.js +4 -3
- package/account/pages/FederatedIdentity.js.map +1 -1
- package/account/pages/Log.d.ts +1 -2
- package/account/pages/Log.js +6 -5
- package/account/pages/Log.js.map +1 -1
- package/account/pages/PageProps.d.ts +2 -4
- package/account/pages/Password.d.ts +1 -2
- package/account/pages/Password.js +10 -9
- package/account/pages/Password.js.map +1 -1
- package/account/pages/Sessions.d.ts +1 -2
- package/account/pages/Sessions.js +6 -6
- package/account/pages/Sessions.js.map +1 -1
- package/account/pages/Totp.d.ts +1 -2
- package/account/pages/Totp.js +6 -5
- package/account/pages/Totp.js.map +1 -1
- package/bin/193.index.js +13 -13
- package/bin/{430.index.js → 214.index.js} +161 -2
- package/bin/3.index.js +165 -149
- package/bin/322.index.js +595 -0
- package/bin/453.index.js +3 -3
- package/bin/526.index.js +42 -632
- package/bin/538.index.js +563 -0
- package/bin/932.index.js +7 -7
- package/bin/{890.index.js → 941.index.js} +2 -159
- package/bin/944.index.js +621 -0
- package/bin/961.index.js +5 -5
- package/bin/97.index.js +3 -3
- package/bin/{314.index.js → 98.index.js} +217 -48
- package/bin/main.js +20 -8
- package/lib/getKcClsx.d.ts +11 -0
- package/lib/getKcClsx.js +55 -0
- package/lib/getKcClsx.js.map +1 -0
- package/login/Fallback.d.ts +2 -2
- package/login/Fallback.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +6 -6
- package/login/KcContext/getKcContextMock.d.ts +9 -9
- package/login/KcContext/getKcContextMock.js +3 -3
- package/login/KcContext/getKcContextMock.js.map +1 -1
- package/login/Template.d.ts +1 -2
- package/login/Template.js +10 -9
- package/login/Template.js.map +1 -1
- package/login/TemplateProps.d.ts +1 -3
- package/login/UserProfileFormFields.d.ts +6 -5
- package/login/UserProfileFormFields.js +35 -36
- package/login/UserProfileFormFields.js.map +1 -1
- package/login/i18n/i18n.d.ts +9 -4
- package/login/i18n/i18n.js +136 -91
- package/login/i18n/i18n.js.map +1 -1
- package/login/i18n/index.d.ts +9 -2
- package/login/i18n/index.js +5 -1
- package/login/i18n/index.js.map +1 -1
- package/login/lib/kcClsx.d.ts +9 -0
- package/login/lib/{useGetClassName.js → kcClsx.js} +3 -3
- package/login/lib/kcClsx.js.map +1 -0
- package/login/lib/useUserProfileForm.d.ts +9 -6
- package/login/lib/useUserProfileForm.js +7 -5
- package/login/lib/useUserProfileForm.js.map +1 -1
- package/login/pages/Code.d.ts +1 -2
- package/login/pages/Code.js +6 -5
- package/login/pages/Code.js.map +1 -1
- package/login/pages/DeleteAccountConfirm.d.ts +1 -2
- package/login/pages/DeleteAccountConfirm.js +7 -7
- package/login/pages/DeleteAccountConfirm.js.map +1 -1
- package/login/pages/DeleteCredential.d.ts +1 -2
- package/login/pages/DeleteCredential.js +6 -6
- package/login/pages/DeleteCredential.js.map +1 -1
- package/login/pages/Error.d.ts +1 -2
- package/login/pages/Error.js +4 -3
- package/login/pages/Error.js.map +1 -1
- package/login/pages/FrontchannelLogout.d.ts +1 -2
- package/login/pages/FrontchannelLogout.js +4 -3
- package/login/pages/FrontchannelLogout.js.map +1 -1
- package/login/pages/IdpReviewUserProfile.d.ts +2 -2
- package/login/pages/IdpReviewUserProfile.js +6 -6
- package/login/pages/IdpReviewUserProfile.js.map +1 -1
- package/login/pages/Info.d.ts +1 -2
- package/login/pages/Info.js +4 -3
- package/login/pages/Info.js.map +1 -1
- package/login/pages/Login.d.ts +1 -2
- package/login/pages/Login.js +10 -8
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginConfigTotp.d.ts +1 -2
- package/login/pages/LoginConfigTotp.js +8 -7
- package/login/pages/LoginConfigTotp.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirm.d.ts +1 -2
- package/login/pages/LoginIdpLinkConfirm.js +6 -6
- package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
- package/login/pages/LoginIdpLinkEmail.d.ts +1 -2
- package/login/pages/LoginIdpLinkEmail.js +4 -3
- package/login/pages/LoginIdpLinkEmail.js.map +1 -1
- package/login/pages/LoginOauth2DeviceVerifyUserCode.d.ts +1 -2
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js +6 -6
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
- package/login/pages/LoginOauthGrant.d.ts +1 -2
- package/login/pages/LoginOauthGrant.js +7 -7
- package/login/pages/LoginOauthGrant.js.map +1 -1
- package/login/pages/LoginOtp.d.ts +1 -2
- package/login/pages/LoginOtp.js +6 -6
- package/login/pages/LoginOtp.js.map +1 -1
- package/login/pages/LoginPageExpired.d.ts +1 -2
- package/login/pages/LoginPageExpired.js +4 -3
- package/login/pages/LoginPageExpired.js.map +1 -1
- package/login/pages/LoginPassword.d.ts +1 -2
- package/login/pages/LoginPassword.js +9 -7
- package/login/pages/LoginPassword.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +1 -2
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +9 -7
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +1 -2
- package/login/pages/LoginRecoveryAuthnCodeInput.js +6 -6
- package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
- package/login/pages/LoginResetOtp.d.ts +1 -2
- package/login/pages/LoginResetOtp.js +6 -6
- package/login/pages/LoginResetOtp.js.map +1 -1
- package/login/pages/LoginResetPassword.d.ts +1 -2
- package/login/pages/LoginResetPassword.js +7 -7
- package/login/pages/LoginResetPassword.js.map +1 -1
- package/login/pages/LoginUpdatePassword.d.ts +1 -2
- package/login/pages/LoginUpdatePassword.js +10 -9
- package/login/pages/LoginUpdatePassword.js.map +1 -1
- package/login/pages/LoginUpdateProfile.d.ts +2 -2
- package/login/pages/LoginUpdateProfile.js +7 -12
- package/login/pages/LoginUpdateProfile.js.map +1 -1
- package/login/pages/LoginUsername.d.ts +1 -2
- package/login/pages/LoginUsername.js +8 -7
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/LoginVerifyEmail.d.ts +1 -2
- package/login/pages/LoginVerifyEmail.js +4 -3
- package/login/pages/LoginVerifyEmail.js.map +1 -1
- package/login/pages/LoginX509Info.d.ts +1 -2
- package/login/pages/LoginX509Info.js +6 -6
- package/login/pages/LoginX509Info.js.map +1 -1
- package/login/pages/LogoutConfirm.d.ts +1 -2
- package/login/pages/LogoutConfirm.js +6 -6
- package/login/pages/LogoutConfirm.js.map +1 -1
- package/login/pages/PageProps.d.ts +2 -4
- package/login/pages/Register.d.ts +2 -2
- package/login/pages/Register.js +8 -16
- package/login/pages/Register.js.map +1 -1
- package/login/pages/SamlPostForm.d.ts +1 -2
- package/login/pages/SamlPostForm.js +4 -3
- package/login/pages/SamlPostForm.js.map +1 -1
- package/login/pages/SelectAuthenticator.d.ts +1 -2
- package/login/pages/SelectAuthenticator.js +6 -9
- package/login/pages/SelectAuthenticator.js.map +1 -1
- package/login/pages/Terms.d.ts +1 -2
- package/login/pages/Terms.js +6 -6
- package/login/pages/Terms.js.map +1 -1
- package/login/pages/UpdateEmail.d.ts +2 -2
- package/login/pages/UpdateEmail.js +8 -12
- package/login/pages/UpdateEmail.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.d.ts +1 -2
- package/login/pages/WebauthnAuthenticate.js +13 -12
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnError.d.ts +1 -2
- package/login/pages/WebauthnError.js +7 -7
- package/login/pages/WebauthnError.js.map +1 -1
- package/login/pages/WebauthnRegister.d.ts +1 -2
- package/login/pages/WebauthnRegister.js +9 -8
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/package.json +27 -22
- package/src/account/Fallback.tsx +1 -2
- package/src/account/KcContext/KcContext.ts +7 -7
- package/src/account/KcContext/getKcContextMock.ts +13 -24
- package/src/account/Template.tsx +8 -8
- package/src/account/TemplateProps.ts +1 -6
- package/src/account/i18n/i18n.tsx +204 -125
- package/src/account/i18n/index.ts +10 -2
- package/src/account/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
- package/src/account/pages/Account.tsx +15 -21
- package/src/account/pages/Applications.tsx +8 -9
- package/src/account/pages/FederatedIdentity.tsx +5 -5
- package/src/account/pages/Log.tsx +8 -8
- package/src/account/pages/PageProps.ts +2 -4
- package/src/account/pages/Password.tsx +13 -16
- package/src/account/pages/Sessions.tsx +9 -10
- package/src/account/pages/Totp.tsx +19 -28
- package/src/bin/add-story.ts +3 -3
- package/src/bin/copy-keycloak-resources-to-public.ts +3 -3
- package/src/bin/download-keycloak-default-theme.ts +5 -5
- package/src/bin/eject-page.ts +3 -3
- package/src/bin/initialize-email-theme.ts +5 -5
- package/src/bin/keycloakify/buildJars/buildJar.ts +14 -14
- package/src/bin/keycloakify/buildJars/buildJars.ts +8 -8
- package/src/bin/keycloakify/buildJars/generatePom.ts +9 -9
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +12 -12
- package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +7 -7
- package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +2 -66
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +9 -9
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +30 -24
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +8 -8
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +9 -9
- package/src/bin/keycloakify/keycloakify.ts +11 -11
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +6 -6
- package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +7 -7
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +10 -10
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +13 -13
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +11 -11
- package/src/bin/main.ts +17 -2
- package/src/bin/shared/{buildOptions.ts → buildContext.ts} +65 -51
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +12 -12
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +7 -7
- package/src/bin/shared/downloadKeycloakStaticResources.ts +7 -7
- package/src/bin/shared/generateKcGenTs.ts +61 -0
- package/src/bin/shared/getThemeSrcDirPath.ts +3 -3
- package/src/bin/start-keycloak/appBuild.ts +11 -11
- package/src/bin/start-keycloak/keycloakifyBuild.ts +7 -7
- package/src/bin/start-keycloak/start-keycloak.ts +34 -22
- package/src/bin/tools/escapeStringForPropertiesFile.ts +64 -0
- package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +3 -3
- package/src/bin/update-kc-gen.ts +13 -0
- package/src/lib/getKcClsx.ts +89 -0
- package/src/login/Fallback.tsx +2 -2
- package/src/login/KcContext/KcContext.ts +7 -7
- package/src/login/KcContext/getKcContextMock.ts +13 -24
- package/src/login/Template.tsx +36 -37
- package/src/login/TemplateProps.ts +1 -6
- package/src/login/UserProfileFormFields.tsx +67 -84
- package/src/login/i18n/i18n.tsx +208 -129
- package/src/login/i18n/index.ts +10 -2
- package/src/login/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
- package/src/login/lib/useUserProfileForm.tsx +29 -21
- package/src/login/pages/Code.tsx +10 -8
- package/src/login/pages/DeleteAccountConfirm.tsx +9 -10
- package/src/login/pages/DeleteCredential.tsx +11 -10
- package/src/login/pages/Error.tsx +5 -5
- package/src/login/pages/FrontchannelLogout.tsx +7 -5
- package/src/login/pages/IdpReviewUserProfile.tsx +18 -21
- package/src/login/pages/Info.tsx +7 -5
- package/src/login/pages/Login.tsx +34 -53
- package/src/login/pages/LoginConfigTotp.tsx +30 -38
- package/src/login/pages/LoginIdpLinkConfirm.tsx +10 -21
- package/src/login/pages/LoginIdpLinkEmail.tsx +5 -5
- package/src/login/pages/LoginOauth2DeviceVerifyUserCode.tsx +19 -24
- package/src/login/pages/LoginOauthGrant.tsx +14 -21
- package/src/login/pages/LoginOtp.tsx +29 -33
- package/src/login/pages/LoginPageExpired.tsx +5 -5
- package/src/login/pages/LoginPassword.tsx +23 -33
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +21 -25
- package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +21 -25
- package/src/login/pages/LoginResetOtp.tsx +21 -25
- package/src/login/pages/LoginResetPassword.tsx +21 -25
- package/src/login/pages/LoginUpdatePassword.tsx +42 -52
- package/src/login/pages/LoginUpdateProfile.tsx +29 -30
- package/src/login/pages/LoginUsername.tsx +23 -35
- package/src/login/pages/LoginVerifyEmail.tsx +7 -5
- package/src/login/pages/LoginX509Info.tsx +27 -36
- package/src/login/pages/LogoutConfirm.tsx +11 -17
- package/src/login/pages/PageProps.ts +2 -4
- package/src/login/pages/Register.tsx +27 -46
- package/src/login/pages/SamlPostForm.tsx +5 -5
- package/src/login/pages/SelectAuthenticator.tsx +24 -26
- package/src/login/pages/Terms.tsx +9 -16
- package/src/login/pages/UpdateEmail.tsx +29 -33
- package/src/login/pages/WebauthnAuthenticate.tsx +26 -32
- package/src/login/pages/WebauthnError.tsx +11 -22
- package/src/login/pages/WebauthnRegister.tsx +20 -28
- package/src/tools/clsx.ts +6 -48
- package/src/tools/clsx_withTransform.ts +55 -0
- package/src/vite-plugin/vite-plugin.ts +29 -21
- package/tools/clsx.d.ts +3 -2
- package/tools/clsx.js +5 -41
- package/tools/clsx.js.map +1 -1
- package/tools/clsx_withTransform.d.ts +5 -0
- package/tools/clsx_withTransform.js +43 -0
- package/tools/clsx_withTransform.js.map +1 -0
- package/vite-plugin/index.js +243 -102
- package/vite-plugin/vite-plugin.d.ts +3 -3
- package/account/lib/useGetClassName.d.ts +0 -7
- package/account/lib/useGetClassName.js.map +0 -1
- package/bin/795.index.js +0 -1197
- package/lib/isStorybook.d.ts +0 -1
- package/lib/isStorybook.js +0 -3
- package/lib/isStorybook.js.map +0 -1
- package/lib/useGetClassName.d.ts +0 -10
- package/lib/useGetClassName.js +0 -14
- package/lib/useGetClassName.js.map +0 -1
- package/login/lib/useGetClassName.d.ts +0 -7
- package/login/lib/useGetClassName.js.map +0 -1
- package/src/lib/isStorybook.ts +0 -3
- package/src/lib/useGetClassName.ts +0 -27
package/src/login/Template.tsx
CHANGED
@@ -2,14 +2,14 @@ import { useEffect } from "react";
|
|
2
2
|
import { assert } from "keycloakify/tools/assert";
|
3
3
|
import { clsx } from "keycloakify/tools/clsx";
|
4
4
|
import type { TemplateProps } from "keycloakify/login/TemplateProps";
|
5
|
-
import {
|
5
|
+
import { getKcClsx } from "keycloakify/login/lib/kcClsx";
|
6
6
|
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
|
7
7
|
import { useInsertLinkTags } from "keycloakify/tools/useInsertLinkTags";
|
8
8
|
import { useSetClassName } from "keycloakify/tools/useSetClassName";
|
9
9
|
import type { KcContext } from "./KcContext";
|
10
|
-
import
|
10
|
+
import { useI18n } from "./i18n";
|
11
11
|
|
12
|
-
export default function Template(props: TemplateProps<KcContext
|
12
|
+
export default function Template(props: TemplateProps<KcContext>) {
|
13
13
|
const {
|
14
14
|
displayInfo = false,
|
15
15
|
displayMessage = true,
|
@@ -21,15 +21,14 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
21
21
|
documentTitle,
|
22
22
|
bodyClassName,
|
23
23
|
kcContext,
|
24
|
-
i18n,
|
25
24
|
doUseDefaultCss,
|
26
25
|
classes,
|
27
26
|
children
|
28
27
|
} = props;
|
29
28
|
|
30
|
-
const {
|
29
|
+
const { kcClsx } = getKcClsx({ doUseDefaultCss, classes });
|
31
30
|
|
32
|
-
const { msg, msgStr, getChangeLocalUrl, labelBySupportedLanguageTag, currentLanguageTag } =
|
31
|
+
const { msg, msgStr, getChangeLocalUrl, labelBySupportedLanguageTag, currentLanguageTag } = useI18n({ kcContext });
|
33
32
|
|
34
33
|
const { realm, locale, auth, url, message, isAppInitiatedAction, authenticationSession, scripts } = kcContext;
|
35
34
|
|
@@ -39,12 +38,12 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
39
38
|
|
40
39
|
useSetClassName({
|
41
40
|
qualifiedName: "html",
|
42
|
-
className:
|
41
|
+
className: kcClsx("kcHtmlClass")
|
43
42
|
});
|
44
43
|
|
45
44
|
useSetClassName({
|
46
45
|
qualifiedName: "body",
|
47
|
-
className: bodyClassName ??
|
46
|
+
className: bodyClassName ?? kcClsx("kcBodyClass")
|
48
47
|
});
|
49
48
|
|
50
49
|
useEffect(() => {
|
@@ -116,19 +115,19 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
116
115
|
}
|
117
116
|
|
118
117
|
return (
|
119
|
-
<div className={
|
120
|
-
<div id="kc-header" className={
|
121
|
-
<div id="kc-header-wrapper" className={
|
118
|
+
<div className={kcClsx("kcLoginClass")}>
|
119
|
+
<div id="kc-header" className={kcClsx("kcHeaderClass")}>
|
120
|
+
<div id="kc-header-wrapper" className={kcClsx("kcHeaderWrapperClass")}>
|
122
121
|
{msg("loginTitleHtml", realm.displayNameHtml)}
|
123
122
|
</div>
|
124
123
|
</div>
|
125
124
|
|
126
|
-
<div className={
|
127
|
-
<header className={
|
125
|
+
<div className={kcClsx("kcFormCardClass")}>
|
126
|
+
<header className={kcClsx("kcFormHeaderClass")}>
|
128
127
|
{realm.internationalizationEnabled && (assert(locale !== undefined), locale.supported.length > 1) && (
|
129
|
-
<div className={
|
130
|
-
<div id="kc-locale-wrapper" className={
|
131
|
-
<div id="kc-locale-dropdown" className={clsx("menu-button-links",
|
128
|
+
<div className={kcClsx("kcLocaleMainClass")} id="kc-locale">
|
129
|
+
<div id="kc-locale-wrapper" className={kcClsx("kcLocaleWrapperClass")}>
|
130
|
+
<div id="kc-locale-dropdown" className={clsx("menu-button-links", kcClsx("kcLocaleDropDownClass"))}>
|
132
131
|
<button
|
133
132
|
tabIndex={1}
|
134
133
|
id="kc-current-locale-link"
|
@@ -145,14 +144,14 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
145
144
|
aria-labelledby="kc-current-locale-link"
|
146
145
|
aria-activedescendant=""
|
147
146
|
id="language-switch1"
|
148
|
-
className={
|
147
|
+
className={kcClsx("kcLocaleListClass")}
|
149
148
|
>
|
150
149
|
{locale.supported.map(({ languageTag }, i) => (
|
151
|
-
<li key={languageTag} className={
|
150
|
+
<li key={languageTag} className={kcClsx("kcLocaleListItemClass")} role="none">
|
152
151
|
<a
|
153
152
|
role="menuitem"
|
154
153
|
id={`language-${i + 1}`}
|
155
|
-
className={
|
154
|
+
className={kcClsx("kcLocaleItemClass")}
|
156
155
|
href={getChangeLocalUrl(languageTag)}
|
157
156
|
>
|
158
157
|
{labelBySupportedLanguageTag[languageTag]}
|
@@ -166,8 +165,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
166
165
|
)}
|
167
166
|
{!(auth !== undefined && auth.showUsername && !auth.showResetCredentials) ? (
|
168
167
|
displayRequiredFields ? (
|
169
|
-
<div className={
|
170
|
-
<div className={clsx(
|
168
|
+
<div className={kcClsx("kcContentWrapperClass")}>
|
169
|
+
<div className={clsx(kcClsx("kcLabelWrapperClass"), "subtitle")}>
|
171
170
|
<span className="subtitle">
|
172
171
|
<span className="required">*</span>
|
173
172
|
{msg("requiredFields")}
|
@@ -181,19 +180,19 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
181
180
|
<h1 id="kc-page-title">{headerNode}</h1>
|
182
181
|
)
|
183
182
|
) : displayRequiredFields ? (
|
184
|
-
<div className={
|
185
|
-
<div className={clsx(
|
183
|
+
<div className={kcClsx("kcContentWrapperClass")}>
|
184
|
+
<div className={clsx(kcClsx("kcLabelWrapperClass"), "subtitle")}>
|
186
185
|
<span className="subtitle">
|
187
186
|
<span className="required">*</span> {msg("requiredFields")}
|
188
187
|
</span>
|
189
188
|
</div>
|
190
189
|
<div className="col-md-10">
|
191
190
|
{showUsernameNode}
|
192
|
-
<div id="kc-username" className={
|
191
|
+
<div id="kc-username" className={kcClsx("kcFormGroupClass")}>
|
193
192
|
<label id="kc-attempted-username">{auth.attemptedUsername}</label>
|
194
193
|
<a id="reset-login" href={url.loginRestartFlowUrl} aria-label={msgStr("restartLoginTooltip")}>
|
195
194
|
<div className="kc-login-tooltip">
|
196
|
-
<i className={
|
195
|
+
<i className={kcClsx("kcResetFlowIcon")}></i>
|
197
196
|
<span className="kc-tooltip-text">{msg("restartLoginTooltip")}</span>
|
198
197
|
</div>
|
199
198
|
</a>
|
@@ -203,11 +202,11 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
203
202
|
) : (
|
204
203
|
<>
|
205
204
|
{showUsernameNode}
|
206
|
-
<div id="kc-username" className={
|
205
|
+
<div id="kc-username" className={kcClsx("kcFormGroupClass")}>
|
207
206
|
<label id="kc-attempted-username">{auth.attemptedUsername}</label>
|
208
207
|
<a id="reset-login" href={url.loginRestartFlowUrl} aria-label={msgStr("restartLoginTooltip")}>
|
209
208
|
<div className="kc-login-tooltip">
|
210
|
-
<i className={
|
209
|
+
<i className={kcClsx("kcResetFlowIcon")}></i>
|
211
210
|
<span className="kc-tooltip-text">{msg("restartLoginTooltip")}</span>
|
212
211
|
</div>
|
213
212
|
</a>
|
@@ -222,18 +221,18 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
222
221
|
<div
|
223
222
|
className={clsx(
|
224
223
|
`alert-${message.type}`,
|
225
|
-
|
224
|
+
kcClsx("kcAlertClass"),
|
226
225
|
`pf-m-${message?.type === "error" ? "danger" : message.type}`
|
227
226
|
)}
|
228
227
|
>
|
229
228
|
<div className="pf-c-alert__icon">
|
230
|
-
{message.type === "success" && <span className={
|
231
|
-
{message.type === "warning" && <span className={
|
232
|
-
{message.type === "error" && <span className={
|
233
|
-
{message.type === "info" && <span className={
|
229
|
+
{message.type === "success" && <span className={kcClsx("kcFeedbackSuccessIcon")}></span>}
|
230
|
+
{message.type === "warning" && <span className={kcClsx("kcFeedbackWarningIcon")}></span>}
|
231
|
+
{message.type === "error" && <span className={kcClsx("kcFeedbackErrorIcon")}></span>}
|
232
|
+
{message.type === "info" && <span className={kcClsx("kcFeedbackInfoIcon")}></span>}
|
234
233
|
</div>
|
235
234
|
<span
|
236
|
-
className={
|
235
|
+
className={kcClsx("kcAlertTitleClass")}
|
237
236
|
dangerouslySetInnerHTML={{
|
238
237
|
__html: message.summary
|
239
238
|
}}
|
@@ -243,8 +242,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
243
242
|
{children}
|
244
243
|
{auth !== undefined && auth.showTryAnotherWayLink && (
|
245
244
|
<form id="kc-select-try-another-way-form" action={url.loginAction} method="post">
|
246
|
-
<div className={
|
247
|
-
<div className={
|
245
|
+
<div className={kcClsx("kcFormGroupClass")}>
|
246
|
+
<div className={kcClsx("kcFormGroupClass")}>
|
248
247
|
<input type="hidden" name="tryAnotherWay" value="on" />
|
249
248
|
<a
|
250
249
|
href="#"
|
@@ -262,8 +261,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|
262
261
|
)}
|
263
262
|
{socialProvidersNode}
|
264
263
|
{displayInfo && (
|
265
|
-
<div id="kc-info" className={
|
266
|
-
<div id="kc-info-wrapper" className={
|
264
|
+
<div id="kc-info" className={kcClsx("kcSignUpClass")}>
|
265
|
+
<div id="kc-info-wrapper" className={kcClsx("kcInfoAreaWrapperClass")}>
|
267
266
|
{infoNode}
|
268
267
|
</div>
|
269
268
|
</div>
|
@@ -1,13 +1,8 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
import type { KcContext } from "./KcContext";
|
3
|
-
import type { I18n } from "./i18n";
|
4
3
|
|
5
|
-
export type TemplateProps<
|
6
|
-
KcContext extends KcContext.Common,
|
7
|
-
I18nExtended extends I18n
|
8
|
-
> = {
|
4
|
+
export type TemplateProps<KcContext extends KcContext.Common> = {
|
9
5
|
kcContext: KcContext;
|
10
|
-
i18n: I18nExtended;
|
11
6
|
doUseDefaultCss: boolean;
|
12
7
|
classes?: Partial<Record<ClassKey, string>>;
|
13
8
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useEffect, useReducer, Fragment } from "react";
|
2
2
|
import { assert } from "tsafe/assert";
|
3
|
-
import type {
|
3
|
+
import type { KcClsx } from "keycloakify/login/lib/kcClsx";
|
4
4
|
import {
|
5
5
|
useUserProfileForm,
|
6
6
|
getButtonToDisplayForMultivaluedAttributeField,
|
@@ -9,13 +9,13 @@ import {
|
|
9
9
|
type FormFieldError
|
10
10
|
} from "keycloakify/login/lib/useUserProfileForm";
|
11
11
|
import type { Attribute } from "keycloakify/login/KcContext";
|
12
|
-
import type
|
12
|
+
import { useI18n, type I18n } from "./i18n";
|
13
13
|
|
14
14
|
export type UserProfileFormFieldsProps = {
|
15
15
|
kcContext: KcContextLike;
|
16
|
-
|
17
|
-
getClassName: (classKey: ClassKey) => string;
|
16
|
+
kcClsx: KcClsx;
|
18
17
|
onIsFormSubmittableValueChange: (isFormSubmittable: boolean) => void;
|
18
|
+
doMakeUserConfirmPassword: boolean;
|
19
19
|
BeforeField?: (props: BeforeAfterFieldProps) => JSX.Element | null;
|
20
20
|
AfterField?: (props: BeforeAfterFieldProps) => JSX.Element | null;
|
21
21
|
};
|
@@ -24,24 +24,21 @@ type BeforeAfterFieldProps = {
|
|
24
24
|
attribute: Attribute;
|
25
25
|
dispatchFormAction: React.Dispatch<FormAction>;
|
26
26
|
displayableErrors: FormFieldError[];
|
27
|
-
i18n: I18n;
|
28
27
|
valueOrValues: string | string[];
|
28
|
+
kcClsx: KcClsx;
|
29
|
+
i18n: I18n;
|
29
30
|
};
|
30
31
|
|
31
|
-
// NOTE: Enabled by default but it's a UX best practice to set it to false.
|
32
|
-
const doMakeUserConfirmPassword = true;
|
33
|
-
|
34
32
|
export default function UserProfileFormFields(props: UserProfileFormFieldsProps) {
|
35
|
-
const { kcContext,
|
33
|
+
const { kcContext, kcClsx, onIsFormSubmittableValueChange, doMakeUserConfirmPassword, BeforeField, AfterField } = props;
|
36
34
|
|
37
|
-
const { advancedMsg } =
|
35
|
+
const { advancedMsg } = useI18n({ kcContext });
|
38
36
|
|
39
37
|
const {
|
40
38
|
formState: { formFieldStates, isFormSubmittable },
|
41
39
|
dispatchFormAction
|
42
40
|
} = useUserProfileForm({
|
43
41
|
kcContext,
|
44
|
-
i18n,
|
45
42
|
doMakeUserConfirmPassword
|
46
43
|
});
|
47
44
|
|
@@ -49,6 +46,8 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
|
|
49
46
|
onIsFormSubmittableValueChange(isFormSubmittable);
|
50
47
|
}, [isFormSubmittable]);
|
51
48
|
|
49
|
+
const i18n = useI18n({ kcContext });
|
50
|
+
|
52
51
|
const groupNameRef = { current: "" };
|
53
52
|
|
54
53
|
return (
|
@@ -56,32 +55,33 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
|
|
56
55
|
{formFieldStates.map(({ attribute, displayableErrors, valueOrValues }) => {
|
57
56
|
return (
|
58
57
|
<Fragment key={attribute.name}>
|
59
|
-
<GroupLabel attribute={attribute}
|
58
|
+
<GroupLabel attribute={attribute} groupNameRef={groupNameRef} i18n={i18n} kcClsx={kcClsx} />
|
60
59
|
{BeforeField !== undefined && (
|
61
60
|
<BeforeField
|
62
61
|
attribute={attribute}
|
63
62
|
dispatchFormAction={dispatchFormAction}
|
64
63
|
displayableErrors={displayableErrors}
|
65
|
-
i18n={i18n}
|
66
64
|
valueOrValues={valueOrValues}
|
65
|
+
kcClsx={kcClsx}
|
66
|
+
i18n={i18n}
|
67
67
|
/>
|
68
68
|
)}
|
69
69
|
<div
|
70
|
-
className={
|
70
|
+
className={kcClsx("kcFormGroupClass")}
|
71
71
|
style={{
|
72
72
|
display: attribute.name === "password-confirm" && !doMakeUserConfirmPassword ? "none" : undefined
|
73
73
|
}}
|
74
74
|
>
|
75
|
-
<div className={
|
76
|
-
<label htmlFor={attribute.name} className={
|
75
|
+
<div className={kcClsx("kcLabelWrapperClass")}>
|
76
|
+
<label htmlFor={attribute.name} className={kcClsx("kcLabelClass")}>
|
77
77
|
{advancedMsg(attribute.displayName ?? "")}
|
78
78
|
</label>
|
79
79
|
{attribute.required && <>*</>}
|
80
80
|
</div>
|
81
|
-
<div className={
|
81
|
+
<div className={kcClsx("kcInputWrapperClass")}>
|
82
82
|
{attribute.annotations.inputHelperTextBefore !== undefined && (
|
83
83
|
<div
|
84
|
-
className={
|
84
|
+
className={kcClsx("kcInputHelperTextBeforeClass")}
|
85
85
|
id={`form-help-text-before-${attribute.name}`}
|
86
86
|
aria-live="polite"
|
87
87
|
>
|
@@ -92,19 +92,14 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
|
|
92
92
|
attribute={attribute}
|
93
93
|
valueOrValues={valueOrValues}
|
94
94
|
displayableErrors={displayableErrors}
|
95
|
-
|
96
|
-
|
95
|
+
dispatchFormAction={dispatchFormAction}
|
96
|
+
kcClsx={kcClsx}
|
97
97
|
i18n={i18n}
|
98
98
|
/>
|
99
|
-
<FieldErrors
|
100
|
-
attribute={attribute}
|
101
|
-
getClassName={getClassName}
|
102
|
-
displayableErrors={displayableErrors}
|
103
|
-
fieldIndex={undefined}
|
104
|
-
/>
|
99
|
+
<FieldErrors attribute={attribute} displayableErrors={displayableErrors} kcClsx={kcClsx} fieldIndex={undefined} />
|
105
100
|
{attribute.annotations.inputHelperTextAfter !== undefined && (
|
106
101
|
<div
|
107
|
-
className={
|
102
|
+
className={kcClsx("kcInputHelperTextAfterClass")}
|
108
103
|
id={`form-help-text-after-${attribute.name}`}
|
109
104
|
aria-live="polite"
|
110
105
|
>
|
@@ -117,8 +112,9 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
|
|
117
112
|
attribute={attribute}
|
118
113
|
dispatchFormAction={dispatchFormAction}
|
119
114
|
displayableErrors={displayableErrors}
|
120
|
-
i18n={i18n}
|
121
115
|
valueOrValues={valueOrValues}
|
116
|
+
kcClsx={kcClsx}
|
117
|
+
i18n={i18n}
|
122
118
|
/>
|
123
119
|
)}
|
124
120
|
{/* NOTE: Downloading of html5DataAnnotations scripts is done in the useUserProfileForm hook */}
|
@@ -133,13 +129,13 @@ export default function UserProfileFormFields(props: UserProfileFormFieldsProps)
|
|
133
129
|
|
134
130
|
function GroupLabel(props: {
|
135
131
|
attribute: Attribute;
|
136
|
-
getClassName: UserProfileFormFieldsProps["getClassName"];
|
137
|
-
i18n: I18n;
|
138
132
|
groupNameRef: {
|
139
133
|
current: string;
|
140
134
|
};
|
135
|
+
i18n: I18n;
|
136
|
+
kcClsx: KcClsx;
|
141
137
|
}) {
|
142
|
-
const { attribute,
|
138
|
+
const { attribute, groupNameRef, i18n, kcClsx } = props;
|
143
139
|
|
144
140
|
const { advancedMsg } = i18n;
|
145
141
|
|
@@ -151,7 +147,7 @@ function GroupLabel(props: {
|
|
151
147
|
|
152
148
|
return (
|
153
149
|
<div
|
154
|
-
className={
|
150
|
+
className={kcClsx("kcFormGroupClass")}
|
155
151
|
{...Object.fromEntries(Object.entries(attribute.group.html5DataAnnotations).map(([key, value]) => [`data-${key}`, value]))}
|
156
152
|
>
|
157
153
|
{(() => {
|
@@ -159,8 +155,8 @@ function GroupLabel(props: {
|
|
159
155
|
const groupHeaderText = groupDisplayHeader !== "" ? advancedMsg(groupDisplayHeader) : attribute.group.name;
|
160
156
|
|
161
157
|
return (
|
162
|
-
<div className={
|
163
|
-
<label id={`header-${attribute.group.name}`} className={
|
158
|
+
<div className={kcClsx("kcContentWrapperClass")}>
|
159
|
+
<label id={`header-${attribute.group.name}`} className={kcClsx("kcFormGroupHeader")}>
|
164
160
|
{groupHeaderText}
|
165
161
|
</label>
|
166
162
|
</div>
|
@@ -173,8 +169,8 @@ function GroupLabel(props: {
|
|
173
169
|
const groupDescriptionText = advancedMsg(groupDisplayDescription);
|
174
170
|
|
175
171
|
return (
|
176
|
-
<div className={
|
177
|
-
<label id={`description-${attribute.group.name}`} className={
|
172
|
+
<div className={kcClsx("kcLabelWrapperClass")}>
|
173
|
+
<label id={`description-${attribute.group.name}`} className={kcClsx("kcLabelClass")}>
|
178
174
|
{groupDescriptionText}
|
179
175
|
</label>
|
180
176
|
</div>
|
@@ -191,13 +187,8 @@ function GroupLabel(props: {
|
|
191
187
|
return null;
|
192
188
|
}
|
193
189
|
|
194
|
-
function FieldErrors(props: {
|
195
|
-
attribute
|
196
|
-
getClassName: UserProfileFormFieldsProps["getClassName"];
|
197
|
-
displayableErrors: FormFieldError[];
|
198
|
-
fieldIndex: number | undefined;
|
199
|
-
}) {
|
200
|
-
const { attribute, getClassName, fieldIndex } = props;
|
190
|
+
function FieldErrors(props: { attribute: Attribute; displayableErrors: FormFieldError[]; fieldIndex: number | undefined; kcClsx: KcClsx }) {
|
191
|
+
const { attribute, fieldIndex, kcClsx } = props;
|
201
192
|
|
202
193
|
const displayableErrors = props.displayableErrors.filter(error => error.fieldIndex === fieldIndex);
|
203
194
|
|
@@ -208,7 +199,7 @@ function FieldErrors(props: {
|
|
208
199
|
return (
|
209
200
|
<span
|
210
201
|
id={`input-error-${attribute.name}${fieldIndex === undefined ? "" : `-${fieldIndex}`}`}
|
211
|
-
className={
|
202
|
+
className={kcClsx("kcInputErrorMessageClass")}
|
212
203
|
aria-live="polite"
|
213
204
|
>
|
214
205
|
{displayableErrors
|
@@ -227,9 +218,9 @@ type InputFiledByTypeProps = {
|
|
227
218
|
attribute: Attribute;
|
228
219
|
valueOrValues: string | string[];
|
229
220
|
displayableErrors: FormFieldError[];
|
230
|
-
|
231
|
-
getClassName: UserProfileFormFieldsProps["getClassName"];
|
221
|
+
dispatchFormAction: React.Dispatch<FormAction>;
|
232
222
|
i18n: I18n;
|
223
|
+
kcClsx: KcClsx;
|
233
224
|
};
|
234
225
|
|
235
226
|
function InputFiledByType(props: InputFiledByTypeProps) {
|
@@ -259,7 +250,7 @@ function InputFiledByType(props: InputFiledByTypeProps) {
|
|
259
250
|
|
260
251
|
if (attribute.name === "password" || attribute.name === "password-confirm") {
|
261
252
|
return (
|
262
|
-
<PasswordWrapper
|
253
|
+
<PasswordWrapper kcClsx={props.kcClsx} i18n={props.i18n} passwordInputId={attribute.name}>
|
263
254
|
{inputNode}
|
264
255
|
</PasswordWrapper>
|
265
256
|
);
|
@@ -270,8 +261,8 @@ function InputFiledByType(props: InputFiledByTypeProps) {
|
|
270
261
|
}
|
271
262
|
}
|
272
263
|
|
273
|
-
function PasswordWrapper(props: {
|
274
|
-
const {
|
264
|
+
function PasswordWrapper(props: { kcClsx: KcClsx; i18n: I18n; passwordInputId: string; children: JSX.Element }) {
|
265
|
+
const { kcClsx, i18n, passwordInputId, children } = props;
|
275
266
|
|
276
267
|
const { msgStr } = i18n;
|
277
268
|
|
@@ -286,26 +277,23 @@ function PasswordWrapper(props: { getClassName: (classKey: ClassKey) => string;
|
|
286
277
|
}, [isPasswordRevealed]);
|
287
278
|
|
288
279
|
return (
|
289
|
-
<div className={
|
280
|
+
<div className={kcClsx("kcInputGroup")}>
|
290
281
|
{children}
|
291
282
|
<button
|
292
283
|
type="button"
|
293
|
-
className={
|
284
|
+
className={kcClsx("kcFormPasswordVisibilityButtonClass")}
|
294
285
|
aria-label={msgStr(isPasswordRevealed ? "hidePassword" : "showPassword")}
|
295
286
|
aria-controls={passwordInputId}
|
296
287
|
onClick={toggleIsPasswordRevealed}
|
297
288
|
>
|
298
|
-
<i
|
299
|
-
className={getClassName(isPasswordRevealed ? "kcFormPasswordVisibilityIconHide" : "kcFormPasswordVisibilityIconShow")}
|
300
|
-
aria-hidden
|
301
|
-
/>
|
289
|
+
<i className={kcClsx(isPasswordRevealed ? "kcFormPasswordVisibilityIconHide" : "kcFormPasswordVisibilityIconShow")} aria-hidden />
|
302
290
|
</button>
|
303
291
|
</div>
|
304
292
|
);
|
305
293
|
}
|
306
294
|
|
307
295
|
function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefined }) {
|
308
|
-
const { attribute, fieldIndex,
|
296
|
+
const { attribute, fieldIndex, kcClsx, dispatchFormAction, valueOrValues, i18n, displayableErrors } = props;
|
309
297
|
|
310
298
|
return (
|
311
299
|
<>
|
@@ -331,7 +319,7 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
|
|
331
319
|
|
332
320
|
return valueOrValues;
|
333
321
|
})()}
|
334
|
-
className={
|
322
|
+
className={kcClsx("kcInputClass")}
|
335
323
|
aria-invalid={displayableErrors.find(error => error.fieldIndex === fieldIndex) !== undefined}
|
336
324
|
disabled={attribute.readOnly}
|
337
325
|
autoComplete={attribute.autocomplete}
|
@@ -349,7 +337,7 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
|
|
349
337
|
step={attribute.annotations.inputTypeStep}
|
350
338
|
{...Object.fromEntries(Object.entries(attribute.html5DataAnnotations ?? {}).map(([key, value]) => [`data-${key}`, value]))}
|
351
339
|
onChange={event =>
|
352
|
-
|
340
|
+
dispatchFormAction({
|
353
341
|
action: "update",
|
354
342
|
name: attribute.name,
|
355
343
|
valueOrValues: (() => {
|
@@ -370,7 +358,7 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
|
|
370
358
|
})
|
371
359
|
}
|
372
360
|
onBlur={() =>
|
373
|
-
|
361
|
+
dispatchFormAction({
|
374
362
|
action: "focus lost",
|
375
363
|
name: attribute.name,
|
376
364
|
fieldIndex: fieldIndex
|
@@ -388,17 +376,12 @@ function InputTag(props: InputFiledByTypeProps & { fieldIndex: number | undefine
|
|
388
376
|
|
389
377
|
return (
|
390
378
|
<>
|
391
|
-
<FieldErrors
|
392
|
-
attribute={attribute}
|
393
|
-
getClassName={getClassName}
|
394
|
-
displayableErrors={displayableErrors}
|
395
|
-
fieldIndex={fieldIndex}
|
396
|
-
/>
|
379
|
+
<FieldErrors attribute={attribute} kcClsx={kcClsx} displayableErrors={displayableErrors} fieldIndex={fieldIndex} />
|
397
380
|
<AddRemoveButtonsMultiValuedAttribute
|
398
381
|
attribute={attribute}
|
399
382
|
values={values}
|
400
383
|
fieldIndex={fieldIndex}
|
401
|
-
dispatchFormAction={
|
384
|
+
dispatchFormAction={dispatchFormAction}
|
402
385
|
i18n={i18n}
|
403
386
|
/>
|
404
387
|
</>
|
@@ -465,7 +448,7 @@ function AddRemoveButtonsMultiValuedAttribute(props: {
|
|
465
448
|
}
|
466
449
|
|
467
450
|
function InputTagSelects(props: InputFiledByTypeProps) {
|
468
|
-
const { attribute,
|
451
|
+
const { attribute, dispatchFormAction, kcClsx, valueOrValues } = props;
|
469
452
|
|
470
453
|
const { advancedMsg } = props.i18n;
|
471
454
|
|
@@ -478,16 +461,16 @@ function InputTagSelects(props: InputFiledByTypeProps) {
|
|
478
461
|
case "select-radiobuttons":
|
479
462
|
return {
|
480
463
|
inputType: "radio",
|
481
|
-
classDiv:
|
482
|
-
classInput:
|
483
|
-
classLabel:
|
464
|
+
classDiv: kcClsx("kcInputClassRadio"),
|
465
|
+
classInput: kcClsx("kcInputClassRadioInput"),
|
466
|
+
classLabel: kcClsx("kcInputClassRadioLabel")
|
484
467
|
};
|
485
468
|
case "multiselect-checkboxes":
|
486
469
|
return {
|
487
470
|
inputType: "checkbox",
|
488
|
-
classDiv:
|
489
|
-
classInput:
|
490
|
-
classLabel:
|
471
|
+
classDiv: kcClsx("kcInputClassCheckbox"),
|
472
|
+
classInput: kcClsx("kcInputClassCheckboxInput"),
|
473
|
+
classLabel: kcClsx("kcInputClassCheckboxLabel")
|
491
474
|
};
|
492
475
|
}
|
493
476
|
})();
|
@@ -530,7 +513,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
|
|
530
513
|
disabled={attribute.readOnly}
|
531
514
|
checked={valueOrValues instanceof Array ? valueOrValues.includes(option) : valueOrValues === option}
|
532
515
|
onChange={event =>
|
533
|
-
|
516
|
+
dispatchFormAction({
|
534
517
|
action: "update",
|
535
518
|
name: attribute.name,
|
536
519
|
valueOrValues: (() => {
|
@@ -553,7 +536,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
|
|
553
536
|
})
|
554
537
|
}
|
555
538
|
onBlur={() =>
|
556
|
-
|
539
|
+
dispatchFormAction({
|
557
540
|
action: "focus lost",
|
558
541
|
name: attribute.name,
|
559
542
|
fieldIndex: undefined
|
@@ -562,7 +545,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
|
|
562
545
|
/>
|
563
546
|
<label
|
564
547
|
htmlFor={`${attribute.name}-${option}`}
|
565
|
-
className={`${classLabel}${attribute.readOnly ? ` ${
|
548
|
+
className={`${classLabel}${attribute.readOnly ? ` ${kcClsx("kcInputClassRadioCheckboxLabelDisabled")}` : ""}`}
|
566
549
|
>
|
567
550
|
{advancedMsg(option)}
|
568
551
|
</label>
|
@@ -573,7 +556,7 @@ function InputTagSelects(props: InputFiledByTypeProps) {
|
|
573
556
|
}
|
574
557
|
|
575
558
|
function TextareaTag(props: InputFiledByTypeProps) {
|
576
|
-
const { attribute,
|
559
|
+
const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues } = props;
|
577
560
|
|
578
561
|
assert(typeof valueOrValues === "string");
|
579
562
|
|
@@ -583,7 +566,7 @@ function TextareaTag(props: InputFiledByTypeProps) {
|
|
583
566
|
<textarea
|
584
567
|
id={attribute.name}
|
585
568
|
name={attribute.name}
|
586
|
-
className={
|
569
|
+
className={kcClsx("kcInputClass")}
|
587
570
|
aria-invalid={displayableErrors.length !== 0}
|
588
571
|
disabled={attribute.readOnly}
|
589
572
|
cols={attribute.annotations.inputTypeCols === undefined ? undefined : parseInt(`${attribute.annotations.inputTypeCols}`)}
|
@@ -591,14 +574,14 @@ function TextareaTag(props: InputFiledByTypeProps) {
|
|
591
574
|
maxLength={attribute.annotations.inputTypeMaxlength === undefined ? undefined : parseInt(`${attribute.annotations.inputTypeMaxlength}`)}
|
592
575
|
value={value}
|
593
576
|
onChange={event =>
|
594
|
-
|
577
|
+
dispatchFormAction({
|
595
578
|
action: "update",
|
596
579
|
name: attribute.name,
|
597
580
|
valueOrValues: event.target.value
|
598
581
|
})
|
599
582
|
}
|
600
583
|
onBlur={() =>
|
601
|
-
|
584
|
+
dispatchFormAction({
|
602
585
|
action: "focus lost",
|
603
586
|
name: attribute.name,
|
604
587
|
fieldIndex: undefined
|
@@ -609,7 +592,7 @@ function TextareaTag(props: InputFiledByTypeProps) {
|
|
609
592
|
}
|
610
593
|
|
611
594
|
function SelectTag(props: InputFiledByTypeProps) {
|
612
|
-
const { attribute,
|
595
|
+
const { attribute, dispatchFormAction, kcClsx, displayableErrors, i18n, valueOrValues } = props;
|
613
596
|
|
614
597
|
const { advancedMsg } = i18n;
|
615
598
|
|
@@ -619,14 +602,14 @@ function SelectTag(props: InputFiledByTypeProps) {
|
|
619
602
|
<select
|
620
603
|
id={attribute.name}
|
621
604
|
name={attribute.name}
|
622
|
-
className={
|
605
|
+
className={kcClsx("kcInputClass")}
|
623
606
|
aria-invalid={displayableErrors.length !== 0}
|
624
607
|
disabled={attribute.readOnly}
|
625
608
|
multiple={isMultiple}
|
626
609
|
size={attribute.annotations.inputTypeSize === undefined ? undefined : parseInt(`${attribute.annotations.inputTypeSize}`)}
|
627
610
|
value={valueOrValues}
|
628
611
|
onChange={event =>
|
629
|
-
|
612
|
+
dispatchFormAction({
|
630
613
|
action: "update",
|
631
614
|
name: attribute.name,
|
632
615
|
valueOrValues: (() => {
|
@@ -639,7 +622,7 @@ function SelectTag(props: InputFiledByTypeProps) {
|
|
639
622
|
})
|
640
623
|
}
|
641
624
|
onBlur={() =>
|
642
|
-
|
625
|
+
dispatchFormAction({
|
643
626
|
action: "focus lost",
|
644
627
|
name: attribute.name,
|
645
628
|
fieldIndex: undefined
|