@keycloakify/angular 0.2.17 → 0.2.19

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 (105) hide show
  1. package/README.md +0 -2
  2. package/account/pages/federatedIdentity/federatedIdentity.component.d.ts +1 -1
  3. package/bin/279.index.js +33 -10
  4. package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs +3 -7
  5. package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs.map +1 -1
  6. package/fesm2022/keycloakify-angular-account-pages-account.mjs +3 -3
  7. package/fesm2022/keycloakify-angular-account-pages-applications.mjs +3 -3
  8. package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs +4 -4
  9. package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs.map +1 -1
  10. package/fesm2022/keycloakify-angular-account-pages-log.mjs +3 -3
  11. package/fesm2022/keycloakify-angular-account-pages-password.mjs +3 -3
  12. package/fesm2022/keycloakify-angular-account-pages-sessions.mjs +3 -3
  13. package/fesm2022/keycloakify-angular-account-pages-totp.mjs +3 -3
  14. package/fesm2022/keycloakify-angular-account-services-account-resource-injector.mjs +3 -3
  15. package/fesm2022/keycloakify-angular-account-services-i18n.mjs +3 -3
  16. package/fesm2022/keycloakify-angular-account-template.mjs +3 -3
  17. package/fesm2022/keycloakify-angular-account-template.mjs.map +1 -1
  18. package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs +3 -3
  19. package/fesm2022/keycloakify-angular-lib-pipes-input-type.mjs +3 -3
  20. package/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs +3 -3
  21. package/fesm2022/keycloakify-angular-lib-pipes-kc-sanitize.mjs +3 -3
  22. package/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs +3 -3
  23. package/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs +3 -3
  24. package/fesm2022/keycloakify-angular-lib-services-resource-injector.mjs +3 -3
  25. package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs +3 -3
  26. package/fesm2022/keycloakify-angular-login-components-field-errors.mjs +3 -3
  27. package/fesm2022/keycloakify-angular-login-components-group-label.mjs +3 -3
  28. package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs +3 -3
  29. package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs +3 -3
  30. package/fesm2022/keycloakify-angular-login-components-input-tag.mjs +3 -3
  31. package/fesm2022/keycloakify-angular-login-components-logout-other-sessions.mjs +3 -3
  32. package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs +3 -3
  33. package/fesm2022/keycloakify-angular-login-components-select-tag.mjs +3 -3
  34. package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs +3 -3
  35. package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs +7 -5
  36. package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs.map +1 -1
  37. package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs +3 -7
  38. package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs.map +1 -1
  39. package/fesm2022/keycloakify-angular-login-pages-code.mjs +3 -3
  40. package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs +3 -3
  41. package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs +3 -3
  42. package/fesm2022/keycloakify-angular-login-pages-error.mjs +3 -3
  43. package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs +3 -3
  44. package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs +4 -4
  45. package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs.map +1 -1
  46. package/fesm2022/keycloakify-angular-login-pages-info.mjs +3 -3
  47. package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs +4 -4
  48. package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs.map +1 -1
  49. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs +4 -4
  50. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs.map +1 -1
  51. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs +4 -4
  52. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs.map +1 -1
  53. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs +3 -3
  54. package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs +3 -3
  55. package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs +3 -3
  56. package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs +3 -3
  57. package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs +3 -3
  58. package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs +3 -3
  59. package/fesm2022/keycloakify-angular-login-pages-login-password.mjs +3 -3
  60. package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs +3 -3
  61. package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs +3 -3
  62. package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs +3 -3
  63. package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs +3 -3
  64. package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs +4 -4
  65. package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs.map +1 -1
  66. package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs +3 -3
  67. package/fesm2022/keycloakify-angular-login-pages-login-username.mjs +4 -4
  68. package/fesm2022/keycloakify-angular-login-pages-login-username.mjs.map +1 -1
  69. package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs +3 -3
  70. package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs +3 -3
  71. package/fesm2022/keycloakify-angular-login-pages-login.mjs +4 -4
  72. package/fesm2022/keycloakify-angular-login-pages-login.mjs.map +1 -1
  73. package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs +3 -3
  74. package/fesm2022/keycloakify-angular-login-pages-register.mjs +4 -4
  75. package/fesm2022/keycloakify-angular-login-pages-register.mjs.map +1 -1
  76. package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs +3 -3
  77. package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs +3 -3
  78. package/fesm2022/keycloakify-angular-login-pages-terms.mjs +3 -3
  79. package/fesm2022/keycloakify-angular-login-pages-update-email.mjs +3 -3
  80. package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs +3 -3
  81. package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs +3 -3
  82. package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs +3 -3
  83. package/fesm2022/keycloakify-angular-login-services-i18n.mjs +3 -3
  84. package/fesm2022/keycloakify-angular-login-services-login-resource-injector.mjs +3 -3
  85. package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs +4 -4
  86. package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs.map +1 -1
  87. package/fesm2022/keycloakify-angular-login-template.mjs +3 -3
  88. package/login/components/user-profile-form-fields/user-profile-form-fields.component.d.ts +1 -0
  89. package/package.json +1 -1
  90. package/src/account/directives/kc-class/kc-class.directive.ts +2 -4
  91. package/src/account/pages/federatedIdentity/federatedIdentity.component.ts +1 -1
  92. package/src/account/template/template.component.ts +1 -3
  93. package/src/eslint.config.js +5 -0
  94. package/src/login/components/user-profile-form-fields/user-profile-form-fields.component.html +9 -0
  95. package/src/login/components/user-profile-form-fields/user-profile-form-fields.component.ts +2 -0
  96. package/src/login/directives/kc-class/kc-class.directive.ts +2 -4
  97. package/src/login/pages/idp-review-user-profile/idp-review-user-profile.component.ts +1 -1
  98. package/src/login/pages/login/login.component.ts +1 -1
  99. package/src/login/pages/login-config-totp/login-config-totp.component.ts +1 -1
  100. package/src/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.ts +1 -1
  101. package/src/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.ts +1 -1
  102. package/src/login/pages/login-update-password/login-update-password.component.ts +1 -1
  103. package/src/login/pages/login-username/login-username.component.ts +1 -1
  104. package/src/login/pages/register/register.component.ts +1 -1
  105. package/src/login/services/user-profile-form/user-profile-form.service.ts +1 -1
@@ -3,10 +3,10 @@ import { Injectable } from '@angular/core';
3
3
 
4
4
  /** INTERNAL: DO NOT IMPORT THIS */
5
5
  class I18nService {
6
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: I18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: I18nService, providedIn: 'root' }); }
6
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: I18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: I18nService, providedIn: 'root' }); }
8
8
  }
9
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: I18nService, decorators: [{
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: I18nService, decorators: [{
10
10
  type: Injectable,
11
11
  args: [{ providedIn: 'root' }]
12
12
  }] });
@@ -58,10 +58,10 @@ class LoginResourceInjectorService {
58
58
  ];
59
59
  this.insertAdditionalScripts(scripts);
60
60
  }
61
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LoginResourceInjectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
62
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LoginResourceInjectorService, providedIn: 'root' }); }
61
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LoginResourceInjectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
62
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LoginResourceInjectorService, providedIn: 'root' }); }
63
63
  }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LoginResourceInjectorService, decorators: [{
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LoginResourceInjectorService, decorators: [{
65
65
  type: Injectable,
66
66
  args: [{
67
67
  providedIn: 'root'
@@ -46,7 +46,7 @@ class UserProfileFormService {
46
46
  formFieldStates: formState_reactless.formFieldStates.map(formFieldState_reactless => ({
47
47
  attribute: formFieldState_reactless.attribute,
48
48
  valueOrValues: formFieldState_reactless.valueOrValues,
49
- displayableErrors: formFieldState_reactless.displayableErrors.map((formFieldError_reactless, i) => ({
49
+ displayableErrors: formFieldState_reactless.displayableErrors.map(formFieldError_reactless => ({
50
50
  errorMessage: this.#domSanitizer.bypassSecurityTrustHtml(this.#i18n.advancedMsgStr(...formFieldError_reactless.advancedMsgArgs)),
51
51
  errorMessageStr: this.#i18n.advancedMsgStr(...formFieldError_reactless.advancedMsgArgs),
52
52
  source: formFieldError_reactless.source,
@@ -62,10 +62,10 @@ class UserProfileFormService {
62
62
  if (this.#unsubscribe)
63
63
  this.#unsubscribe();
64
64
  }
65
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: UserProfileFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
66
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: UserProfileFormService, providedIn: 'root' }); }
65
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserProfileFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
66
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserProfileFormService, providedIn: 'root' }); }
67
67
  }
68
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: UserProfileFormService, decorators: [{
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserProfileFormService, decorators: [{
69
69
  type: Injectable,
70
70
  args: [{ providedIn: 'root' }]
71
71
  }], ctorParameters: () => [] });
@@ -1 +1 @@
1
- {"version":3,"file":"keycloakify-angular-login-services-user-profile-form.mjs","sources":["../../src/login/services/user-profile-form/user-profile-form.service.ts","../../src/login/services/user-profile-form/keycloakify-angular-login-services-user-profile-form.ts"],"sourcesContent":["import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context';\nimport { DO_MAKE_USER_CONFIRM_PASSWORD } from '@keycloakify/angular/login/tokens/make-user-confirm-password';\nimport type {\n Attribute,\n PasswordPolicies,\n Validators\n} from 'keycloakify/login/KcContext';\nimport * as reactlessApi from 'keycloakify/login/lib/getUserProfileApi';\nimport { BehaviorSubject, map, Observable } from 'rxjs';\nimport { assert, type Equals } from 'tsafe/assert';\n\nexport { getButtonToDisplayForMultivaluedAttributeField } from 'keycloakify/login/lib/getUserProfileApi';\n\nexport type FormFieldError = {\n errorMessage: SafeHtml;\n errorMessageStr: string;\n source: FormFieldError.Source;\n fieldIndex: number | undefined;\n};\n\n{\n type A = Omit<FormFieldError, 'errorMessage' | 'errorMessageStr'>;\n type B = Omit<reactlessApi.FormFieldError, 'advancedMsgArgs'>;\n\n assert<Equals<A, B>>();\n}\n\nexport namespace FormFieldError {\n export type Source =\n | Source.Validator\n | Source.PasswordPolicy\n | Source.Server\n | Source.Other;\n\n export namespace Source {\n export type Validator = {\n type: 'validator';\n name: keyof Validators;\n };\n export type PasswordPolicy = {\n type: 'passwordPolicy';\n name: keyof PasswordPolicies;\n };\n export type Server = {\n type: 'server';\n };\n\n export type Other = {\n type: 'other';\n rule: 'passwordConfirmMatchesPassword' | 'requiredField';\n };\n }\n}\n\n{\n type A = FormFieldError.Source;\n type B = reactlessApi.FormFieldError.Source;\n\n assert<Equals<A, B>>();\n}\n\nexport type FormFieldState = {\n attribute: Attribute;\n displayableErrors: FormFieldError[];\n valueOrValues: string | string[];\n};\n\n{\n type A = Omit<FormFieldState, 'displayableErrors'>;\n type B = Omit<reactlessApi.FormFieldState, 'displayableErrors'>;\n\n assert<Equals<A, B>>();\n}\n\nexport type FormState = {\n isFormSubmittable: boolean;\n formFieldStates: FormFieldState[];\n};\n\n{\n type A = Omit<FormState, 'formFieldStates'>;\n type B = Omit<FormState, 'formFieldStates'>;\n\n assert<Equals<A, B>>();\n}\n\nexport type FormAction =\n | {\n action: 'update';\n name: string;\n valueOrValues: string | string[];\n /** Default false */\n displayErrorsImmediately?: boolean;\n }\n | {\n action: 'focus lost';\n name: string;\n fieldIndex: number | undefined;\n };\n\n{\n type A = FormAction;\n type B = reactlessApi.FormAction;\n\n assert<Equals<A, B>>();\n}\n\nexport type KcContextLike = reactlessApi.KcContextLike;\n\nexport type I18nLike = Pick<I18n, 'advancedMsgStr'>;\n\n@Injectable({ providedIn: 'root' })\nexport class UserProfileFormService implements OnDestroy {\n #kcContext = inject<KcContextLike>(KC_LOGIN_CONTEXT);\n #i18n = inject<I18nLike>(LOGIN_I18N);\n #doMakeUserConfirmPassword = inject(DO_MAKE_USER_CONFIRM_PASSWORD);\n #domSanitizer = inject(DomSanitizer);\n #internal_formState$: BehaviorSubject<reactlessApi.FormState>;\n #unsubscribe: (() => void) | undefined;\n public formState$: Observable<FormState>;\n public dispatchFormAction: (action: FormAction) => void;\n constructor() {\n const api = reactlessApi.getUserProfileApi({\n kcContext: this.#kcContext,\n doMakeUserConfirmPassword: this.#doMakeUserConfirmPassword\n });\n this.#internal_formState$ = new BehaviorSubject<reactlessApi.FormState>(\n api.getFormState()\n );\n this.#unsubscribe = api.subscribeToFormState(() => {\n this.#internal_formState$.next(api.getFormState());\n }).unsubscribe;\n this.formState$ = this.#internal_formState$.asObservable().pipe(\n takeUntilDestroyed(),\n map(formState_reactless => ({\n isFormSubmittable: formState_reactless.isFormSubmittable,\n formFieldStates: formState_reactless.formFieldStates.map(\n formFieldState_reactless => ({\n attribute: formFieldState_reactless.attribute,\n valueOrValues: formFieldState_reactless.valueOrValues,\n displayableErrors: formFieldState_reactless.displayableErrors.map(\n (formFieldError_reactless, i) => ({\n errorMessage: this.#domSanitizer.bypassSecurityTrustHtml(\n this.#i18n.advancedMsgStr(\n ...formFieldError_reactless.advancedMsgArgs\n )\n ),\n errorMessageStr: this.#i18n.advancedMsgStr(\n ...formFieldError_reactless.advancedMsgArgs\n ),\n source: formFieldError_reactless.source,\n fieldIndex: formFieldError_reactless.fieldIndex\n })\n )\n })\n )\n }))\n );\n this.dispatchFormAction = api.dispatchFormAction;\n }\n\n ngOnDestroy(): void {\n this.#internal_formState$.complete();\n this.#internal_formState$.unsubscribe();\n if (this.#unsubscribe) this.#unsubscribe();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAyBA;AAII,IAAA,MAAM,EAAgB;AAC1B;AA6BA;AAII,IAAA,MAAM,EAAgB;AAC1B;AAQA;AAII,IAAA,MAAM,EAAgB;AAC1B;AAOA;AAII,IAAA,MAAM,EAAgB;AAC1B;AAgBA;AAII,IAAA,MAAM,EAAgB;AAC1B;MAOa,sBAAsB,CAAA;AAC/B,IAAA,UAAU,GAAG,MAAM,CAAgB,gBAAgB,CAAC;AACpD,IAAA,KAAK,GAAG,MAAM,CAAW,UAAU,CAAC;AACpC,IAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,oBAAoB;AACpB,IAAA,YAAY;AAGZ,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,GAAG,GAAG,YAAY,CAAC,iBAAiB,CAAC;YACvC,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,yBAAyB,EAAE,IAAI,CAAC;AACnC,SAAA,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,IAAI,eAAe,CAC3C,GAAG,CAAC,YAAY,EAAE,CACrB;QACD,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,oBAAoB,CAAC,MAAK;YAC9C,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;SACrD,CAAC,CAAC,WAAW;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,IAAI,CAC3D,kBAAkB,EAAE,EACpB,GAAG,CAAC,mBAAmB,KAAK;YACxB,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB;YACxD,eAAe,EAAE,mBAAmB,CAAC,eAAe,CAAC,GAAG,CACpD,wBAAwB,KAAK;gBACzB,SAAS,EAAE,wBAAwB,CAAC,SAAS;gBAC7C,aAAa,EAAE,wBAAwB,CAAC,aAAa;AACrD,gBAAA,iBAAiB,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,GAAG,CAC7D,CAAC,wBAAwB,EAAE,CAAC,MAAM;AAC9B,oBAAA,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CACpD,IAAI,CAAC,KAAK,CAAC,cAAc,CACrB,GAAG,wBAAwB,CAAC,eAAe,CAC9C,CACJ;oBACD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CACtC,GAAG,wBAAwB,CAAC,eAAe,CAC9C;oBACD,MAAM,EAAE,wBAAwB,CAAC,MAAM;oBACvC,UAAU,EAAE,wBAAwB,CAAC;AACxC,iBAAA,CAAC;AAET,aAAA,CAAC;SAET,CAAC,CAAC,CACN;AACD,QAAA,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC,kBAAkB;;IAGpD,WAAW,GAAA;AACP,QAAA,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE;AACpC,QAAA,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE;QACvC,IAAI,IAAI,CAAC,YAAY;YAAE,IAAI,CAAC,YAAY,EAAE;;8GApDrC,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpHlC;;AAEG;;;;"}
1
+ {"version":3,"file":"keycloakify-angular-login-services-user-profile-form.mjs","sources":["../../src/login/services/user-profile-form/user-profile-form.service.ts","../../src/login/services/user-profile-form/keycloakify-angular-login-services-user-profile-form.ts"],"sourcesContent":["import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context';\nimport { DO_MAKE_USER_CONFIRM_PASSWORD } from '@keycloakify/angular/login/tokens/make-user-confirm-password';\nimport type {\n Attribute,\n PasswordPolicies,\n Validators\n} from 'keycloakify/login/KcContext';\nimport * as reactlessApi from 'keycloakify/login/lib/getUserProfileApi';\nimport { BehaviorSubject, map, Observable } from 'rxjs';\nimport { assert, type Equals } from 'tsafe/assert';\n\nexport { getButtonToDisplayForMultivaluedAttributeField } from 'keycloakify/login/lib/getUserProfileApi';\n\nexport type FormFieldError = {\n errorMessage: SafeHtml;\n errorMessageStr: string;\n source: FormFieldError.Source;\n fieldIndex: number | undefined;\n};\n\n{\n type A = Omit<FormFieldError, 'errorMessage' | 'errorMessageStr'>;\n type B = Omit<reactlessApi.FormFieldError, 'advancedMsgArgs'>;\n\n assert<Equals<A, B>>();\n}\n\nexport namespace FormFieldError {\n export type Source =\n | Source.Validator\n | Source.PasswordPolicy\n | Source.Server\n | Source.Other;\n\n export namespace Source {\n export type Validator = {\n type: 'validator';\n name: keyof Validators;\n };\n export type PasswordPolicy = {\n type: 'passwordPolicy';\n name: keyof PasswordPolicies;\n };\n export type Server = {\n type: 'server';\n };\n\n export type Other = {\n type: 'other';\n rule: 'passwordConfirmMatchesPassword' | 'requiredField';\n };\n }\n}\n\n{\n type A = FormFieldError.Source;\n type B = reactlessApi.FormFieldError.Source;\n\n assert<Equals<A, B>>();\n}\n\nexport type FormFieldState = {\n attribute: Attribute;\n displayableErrors: FormFieldError[];\n valueOrValues: string | string[];\n};\n\n{\n type A = Omit<FormFieldState, 'displayableErrors'>;\n type B = Omit<reactlessApi.FormFieldState, 'displayableErrors'>;\n\n assert<Equals<A, B>>();\n}\n\nexport type FormState = {\n isFormSubmittable: boolean;\n formFieldStates: FormFieldState[];\n};\n\n{\n type A = Omit<FormState, 'formFieldStates'>;\n type B = Omit<FormState, 'formFieldStates'>;\n\n assert<Equals<A, B>>();\n}\n\nexport type FormAction =\n | {\n action: 'update';\n name: string;\n valueOrValues: string | string[];\n /** Default false */\n displayErrorsImmediately?: boolean;\n }\n | {\n action: 'focus lost';\n name: string;\n fieldIndex: number | undefined;\n };\n\n{\n type A = FormAction;\n type B = reactlessApi.FormAction;\n\n assert<Equals<A, B>>();\n}\n\nexport type KcContextLike = reactlessApi.KcContextLike;\n\nexport type I18nLike = Pick<I18n, 'advancedMsgStr'>;\n\n@Injectable({ providedIn: 'root' })\nexport class UserProfileFormService implements OnDestroy {\n #kcContext = inject<KcContextLike>(KC_LOGIN_CONTEXT);\n #i18n = inject<I18nLike>(LOGIN_I18N);\n #doMakeUserConfirmPassword = inject(DO_MAKE_USER_CONFIRM_PASSWORD);\n #domSanitizer = inject(DomSanitizer);\n #internal_formState$: BehaviorSubject<reactlessApi.FormState>;\n #unsubscribe: (() => void) | undefined;\n public formState$: Observable<FormState>;\n public dispatchFormAction: (action: FormAction) => void;\n constructor() {\n const api = reactlessApi.getUserProfileApi({\n kcContext: this.#kcContext,\n doMakeUserConfirmPassword: this.#doMakeUserConfirmPassword\n });\n this.#internal_formState$ = new BehaviorSubject<reactlessApi.FormState>(\n api.getFormState()\n );\n this.#unsubscribe = api.subscribeToFormState(() => {\n this.#internal_formState$.next(api.getFormState());\n }).unsubscribe;\n this.formState$ = this.#internal_formState$.asObservable().pipe(\n takeUntilDestroyed(),\n map(formState_reactless => ({\n isFormSubmittable: formState_reactless.isFormSubmittable,\n formFieldStates: formState_reactless.formFieldStates.map(\n formFieldState_reactless => ({\n attribute: formFieldState_reactless.attribute,\n valueOrValues: formFieldState_reactless.valueOrValues,\n displayableErrors: formFieldState_reactless.displayableErrors.map(\n formFieldError_reactless => ({\n errorMessage: this.#domSanitizer.bypassSecurityTrustHtml(\n this.#i18n.advancedMsgStr(\n ...formFieldError_reactless.advancedMsgArgs\n )\n ),\n errorMessageStr: this.#i18n.advancedMsgStr(\n ...formFieldError_reactless.advancedMsgArgs\n ),\n source: formFieldError_reactless.source,\n fieldIndex: formFieldError_reactless.fieldIndex\n })\n )\n })\n )\n }))\n );\n this.dispatchFormAction = api.dispatchFormAction;\n }\n\n ngOnDestroy(): void {\n this.#internal_formState$.complete();\n this.#internal_formState$.unsubscribe();\n if (this.#unsubscribe) this.#unsubscribe();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAyBA;AAII,IAAA,MAAM,EAAgB;AAC1B;AA6BA;AAII,IAAA,MAAM,EAAgB;AAC1B;AAQA;AAII,IAAA,MAAM,EAAgB;AAC1B;AAOA;AAII,IAAA,MAAM,EAAgB;AAC1B;AAgBA;AAII,IAAA,MAAM,EAAgB;AAC1B;MAOa,sBAAsB,CAAA;AAC/B,IAAA,UAAU,GAAG,MAAM,CAAgB,gBAAgB,CAAC;AACpD,IAAA,KAAK,GAAG,MAAM,CAAW,UAAU,CAAC;AACpC,IAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,oBAAoB;AACpB,IAAA,YAAY;AAGZ,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,GAAG,GAAG,YAAY,CAAC,iBAAiB,CAAC;YACvC,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,yBAAyB,EAAE,IAAI,CAAC;AACnC,SAAA,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,IAAI,eAAe,CAC3C,GAAG,CAAC,YAAY,EAAE,CACrB;QACD,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,oBAAoB,CAAC,MAAK;YAC9C,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;SACrD,CAAC,CAAC,WAAW;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,IAAI,CAC3D,kBAAkB,EAAE,EACpB,GAAG,CAAC,mBAAmB,KAAK;YACxB,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB;YACxD,eAAe,EAAE,mBAAmB,CAAC,eAAe,CAAC,GAAG,CACpD,wBAAwB,KAAK;gBACzB,SAAS,EAAE,wBAAwB,CAAC,SAAS;gBAC7C,aAAa,EAAE,wBAAwB,CAAC,aAAa;gBACrD,iBAAiB,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,GAAG,CAC7D,wBAAwB,KAAK;AACzB,oBAAA,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CACpD,IAAI,CAAC,KAAK,CAAC,cAAc,CACrB,GAAG,wBAAwB,CAAC,eAAe,CAC9C,CACJ;oBACD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CACtC,GAAG,wBAAwB,CAAC,eAAe,CAC9C;oBACD,MAAM,EAAE,wBAAwB,CAAC,MAAM;oBACvC,UAAU,EAAE,wBAAwB,CAAC;AACxC,iBAAA,CAAC;AAET,aAAA,CAAC;SAET,CAAC,CAAC,CACN;AACD,QAAA,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC,kBAAkB;;IAGpD,WAAW,GAAA;AACP,QAAA,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE;AACpC,QAAA,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE;QACvC,IAAI,IAAI,CAAC,YAAY;YAAE,IAAI,CAAC,YAAY,EAAE;;8GApDrC,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpHlC;;AAEG;;;;"}
@@ -104,15 +104,15 @@ class TemplateComponent extends ComponentReference {
104
104
  this.#cdr.markForCheck();
105
105
  this.#effectRef.destroy();
106
106
  }
107
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: TemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
108
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: TemplateComponent, isStandalone: true, selector: "kc-root", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, userProfileFormFields: { classPropertyName: "userProfileFormFields", publicName: "userProfileFormFields", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
107
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: TemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
108
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: TemplateComponent, isStandalone: true, selector: "kc-root", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, userProfileFormFields: { classPropertyName: "userProfileFormFields", publicName: "userProfileFormFields", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
109
109
  {
110
110
  provide: ComponentReference,
111
111
  useExisting: forwardRef(() => TemplateComponent)
112
112
  }
113
113
  ], viewQueries: [{ propertyName: "pageRef", first: true, predicate: ["pageRef"], descendants: true, read: ViewContainerRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@let realm = kcContext.realm;\n@let message = kcContext.message;\n@let auth = kcContext.auth;\n@let isAppInitiatedAction = kcContext.isAppInitiatedAction;\n@let url = kcContext.url;\n@let isReadyToRender = isReadyToRender$ | async;\n\n@if (isReadyToRender) {\n <div [kcClass]=\"'kcLoginClass'\">\n <div\n id=\"kc-header\"\n [kcClass]=\"'kcHeaderClass'\"\n >\n <div\n id=\"kc-header-wrapper\"\n [kcClass]=\"'kcHeaderWrapperClass'\"\n >\n <div [innerHTML]=\"realm?.displayNameHtml ?? '' | kcSanitize: 'html'\"></div>\n </div>\n </div>\n\n <div [kcClass]=\"'kcFormCardClass'\">\n <header [kcClass]=\"'kcFormHeaderClass'\">\n <!-- Locale switcher -->\n @if (i18n.enabledLanguages.length > 1) {\n <div\n id=\"kc-locale\"\n [kcClass]=\"'kcLocaleMainClass'\"\n >\n <div\n id=\"kc-locale-wrapper\"\n [kcClass]=\"'kcLocaleWrapperClass'\"\n >\n <div\n id=\"kc-locale-dropdown\"\n class=\"menu-button-links\"\n [kcClass]=\"'kcLocaleDropDownClass'\"\n >\n <button\n tabindex=\"1\"\n id=\"kc-current-locale-link\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n aria-controls=\"language-switch1\"\n [attr.aria-label]=\"i18n.msgStr('languages')\"\n >\n {{ i18n.currentLanguage.label }}\n </button>\n <ul\n role=\"menu\"\n tabindex=\"-1\"\n aria-labelledby=\"kc-current-locale-link\"\n aria-activedescendant=\"\"\n id=\"language-switch1\"\n [kcClass]=\"'kcLocaleListClass'\"\n >\n @for (entry of i18n.enabledLanguages; track entry; let idx = $index) {\n <li\n role=\"none\"\n [kcClass]=\"'kcLocaleListItemClass'\"\n >\n <a\n role=\"menuitem\"\n tabindex=\"-1\"\n [href]=\"entry.href\"\n [kcClass]=\"'kcLocaleItemClass'\"\n [id]=\"'language-' + idx\"\n >\n {{ entry.label }}\n </a>\n </li>\n }\n </ul>\n </div>\n </div>\n </div>\n }\n\n <!-- Header content -->\n <ng-template #node>\n @if (auth && !auth.showUsername && !auth.showResetCredentials) {\n <h1 id=\"kc-page-title\">\n @let header = headerNode && headerNode();\n @if (header) {\n <ng-container [ngTemplateOutlet]=\"header\" />\n }\n </h1>\n } @else {\n <div\n id=\"kc-username\"\n [kcClass]=\"'kcFormGroupClass'\"\n >\n <label id=\"kc-attempted-username\">{{ auth?.attemptedUsername }}</label>\n <a\n id=\"reset-login\"\n [href]=\"url?.loginRestartFlowUrl\"\n [attr.aria-label]=\"i18n.msgStr('restartLoginTooltip')\"\n >\n <div class=\"kc-login-tooltip\">\n <i [kcClass]=\"'kcResetFlowIcon'\"></i>\n <span class=\"kc-tooltip-text\">\n {{ i18n.msgStr('restartLoginTooltip') }}\n </span>\n </div>\n </a>\n </div>\n }\n </ng-template>\n\n @if (displayRequiredFields) {\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <div\n class=\"subtitle\"\n [kcClass]=\"'kcLabelWrapperClass'\"\n >\n <span class=\"subtitle\">\n <span class=\"required\">*</span>\n {{ i18n.msgStr('requiredFields') }}\n </span>\n </div>\n <div class=\"col-md-10\">\n <ng-container [ngTemplateOutlet]=\"node\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"node\" />\n }\n </header>\n\n <div id=\"kc-content\">\n <div id=\"kc-content-wrapper\">\n <!-- Message display -->\n @if (displayMessage && message && (message.type !== 'warning' || !isAppInitiatedAction)) {\n <div\n [kcClass]=\"'kcAlertClass'\"\n [ngClass]=\"message.type === 'error' ? 'pf-m-danger' : 'pf-m-' + message.type\"\n [class]=\"'alert-' + message.type\"\n >\n <div class=\"pf-c-alert__icon\">\n @switch (message.type) {\n @case ('success') {\n <span [kcClass]=\"'kcFeedbackSuccessIcon'\"></span>\n }\n @case ('warning') {\n <span [kcClass]=\"'kcFeedbackWarningIcon'\"></span>\n }\n @case ('info') {\n <span [kcClass]=\"'kcFeedbackInfoIcon'\"></span>\n }\n @case ('error') {\n <span [kcClass]=\"'kcFeedbackErrorIcon'\"></span>\n }\n }\n </div>\n <span\n [kcClass]=\"'kcAlertTitleClass'\"\n [innerHTML]=\"message.summary | kcSanitize: 'html'\"\n ></span>\n </div>\n }\n <!-- Content -->\n <ng-template #pageRef></ng-template>\n\n @if (!!auth && auth?.showTryAnotherWayLink) {\n <form\n id=\"kc-select-try-another-way-form\"\n method=\"post\"\n [action]=\"url?.loginAction\"\n >\n <div [kcClass]=\"'kcFormGroupClass'\">\n <div [kcClass]=\"'kcFormGroupClass'\">\n <input\n type=\"hidden\"\n name=\"tryAnotherWay\"\n value=\"on\"\n />\n <a\n id=\"try-another-way\"\n (click)=\"tryAnotherWay()\"\n >\n {{ i18n.msgStr('doTryAnotherWay') }}\n </a>\n </div>\n </div>\n </form>\n }\n @let socialProviders = socialProvidersNode && socialProvidersNode();\n @if (socialProviders) {\n <ng-container [ngTemplateOutlet]=\"socialProviders\" />\n }\n <!-- Info display -->\n @if (displayInfo) {\n <div\n id=\"kc-info\"\n [kcClass]=\"'kcSignUpClass'\"\n >\n <div\n id=\"kc-info-wrapper\"\n [kcClass]=\"'kcInfoAreaWrapperClass'\"\n >\n @let info = infoNode && infoNode();\n @if (info) {\n <ng-container [ngTemplateOutlet]=\"info\" />\n }\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n}\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: KcSanitizePipe, name: "kcSanitize" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: KcClassDirective, selector: "[kcClass]", inputs: ["class", "ngClass", "kcClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
114
114
  }
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: TemplateComponent, decorators: [{
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: TemplateComponent, decorators: [{
116
116
  type: Component,
117
117
  args: [{ selector: 'kc-root', imports: [AsyncPipe, KcSanitizePipe, NgTemplateOutlet, KcClassDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
118
118
  {
@@ -13,6 +13,7 @@ export declare class UserProfileFormFieldsComponent extends ComponentReference {
13
13
  doUseDefaultCss: boolean;
14
14
  classes: Partial<Record<ClassKey, string>>;
15
15
  formState$: import("rxjs").Observable<import("@keycloakify/angular/login/services/user-profile-form").FormState>;
16
+ xAttributeLocale$: import("rxjs").Observable<import("@keycloakify/angular/login/services/user-profile-form").FormFieldState | undefined>;
16
17
  beforeField: TemplateRef<unknown> | undefined;
17
18
  afterField: TemplateRef<unknown> | undefined;
18
19
  onDispatch(formAction: FormAction): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@keycloakify/angular",
3
3
  "type": "module",
4
- "version": "0.2.17",
4
+ "version": "0.2.19",
5
5
  "peerDependencies": {
6
6
  "keycloakify": "^11.8.0",
7
7
  "@angular/core": "^19.0.0",
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /* eslint-disable @typescript-eslint/consistent-indexed-object-style */
2
+
3
3
  import {
4
4
  Directive,
5
5
  DoCheck,
@@ -45,19 +45,17 @@ export class KcClassDirective implements DoCheck {
45
45
  readonly #renderer = inject(Renderer2);
46
46
  readonly #el = inject(ElementRef);
47
47
  readonly #host = inject(ComponentReference);
48
- // eslint-disable-next-line @angular-eslint/no-input-rename
48
+
49
49
  @Input('class')
50
50
  set klass(value: string) {
51
51
  this.initialClasses = value != null ? value.trim().split(/\s+/) : [];
52
52
  }
53
53
 
54
- // eslint-disable-next-line @angular-eslint/no-input-rename
55
54
  @Input('ngClass')
56
55
  set ngClass(value: string | NgClassSupportedTypes) {
57
56
  this.rawClass = typeof value === 'string' ? value.trim().split(/\s+/) : value;
58
57
  }
59
58
 
60
- // eslint-disable-next-line @angular-eslint/no-input-rename
61
59
  @Input('kcClass')
62
60
  set kcClass(value: ClassKey | KcClassSupportedTypes) {
63
61
  this.rawKcClass =
@@ -12,7 +12,7 @@ import type { ClassKey } from 'keycloakify/account';
12
12
 
13
13
  @Component({
14
14
  imports: [KcClassDirective, NgClass],
15
- selector: 'kc-federatedIdentity',
15
+ selector: 'kc-federated-identity',
16
16
  templateUrl: 'federatedIdentity.component.html',
17
17
  providers: [
18
18
  {
@@ -1,4 +1,4 @@
1
- import { AsyncPipe, NgClass, NgTemplateOutlet } from '@angular/common';
1
+ import { AsyncPipe, NgClass } from '@angular/common';
2
2
  import {
3
3
  ChangeDetectionStrategy,
4
4
  ChangeDetectorRef,
@@ -8,8 +8,6 @@ import {
8
8
  forwardRef,
9
9
  inject,
10
10
  input,
11
- OnInit,
12
- output,
13
11
  Renderer2,
14
12
  Type,
15
13
  viewChild,
@@ -0,0 +1,5 @@
1
+ // @ts-check
2
+ import tseslint from 'typescript-eslint';
3
+ import rootConfig from '../eslint.config.js';
4
+
5
+ export default tseslint.config(...rootConfig);
@@ -1,4 +1,5 @@
1
1
  @let formState = formState$ | async;
2
+ @let xAttributeLocale = xAttributeLocale$ | async;
2
3
  @if (formState) {
3
4
  @let formFieldStates = formState.formFieldStates;
4
5
 
@@ -78,4 +79,12 @@
78
79
  </div>
79
80
  </div>
80
81
  }
82
+ <!-- See: https://github.com/keycloak/keycloak/issues/38029 -->
83
+ @if (kcContext.locale !== undefined && xAttributeLocale === undefined) {
84
+ <input
85
+ type="hidden"
86
+ name="locale"
87
+ [value]="i18n.currentLanguage.languageTag"
88
+ />
89
+ }
81
90
  }
@@ -14,6 +14,7 @@ import { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';
14
14
  import { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context';
15
15
  import { DO_MAKE_USER_CONFIRM_PASSWORD } from '@keycloakify/angular/login/tokens/make-user-confirm-password';
16
16
  import type { ClassKey } from 'keycloakify/login/lib/kcClsx';
17
+ import { map } from 'rxjs';
17
18
 
18
19
  @Component({
19
20
  styles: [
@@ -44,6 +45,7 @@ export class UserProfileFormFieldsComponent extends ComponentReference {
44
45
  override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);
45
46
 
46
47
  formState$ = this.#userProfileFormService.formState$;
48
+ xAttributeLocale$ = this.formState$.pipe(map(s => s.formFieldStates.find(x => x.attribute.name === 'locale')));
47
49
 
48
50
  @ContentChild('beforeField') beforeField: TemplateRef<unknown> | undefined;
49
51
  @ContentChild('afterField') afterField: TemplateRef<unknown> | undefined;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /* eslint-disable @typescript-eslint/consistent-indexed-object-style */
2
+
3
3
  import {
4
4
  Directive,
5
5
  DoCheck,
@@ -44,19 +44,17 @@ export class KcClassDirective implements DoCheck {
44
44
  readonly #renderer = inject(Renderer2);
45
45
  readonly #el = inject(ElementRef);
46
46
  readonly #host = inject(ComponentReference);
47
- // eslint-disable-next-line @angular-eslint/no-input-rename
47
+
48
48
  @Input('class')
49
49
  set klass(value: string) {
50
50
  this.initialClasses = value != null ? value.trim().split(/\s+/) : [];
51
51
  }
52
52
 
53
- // eslint-disable-next-line @angular-eslint/no-input-rename
54
53
  @Input('ngClass')
55
54
  set ngClass(value: string | NgClassSupportedTypes) {
56
55
  this.rawClass = typeof value === 'string' ? value.trim().split(/\s+/) : value;
57
56
  }
58
57
 
59
- // eslint-disable-next-line @angular-eslint/no-input-rename
60
58
  @Input('kcClass')
61
59
  set kcClass(value: ClassKey | KcClassSupportedTypes) {
62
60
  this.rawKcClass =
@@ -38,7 +38,7 @@ export class IdpReviewUserProfileComponent extends ComponentReference {
38
38
 
39
39
  displayRequiredFields = true;
40
40
  displayInfo = false;
41
- displayMessage = !this.kcContext?.messagesPerField?.existsError('global');
41
+ displayMessage = this.kcContext?.messagesPerField?.existsError('global');
42
42
 
43
43
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
44
44
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -36,7 +36,7 @@ export class LoginComponent extends ComponentReference {
36
36
 
37
37
  displayRequiredFields = false;
38
38
  displayInfo = !!this.kcContext?.realm?.password && !!this.kcContext?.realm?.registrationAllowed && !this.kcContext?.registrationDisabled;
39
- displayMessage = !this.kcContext?.messagesPerField?.existsError('username', 'password');
39
+ displayMessage = this.kcContext?.messagesPerField?.existsError('username', 'password');
40
40
 
41
41
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
42
42
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -34,7 +34,7 @@ export class LoginConfigTotpComponent extends ComponentReference {
34
34
 
35
35
  displayRequiredFields = false;
36
36
  displayInfo = false;
37
- displayMessage = !this.kcContext.messagesPerField.existsError('totp', 'userLabel');
37
+ displayMessage = this.kcContext.messagesPerField.existsError('totp', 'userLabel');
38
38
 
39
39
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
40
40
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -27,7 +27,7 @@ export class LoginIdpLinkConfirmComponent extends ComponentReference {
27
27
 
28
28
  displayRequiredFields = false;
29
29
  displayInfo = false;
30
- displayMessage = !this.kcContext.messagesPerField.existsError('totp', 'userLabel');
30
+ displayMessage = this.kcContext.messagesPerField.existsError('totp', 'userLabel');
31
31
 
32
32
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
33
33
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -27,7 +27,7 @@ export class LoginIdpLinkConfirmOverrideComponent extends ComponentReference {
27
27
 
28
28
  displayRequiredFields = false;
29
29
  displayInfo = false;
30
- displayMessage = !this.kcContext.messagesPerField.existsError('totp', 'userLabel');
30
+ displayMessage = this.kcContext.messagesPerField.existsError('totp', 'userLabel');
31
31
 
32
32
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
33
33
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -36,7 +36,7 @@ export class LoginUpdatePasswordComponent extends ComponentReference {
36
36
 
37
37
  displayRequiredFields = false;
38
38
  displayInfo = false;
39
- displayMessage = !this.kcContext.messagesPerField.existsError('password', 'password-confirm');
39
+ displayMessage = this.kcContext.messagesPerField.existsError('password', 'password-confirm');
40
40
 
41
41
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
42
42
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -34,7 +34,7 @@ export class LoginUsernameComponent extends ComponentReference {
34
34
 
35
35
  displayRequiredFields = false;
36
36
  displayInfo: boolean = !!this.kcContext?.realm?.password && !!this.kcContext?.realm?.registrationAllowed && !this.kcContext?.registrationDisabled;
37
- displayMessage: boolean = !this.kcContext?.messagesPerField?.existsError('username');
37
+ displayMessage: boolean = this.kcContext?.messagesPerField?.existsError('username');
38
38
 
39
39
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
40
40
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -40,7 +40,7 @@ export class RegisterComponent extends ComponentReference {
40
40
 
41
41
  displayRequiredFields = false;
42
42
  displayInfo = false;
43
- displayMessage: boolean = !this.kcContext?.messagesPerField?.existsError('global');
43
+ displayMessage: boolean = this.kcContext?.messagesPerField?.existsError('global');
44
44
 
45
45
  headerNode = viewChild<TemplateRef<HTMLElement>>('headerNode');
46
46
  infoNode = viewChild<TemplateRef<HTMLElement>>('infoNode');
@@ -144,7 +144,7 @@ export class UserProfileFormService implements OnDestroy {
144
144
  attribute: formFieldState_reactless.attribute,
145
145
  valueOrValues: formFieldState_reactless.valueOrValues,
146
146
  displayableErrors: formFieldState_reactless.displayableErrors.map(
147
- (formFieldError_reactless, i) => ({
147
+ formFieldError_reactless => ({
148
148
  errorMessage: this.#domSanitizer.bypassSecurityTrustHtml(
149
149
  this.#i18n.advancedMsgStr(
150
150
  ...formFieldError_reactless.advancedMsgArgs