@keycloakify/angular 0.0.1-rc.2 → 0.0.1-rc.3

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 (145) hide show
  1. package/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.mjs +3 -3
  2. package/login/components/field-errors/field-errors.component.mjs +3 -3
  3. package/login/components/group-label/group-label.component.mjs +3 -3
  4. package/login/components/input-field-by-type/input-field-by-type.component.mjs +4 -11
  5. package/login/components/input-tag/input-tag.component.mjs +3 -3
  6. package/login/components/input-tag-selects/input-tag-selects.component.mjs +3 -3
  7. package/login/components/logout-other-sessions/logout-other-sessions.component.mjs +3 -3
  8. package/login/components/password-wrapper/password-wrapper.component.mjs +3 -3
  9. package/login/components/select-tag/select-tag.component.mjs +3 -3
  10. package/login/components/textarea-tag/textarea-tag.component.mjs +3 -3
  11. package/login/components/user-profile-form-fields/user-profile-form-fields.component.mjs +4 -11
  12. package/login/containers/template.component.mjs +4 -5
  13. package/login/pages/code/code.component.mjs +3 -3
  14. package/login/pages/delete-account-confirm/delete-account-confirm.component.mjs +3 -3
  15. package/login/pages/delete-credential/delete-credential.component.mjs +3 -3
  16. package/login/pages/error/error.component.mjs +3 -3
  17. package/login/pages/frontchannel-logout/frontchannel-logout.component.mjs +3 -3
  18. package/login/pages/idp-review-user-profile/idp-review-user-profile.component.mjs +4 -9
  19. package/login/pages/info/info.component.mjs +3 -3
  20. package/login/pages/login/login.component.mjs +5 -15
  21. package/login/pages/login-config-totp/login-config-totp.component.mjs +4 -11
  22. package/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.mjs +3 -3
  23. package/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.mjs +3 -3
  24. package/login/pages/login-idp-link-email/login-idp-link-email.component.mjs +3 -3
  25. package/login/pages/login-oauth-grant/login-oauth-grant.component.mjs +3 -3
  26. package/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.mjs +3 -3
  27. package/login/pages/login-otp/login-otp.component.mjs +3 -3
  28. package/login/pages/login-page-expired/login-page-expired.component.mjs +3 -3
  29. package/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.mjs +3 -3
  30. package/login/pages/login-password/login-password.component.mjs +4 -10
  31. package/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.mjs +4 -9
  32. package/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.mjs +3 -3
  33. package/login/pages/login-reset-otp/login-reset-otp.component.mjs +3 -3
  34. package/login/pages/login-reset-password/login-reset-password.component.mjs +3 -3
  35. package/login/pages/login-update-password/login-update-password.component.mjs +4 -11
  36. package/login/pages/login-update-profile/login-update-profile.component.mjs +4 -9
  37. package/login/pages/login-username/login-username.component.mjs +5 -14
  38. package/login/pages/login-verify-email/login-verify-email.component.mjs +3 -3
  39. package/login/pages/login-x509-info/login-x509-info.component.mjs +3 -3
  40. package/login/pages/logout-confirm/logout-confirm.component.mjs +3 -3
  41. package/login/pages/register/register.component.mjs +3 -3
  42. package/login/pages/saml-post-form/saml-post-form.component.mjs +3 -3
  43. package/login/pages/select-authenticator/select-authenticator.component.mjs +4 -10
  44. package/login/pages/terms/terms.component.mjs +3 -3
  45. package/login/pages/update-email/update-email.component.mjs +4 -10
  46. package/login/pages/webauthn-authenticate/webauthn-authenticate.component.mjs +4 -10
  47. package/login/pages/webauthn-error/webauthn-error.component.mjs +4 -9
  48. package/login/pages/webauthn-register/webauthn-register.component.mjs +4 -9
  49. package/package.json +5 -5
  50. package/src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.html +19 -19
  51. package/src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.ts +2 -12
  52. package/src/login/components/field-errors/field-errors.component.html +10 -10
  53. package/src/login/components/field-errors/field-errors.component.ts +1 -7
  54. package/src/login/components/group-label/group-label.component.html +25 -25
  55. package/src/login/components/group-label/group-label.component.ts +1 -8
  56. package/src/login/components/input-field-by-type/input-field-by-type.component.html +57 -57
  57. package/src/login/components/input-field-by-type/input-field-by-type.component.ts +3 -21
  58. package/src/login/components/input-tag/input-tag.component.html +41 -45
  59. package/src/login/components/input-tag/input-tag.component.ts +2 -13
  60. package/src/login/components/input-tag-selects/input-tag-selects.component.html +22 -22
  61. package/src/login/components/input-tag-selects/input-tag-selects.component.ts +3 -17
  62. package/src/login/components/logout-other-sessions/logout-other-sessions.component.html +15 -15
  63. package/src/login/components/password-wrapper/password-wrapper.component.html +13 -13
  64. package/src/login/components/password-wrapper/password-wrapper.component.ts +2 -15
  65. package/src/login/components/select-tag/select-tag.component.html +26 -26
  66. package/src/login/components/select-tag/select-tag.component.ts +4 -19
  67. package/src/login/components/textarea-tag/textarea-tag.component.html +13 -15
  68. package/src/login/components/textarea-tag/textarea-tag.component.ts +2 -12
  69. package/src/login/components/user-profile-form-fields/user-profile-form-fields.component.html +71 -71
  70. package/src/login/components/user-profile-form-fields/user-profile-form-fields.component.ts +4 -28
  71. package/src/login/containers/template.component.html +183 -183
  72. package/src/login/containers/template.component.ts +4 -22
  73. package/src/login/pages/code/code.component.html +21 -21
  74. package/src/login/pages/code/code.component.ts +1 -5
  75. package/src/login/pages/delete-account-confirm/delete-account-confirm.component.html +44 -42
  76. package/src/login/pages/delete-account-confirm/delete-account-confirm.component.ts +2 -7
  77. package/src/login/pages/delete-credential/delete-credential.component.html +29 -29
  78. package/src/login/pages/delete-credential/delete-credential.component.ts +3 -14
  79. package/src/login/pages/error/error.component.html +20 -20
  80. package/src/login/pages/error/error.component.ts +1 -5
  81. package/src/login/pages/frontchannel-logout/frontchannel-logout.component.html +31 -31
  82. package/src/login/pages/frontchannel-logout/frontchannel-logout.component.ts +3 -15
  83. package/src/login/pages/idp-review-user-profile/idp-review-user-profile.component.html +36 -36
  84. package/src/login/pages/idp-review-user-profile/idp-review-user-profile.component.ts +4 -21
  85. package/src/login/pages/info/info.component.html +45 -45
  86. package/src/login/pages/info/info.component.ts +3 -15
  87. package/src/login/pages/login/login.component.html +194 -194
  88. package/src/login/pages/login/login.component.ts +5 -30
  89. package/src/login/pages/login-config-totp/login-config-totp.component.html +189 -179
  90. package/src/login/pages/login-config-totp/login-config-totp.component.ts +5 -26
  91. package/src/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.html +35 -35
  92. package/src/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.ts +3 -14
  93. package/src/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.html +34 -34
  94. package/src/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.ts +3 -16
  95. package/src/login/pages/login-idp-link-email/login-idp-link-email.component.html +32 -30
  96. package/src/login/pages/login-idp-link-email/login-idp-link-email.component.ts +3 -14
  97. package/src/login/pages/login-oauth-grant/login-oauth-grant.component.html +83 -81
  98. package/src/login/pages/login-oauth-grant/login-oauth-grant.component.ts +3 -14
  99. package/src/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.html +57 -57
  100. package/src/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.ts +3 -16
  101. package/src/login/pages/login-otp/login-otp.component.html +96 -96
  102. package/src/login/pages/login-otp/login-otp.component.ts +2 -12
  103. package/src/login/pages/login-page-expired/login-page-expired.component.html +31 -31
  104. package/src/login/pages/login-page-expired/login-page-expired.component.ts +3 -14
  105. package/src/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.html +183 -181
  106. package/src/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.ts +2 -9
  107. package/src/login/pages/login-password/login-password.component.html +82 -82
  108. package/src/login/pages/login-password/login-password.component.ts +3 -20
  109. package/src/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.html +142 -142
  110. package/src/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.ts +4 -23
  111. package/src/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.html +67 -67
  112. package/src/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.ts +4 -18
  113. package/src/login/pages/login-reset-otp/login-reset-otp.component.html +61 -59
  114. package/src/login/pages/login-reset-otp/login-reset-otp.component.ts +2 -12
  115. package/src/login/pages/login-reset-password/login-reset-password.component.html +84 -84
  116. package/src/login/pages/login-reset-password/login-reset-password.component.ts +3 -14
  117. package/src/login/pages/login-update-password/login-update-password.component.html +107 -107
  118. package/src/login/pages/login-update-password/login-update-password.component.ts +5 -26
  119. package/src/login/pages/login-update-profile/login-update-profile.component.html +53 -53
  120. package/src/login/pages/login-update-profile/login-update-profile.component.ts +4 -21
  121. package/src/login/pages/login-username/login-username.component.html +146 -146
  122. package/src/login/pages/login-username/login-username.component.ts +4 -25
  123. package/src/login/pages/login-verify-email/login-verify-email.component.html +22 -22
  124. package/src/login/pages/login-verify-email/login-verify-email.component.ts +3 -14
  125. package/src/login/pages/login-x509-info/login-x509-info.component.html +96 -96
  126. package/src/login/pages/login-x509-info/login-x509-info.component.ts +2 -12
  127. package/src/login/pages/logout-confirm/logout-confirm.component.html +51 -51
  128. package/src/login/pages/logout-confirm/logout-confirm.component.ts +2 -12
  129. package/src/login/pages/register/register.component.html +113 -113
  130. package/src/login/pages/register/register.component.ts +2 -13
  131. package/src/login/pages/saml-post-form/saml-post-form.component.html +47 -48
  132. package/src/login/pages/saml-post-form/saml-post-form.component.ts +2 -14
  133. package/src/login/pages/select-authenticator/select-authenticator.component.html +43 -44
  134. package/src/login/pages/select-authenticator/select-authenticator.component.ts +4 -21
  135. package/src/login/pages/terms/terms.component.html +32 -32
  136. package/src/login/pages/terms/terms.component.ts +2 -12
  137. package/src/login/pages/update-email/update-email.component.html +52 -52
  138. package/src/login/pages/update-email/update-email.component.ts +3 -20
  139. package/src/login/pages/webauthn-authenticate/webauthn-authenticate.component.html +146 -148
  140. package/src/login/pages/webauthn-authenticate/webauthn-authenticate.component.ts +5 -29
  141. package/src/login/pages/webauthn-error/webauthn-error.component.html +53 -53
  142. package/src/login/pages/webauthn-error/webauthn-error.component.ts +3 -18
  143. package/src/login/pages/webauthn-register/webauthn-register.component.html +73 -73
  144. package/src/login/pages/webauthn-register/webauthn-register.component.ts +4 -20
  145. package/src/tsconfig.json +0 -1
@@ -1,49 +1,45 @@
1
1
  @let attr = attribute();
2
2
  @let index = fieldIndex();
3
3
  @if (attr) {
4
- <input
5
- [type]="attr.annotations.inputType | inputType"
6
- [id]="attr.name"
7
- [name]="attr.name"
8
- [value]="value()"
9
- [kcClass]="'kcInputClass'"
10
- [attr.aria-invalid]="index && displayableErrors()?.[index] !== undefined"
11
- [disabled]="attr.readOnly"
12
- [autocomplete]="attr.autocomplete"
13
- [placeholder]="attr.annotations.inputTypePlaceholder ?? '' | advancedMsgStr"
14
- [attr.pattern]="attr.annotations.inputTypePattern"
15
- [attr.size]="
16
- !attr.annotations.inputTypeSize
17
- ? undefined
18
- : (attr.annotations.inputTypeSize | toNumber) === 0
19
- ? undefined
20
- : (attr.annotations.inputTypeSize | toNumber)
21
- "
22
- [attr.maxlength]="
23
- !attr.annotations.inputTypeMaxlength ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)
24
- "
25
- [attr.minlength]="
26
- !attr.annotations.inputTypeMinlength ? undefined : (attr.annotations.inputTypeMinlength | toNumber)
27
- "
28
- [attr.max]="attr.annotations.inputTypeMax"
29
- [attr.min]="attr.annotations.inputTypeMin"
30
- [attr.step]="attr.annotations.inputTypeStep"
31
- [kcAttributes]="attr.html5DataAnnotations"
32
- (change)="onChange($event)"
33
- (blur)="onBlur()"
34
- />
35
- @if (index !== undefined) {
36
- @let values = valueOrValues() ?? [] | toArray;
37
- <kc-field-errors
38
- [attribute]="attr"
39
- [displayableErrors]="displayableErrors()"
40
- [fieldIndex]="index"
41
- ></kc-field-errors>
42
- <kc-add-remove-buttons-multi-valued-attribute
43
- [attribute]="attr"
44
- [values]="values"
45
- [fieldIndex]="index"
46
- (dispatchFormAction)="dispatchFormAction.emit($event)"
47
- ></kc-add-remove-buttons-multi-valued-attribute>
48
- }
4
+ <input
5
+ [type]="attr.annotations.inputType | inputType"
6
+ [id]="attr.name"
7
+ [name]="attr.name"
8
+ [value]="value()"
9
+ [kcClass]="'kcInputClass'"
10
+ [attr.aria-invalid]="index && displayableErrors()?.[index] !== undefined"
11
+ [disabled]="attr.readOnly"
12
+ [autocomplete]="attr.autocomplete"
13
+ [placeholder]="attr.annotations.inputTypePlaceholder ?? '' | advancedMsgStr"
14
+ [attr.pattern]="attr.annotations.inputTypePattern"
15
+ [attr.size]="
16
+ !attr.annotations.inputTypeSize
17
+ ? undefined
18
+ : (attr.annotations.inputTypeSize | toNumber) === 0
19
+ ? undefined
20
+ : (attr.annotations.inputTypeSize | toNumber)
21
+ "
22
+ [attr.maxlength]="!attr.annotations.inputTypeMaxlength ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)"
23
+ [attr.minlength]="!attr.annotations.inputTypeMinlength ? undefined : (attr.annotations.inputTypeMinlength | toNumber)"
24
+ [attr.max]="attr.annotations.inputTypeMax"
25
+ [attr.min]="attr.annotations.inputTypeMin"
26
+ [attr.step]="attr.annotations.inputTypeStep"
27
+ [kcAttributes]="attr.html5DataAnnotations"
28
+ (change)="onChange($event)"
29
+ (blur)="onBlur()"
30
+ />
31
+ @if (index !== undefined) {
32
+ @let values = valueOrValues() ?? [] | toArray;
33
+ <kc-field-errors
34
+ [attribute]="attr"
35
+ [displayableErrors]="displayableErrors()"
36
+ [fieldIndex]="index"
37
+ ></kc-field-errors>
38
+ <kc-add-remove-buttons-multi-valued-attribute
39
+ [attribute]="attr"
40
+ [values]="values"
41
+ [fieldIndex]="index"
42
+ (dispatchFormAction)="dispatchFormAction.emit($event)"
43
+ ></kc-add-remove-buttons-multi-valued-attribute>
44
+ }
49
45
  }
@@ -1,12 +1,4 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- computed,
5
- forwardRef,
6
- inject,
7
- input,
8
- output
9
- } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output } from '@angular/core';
10
2
  import { CLASSES, USE_DEFAULT_CSS } from '@keycloakify/angular/lib/public-api';
11
3
  import { Attribute } from 'keycloakify/login/KcContext';
12
4
  import { ClassKey } from 'keycloakify/login/lib/kcClsx';
@@ -17,10 +9,7 @@ import { AdvancedMsgStrPipe } from '@keycloakify/angular/login/pipes/advanced-ms
17
9
  import { InputTypePipe } from '@keycloakify/angular/login/pipes/input-type.pipe';
18
10
  import { ToArrayPipe } from '@keycloakify/angular/login/pipes/to-array.pipe';
19
11
  import { ToNumberPipe } from '@keycloakify/angular/login/pipes/to-number.pipe';
20
- import {
21
- FormAction,
22
- FormFieldError
23
- } from '@keycloakify/angular/login/services/user-profile-form.service';
12
+ import { FormAction, FormFieldError } from '@keycloakify/angular/login/services/user-profile-form.service';
24
13
  import { AddRemoveButtonsMultiValuedAttributeComponent } from '@keycloakify/angular/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component';
25
14
  import { FieldErrorsComponent } from '@keycloakify/angular/login/components/field-errors/field-errors.component';
26
15
 
@@ -4,26 +4,26 @@
4
4
  @let classDiv = context()?.classDiv;
5
5
  @let attr = attribute();
6
6
  @if (attr) {
7
- @for (option of options(); track option) {
8
- <div [kcClass]="classDiv">
9
- <input
10
- [type]="inputType"
11
- [id]="attr.name + '-' + option"
12
- [name]="attr.name"
13
- [value]="option"
14
- [kcClass]="classInput"
15
- [attr.aria-invalid]="!!displayableErrors()?.length"
16
- [disabled]="attr.readOnly"
17
- [checked]="checked(option)"
18
- (change)="onChange($event, option)"
19
- (blur)="onBlur()"
20
- />
21
- <label
22
- [for]="attr.name + '-' + option"
23
- [kcClass]="[classLabel!, attr.readOnly ? 'kcInputClassRadioCheckboxLabelDisabled' : $any('')]"
24
- >
25
- {{ option | advancedMsgStr }}
26
- </label>
27
- </div>
28
- }
7
+ @for (option of options(); track option) {
8
+ <div [kcClass]="classDiv">
9
+ <input
10
+ [type]="inputType"
11
+ [id]="attr.name + '-' + option"
12
+ [name]="attr.name"
13
+ [value]="option"
14
+ [kcClass]="classInput"
15
+ [attr.aria-invalid]="!!displayableErrors()?.length"
16
+ [disabled]="attr.readOnly"
17
+ [checked]="checked(option)"
18
+ (change)="onChange($event, option)"
19
+ (blur)="onBlur()"
20
+ />
21
+ <label
22
+ [for]="attr.name + '-' + option"
23
+ [kcClass]="[classLabel!, attr.readOnly ? 'kcInputClassRadioCheckboxLabelDisabled' : $any('')]"
24
+ >
25
+ {{ option | advancedMsgStr }}
26
+ </label>
27
+ </div>
28
+ }
29
29
  }
@@ -1,23 +1,11 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- computed,
5
- forwardRef,
6
- inject,
7
- input,
8
- output,
9
- Signal
10
- } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output, Signal } from '@angular/core';
11
2
  import { CLASSES, USE_DEFAULT_CSS } from '@keycloakify/angular/lib/public-api';
12
3
  import { Attribute } from 'keycloakify/login/KcContext';
13
4
  import { ClassKey } from 'keycloakify/login/lib/kcClsx';
14
5
  import { ComponentReference } from '@keycloakify/angular/login/classes/component-reference.class';
15
6
  import { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class.directive';
16
7
  import { AdvancedMsgStrPipe } from '@keycloakify/angular/login/pipes/advanced-msg-str.pipe';
17
- import {
18
- FormAction,
19
- FormFieldError
20
- } from '@keycloakify/angular/login/services/user-profile-form.service';
8
+ import { FormAction, FormFieldError } from '@keycloakify/angular/login/services/user-profile-form.service';
21
9
 
22
10
  @Component({
23
11
  standalone: true,
@@ -87,9 +75,7 @@ export class InputTagSelectsComponent extends ComponentReference {
87
75
  break walk;
88
76
  }
89
77
 
90
- const validator = (
91
- attribute.validators as Record<string, { options?: string[] }>
92
- )[inputOptionsFromValidation];
78
+ const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];
93
79
 
94
80
  if (validator === undefined) {
95
81
  break walk;
@@ -1,19 +1,19 @@
1
1
  <div
2
- id="kc-form-options"
3
- [kcClass]="'kcFormOptionsClass'"
2
+ id="kc-form-options"
3
+ [kcClass]="'kcFormOptionsClass'"
4
4
  >
5
- <div [kcClass]="'kcFormOptionsWrapperClass'">
6
- <div class="checkbox">
7
- <label for="logout-sessions">
8
- <input
9
- type="checkbox"
10
- id="logout-sessions"
11
- name="logout-sessions"
12
- value="on"
13
- defaultChecked="true"
14
- />
15
- {{ 'logoutOtherSessions' | msgStr }}
16
- </label>
5
+ <div [kcClass]="'kcFormOptionsWrapperClass'">
6
+ <div class="checkbox">
7
+ <label for="logout-sessions">
8
+ <input
9
+ type="checkbox"
10
+ id="logout-sessions"
11
+ name="logout-sessions"
12
+ value="on"
13
+ defaultChecked="true"
14
+ />
15
+ {{ 'logoutOtherSessions' | msgStr }}
16
+ </label>
17
+ </div>
17
18
  </div>
18
- </div>
19
19
  </div>
@@ -1,15 +1,15 @@
1
1
  <div [kcClass]="'kcInputGroup'">
2
- <ng-content></ng-content>
3
- <button
4
- type="button"
5
- [kcClass]="'kcFormPasswordVisibilityButtonClass'"
6
- [attr.aria-label]="(isPasswordRevealed() ? 'hidePassword' : 'showPassword') | msgStr"
7
- [attr.aria-controls]="passwordInputId()"
8
- (click)="togglePasswordVisibility()"
9
- >
10
- <i
11
- [kcClass]="isPasswordRevealed() ? 'kcFormPasswordVisibilityIconHide' : 'kcFormPasswordVisibilityIconShow'"
12
- aria-hidden="true"
13
- ></i>
14
- </button>
2
+ <ng-content></ng-content>
3
+ <button
4
+ type="button"
5
+ [kcClass]="'kcFormPasswordVisibilityButtonClass'"
6
+ [attr.aria-label]="(isPasswordRevealed() ? 'hidePassword' : 'showPassword') | msgStr"
7
+ [attr.aria-controls]="passwordInputId()"
8
+ (click)="togglePasswordVisibility()"
9
+ >
10
+ <i
11
+ [kcClass]="isPasswordRevealed() ? 'kcFormPasswordVisibilityIconHide' : 'kcFormPasswordVisibilityIconShow'"
12
+ aria-hidden="true"
13
+ ></i>
14
+ </button>
15
15
  </div>
@@ -1,14 +1,5 @@
1
1
  import { AsyncPipe } from '@angular/common';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- forwardRef,
6
- inject,
7
- input,
8
- Renderer2,
9
- signal,
10
- WritableSignal
11
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, forwardRef, inject, input, Renderer2, signal, WritableSignal } from '@angular/core';
12
3
  import { CLASSES, USE_DEFAULT_CSS } from '@keycloakify/angular/lib/public-api';
13
4
  import { ClassKey } from 'keycloakify/login/lib/kcClsx';
14
5
  import { ComponentReference } from '@keycloakify/angular/login/classes/component-reference.class';
@@ -51,11 +42,7 @@ export class PasswordWrapperComponent extends ComponentReference {
51
42
  private setPasswordInputType(): void {
52
43
  const input = document.getElementById(this.passwordInputId());
53
44
  if (input) {
54
- this.renderer.setProperty(
55
- input,
56
- 'type',
57
- this.isPasswordRevealed() ? 'text' : 'password'
58
- );
45
+ this.renderer.setProperty(input, 'type', this.isPasswordRevealed() ? 'text' : 'password');
59
46
  }
60
47
  }
61
48
  }
@@ -1,31 +1,31 @@
1
1
  @let attr = attribute();
2
2
  @let multiple = isMultiple();
3
3
  @if (attr) {
4
- <select
5
- [id]="attr.name"
6
- [name]="attr.name"
7
- [value]="valueOrValues()"
8
- [kcClass]="'kcInputClass'"
9
- [attr.aria-invalid]="!!displayableErrors()?.length"
10
- [disabled]="attr.readOnly"
11
- [multiple]="multiple"
12
- [size]="!attr.annotations.inputTypeSize ? undefined : (attr.annotations.inputTypeSize | toNumber)"
13
- (change)="onChange($event)"
14
- (blur)="onBlur()"
15
- >
16
- @if (!multiple) {
17
- <option value=""></option>
18
- }
19
- @for (option of options(); track option) {
20
- <option [value]="option">
21
- @if (!!attr.annotations.inputOptionLabels) {
22
- {{ attr.annotations.inputOptionLabels[option] ?? option | advancedMsgStr }}
23
- } @else if (!!attr.annotations.inputOptionLabelsI18nPrefix) {
24
- {{ attr.annotations.inputOptionLabelsI18nPrefix + '.' + option | advancedMsgStr }}
25
- } @else {
26
- {{ option }}
4
+ <select
5
+ [id]="attr.name"
6
+ [name]="attr.name"
7
+ [value]="valueOrValues()"
8
+ [kcClass]="'kcInputClass'"
9
+ [attr.aria-invalid]="!!displayableErrors()?.length"
10
+ [disabled]="attr.readOnly"
11
+ [multiple]="multiple"
12
+ [size]="!attr.annotations.inputTypeSize ? undefined : (attr.annotations.inputTypeSize | toNumber)"
13
+ (change)="onChange($event)"
14
+ (blur)="onBlur()"
15
+ >
16
+ @if (!multiple) {
17
+ <option value=""></option>
27
18
  }
28
- </option>
29
- }
30
- </select>
19
+ @for (option of options(); track option) {
20
+ <option [value]="option">
21
+ @if (!!attr.annotations.inputOptionLabels) {
22
+ {{ attr.annotations.inputOptionLabels[option] ?? option | advancedMsgStr }}
23
+ } @else if (!!attr.annotations.inputOptionLabelsI18nPrefix) {
24
+ {{ attr.annotations.inputOptionLabelsI18nPrefix + '.' + option | advancedMsgStr }}
25
+ } @else {
26
+ {{ option }}
27
+ }
28
+ </option>
29
+ }
30
+ </select>
31
31
  }
@@ -1,12 +1,4 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- computed,
5
- forwardRef,
6
- inject,
7
- input,
8
- output
9
- } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output } from '@angular/core';
10
2
  import { CLASSES, USE_DEFAULT_CSS } from '@keycloakify/angular/lib/public-api';
11
3
  import { Attribute } from 'keycloakify/login/KcContext';
12
4
  import { ClassKey } from 'keycloakify/login/lib/kcClsx';
@@ -14,10 +6,7 @@ import { ComponentReference } from '@keycloakify/angular/login/classes/component
14
6
  import { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class.directive';
15
7
  import { AdvancedMsgStrPipe } from '@keycloakify/angular/login/pipes/advanced-msg-str.pipe';
16
8
  import { ToNumberPipe } from '@keycloakify/angular/login/pipes/to-number.pipe';
17
- import {
18
- FormAction,
19
- FormFieldError
20
- } from '@keycloakify/angular/login/services/user-profile-form.service';
9
+ import { FormAction, FormFieldError } from '@keycloakify/angular/login/services/user-profile-form.service';
21
10
 
22
11
  @Component({
23
12
  standalone: true,
@@ -62,9 +51,7 @@ export class SelectTagComponent extends ComponentReference {
62
51
  break walk;
63
52
  }
64
53
 
65
- const validator = (
66
- attribute.validators as Record<string, { options?: string[] }>
67
- )[inputOptionsFromValidation];
54
+ const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];
68
55
 
69
56
  if (validator === undefined) {
70
57
  break walk;
@@ -89,9 +76,7 @@ export class SelectTagComponent extends ComponentReference {
89
76
  name: this.attribute()?.name ?? '',
90
77
  valueOrValues: (() => {
91
78
  if (this.isMultiple()) {
92
- return Array.from(
93
- (event.target as HTMLSelectElement).selectedOptions
94
- ).map(option => option.value);
79
+ return Array.from((event.target as HTMLSelectElement).selectedOptions).map(option => option.value);
95
80
  }
96
81
 
97
82
  return (event.target as HTMLSelectElement).value;
@@ -1,18 +1,16 @@
1
1
  @let attr = attribute();
2
2
  @if (attr) {
3
- <textarea
4
- [id]="attr.name"
5
- [name]="attr.name"
6
- [kcClass]="'kcInputClass'"
7
- [attr.aria-invalid]="!!displayableErrors()?.length"
8
- [disabled]="attr.readOnly"
9
- [cols]="attr.annotations.inputTypeCols === undefined ? undefined : (attr.annotations.inputTypeCols | toNumber)"
10
- [rows]="attr.annotations.inputTypeRows === undefined ? undefined : (attr.annotations.inputTypeRows | toNumber)"
11
- [maxLength]="
12
- attr.annotations.inputTypeMaxlength === undefined ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)
13
- "
14
- [value]="value()"
15
- (change)="onChange($event)"
16
- (blur)="onBlur()"
17
- ></textarea>
3
+ <textarea
4
+ [id]="attr.name"
5
+ [name]="attr.name"
6
+ [kcClass]="'kcInputClass'"
7
+ [attr.aria-invalid]="!!displayableErrors()?.length"
8
+ [disabled]="attr.readOnly"
9
+ [cols]="attr.annotations.inputTypeCols === undefined ? undefined : (attr.annotations.inputTypeCols | toNumber)"
10
+ [rows]="attr.annotations.inputTypeRows === undefined ? undefined : (attr.annotations.inputTypeRows | toNumber)"
11
+ [maxLength]="attr.annotations.inputTypeMaxlength === undefined ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)"
12
+ [value]="value()"
13
+ (change)="onChange($event)"
14
+ (blur)="onBlur()"
15
+ ></textarea>
18
16
  }
@@ -1,21 +1,11 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- forwardRef,
5
- inject,
6
- input,
7
- output
8
- } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, forwardRef, inject, input, output } from '@angular/core';
9
2
  import { CLASSES, USE_DEFAULT_CSS } from '@keycloakify/angular/lib/public-api';
10
3
  import { Attribute } from 'keycloakify/login/KcContext';
11
4
  import { ClassKey } from 'keycloakify/login/lib/kcClsx';
12
5
  import { ComponentReference } from '@keycloakify/angular/login/classes/component-reference.class';
13
6
  import { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class.directive';
14
7
  import { ToNumberPipe } from '@keycloakify/angular/login/pipes/to-number.pipe';
15
- import {
16
- FormAction,
17
- FormFieldError
18
- } from '@keycloakify/angular/login/services/user-profile-form.service';
8
+ import { FormAction, FormFieldError } from '@keycloakify/angular/login/services/user-profile-form.service';
19
9
 
20
10
  @Component({
21
11
  standalone: true,
@@ -1,85 +1,85 @@
1
1
  @let formFieldStates = formState().formFieldStates;
2
2
 
3
3
  @for (fieldState of formFieldStates; track fieldState.attribute) {
4
- <!-- [groupNameRef]="groupNameRef"
4
+ <!-- [groupNameRef]="groupNameRef"
5
5
  TODO: verify this logic
6
6
  -->
7
- <kc-group-label [attribute]="fieldState.attribute"> </kc-group-label>
7
+ <kc-group-label [attribute]="fieldState.attribute"> </kc-group-label>
8
8
 
9
- @if (beforeField) {
10
- <ng-container
11
- [ngTemplateOutlet]="beforeField"
12
- [ngTemplateOutletContext]="{
13
- attribute: fieldState.attribute,
14
- valueOrValues: fieldState.valueOrValues,
15
- displayableErrors: fieldState.displayableErrors,
16
- }"
9
+ @if (beforeField) {
10
+ <ng-container
11
+ [ngTemplateOutlet]="beforeField"
12
+ [ngTemplateOutletContext]="{
13
+ attribute: fieldState.attribute,
14
+ valueOrValues: fieldState.valueOrValues,
15
+ displayableErrors: fieldState.displayableErrors
16
+ }"
17
+ >
18
+ </ng-container>
19
+ }
20
+
21
+ <div
22
+ [kcClass]="'kcFormGroupClass'"
23
+ [style.display]="fieldState.attribute.name === 'password-confirm' && !doMakeUserConfirmPassword ? 'none' : 'block'"
17
24
  >
18
- </ng-container>
19
- }
25
+ <div [kcClass]="'kcLabelWrapperClass'">
26
+ <label
27
+ [for]="fieldState.attribute.name"
28
+ [kcClass]="'kcLabelClass'"
29
+ >
30
+ {{ fieldState.attribute.displayName ?? '' | advancedMsgStr }}
31
+ @if (fieldState.attribute.required) {
32
+ *
33
+ }
34
+ </label>
35
+ </div>
20
36
 
21
- <div
22
- [kcClass]="'kcFormGroupClass'"
23
- [style.display]="fieldState.attribute.name === 'password-confirm' && !doMakeUserConfirmPassword ? 'none' : 'block'"
24
- >
25
- <div [kcClass]="'kcLabelWrapperClass'">
26
- <label
27
- [for]="fieldState.attribute.name"
28
- [kcClass]="'kcLabelClass'"
29
- >
30
- {{ fieldState.attribute.displayName ?? '' | advancedMsgStr }}
31
- @if (fieldState.attribute.required) {
32
- *
33
- }
34
- </label>
35
- </div>
37
+ <div [kcClass]="'kcInputWrapperClass'">
38
+ @if (fieldState.attribute.annotations.inputHelperTextBefore) {
39
+ <div
40
+ [kcClass]="'kcInputHelperTextBeforeClass'"
41
+ [id]="'form-help-text-before-' + fieldState.attribute.name"
42
+ aria-live="polite"
43
+ >
44
+ {{ fieldState.attribute.annotations.inputHelperTextBefore | advancedMsgStr }}
45
+ </div>
46
+ }
36
47
 
37
- <div [kcClass]="'kcInputWrapperClass'">
38
- @if (fieldState.attribute.annotations.inputHelperTextBefore) {
39
- <div
40
- [kcClass]="'kcInputHelperTextBeforeClass'"
41
- [id]="'form-help-text-before-' + fieldState.attribute.name"
42
- aria-live="polite"
43
- >
44
- {{ fieldState.attribute.annotations.inputHelperTextBefore | advancedMsgStr }}
45
- </div>
46
- }
48
+ <kc-input-field-by-type
49
+ [attribute]="fieldState.attribute"
50
+ [valueOrValues]="fieldState.valueOrValues"
51
+ [displayableErrors]="fieldState.displayableErrors"
52
+ (dispatchFormAction)="onDispatch($event)"
53
+ >
54
+ </kc-input-field-by-type>
47
55
 
48
- <kc-input-field-by-type
49
- [attribute]="fieldState.attribute"
50
- [valueOrValues]="fieldState.valueOrValues"
51
- [displayableErrors]="fieldState.displayableErrors"
52
- (dispatchFormAction)="onDispatch($event)"
53
- >
54
- </kc-input-field-by-type>
56
+ <kc-field-errors
57
+ [attribute]="fieldState.attribute"
58
+ [displayableErrors]="fieldState.displayableErrors"
59
+ >
60
+ </kc-field-errors>
61
+ @if (fieldState.attribute.annotations.inputHelperTextAfter) {
62
+ <div
63
+ [kcClass]="'kcInputHelperTextAfterClass'"
64
+ [id]="'form-help-text-after-' + fieldState.attribute.name"
65
+ aria-live="polite"
66
+ >
67
+ {{ fieldState.attribute.annotations.inputHelperTextAfter | advancedMsgStr }}
68
+ </div>
69
+ }
55
70
 
56
- <kc-field-errors
57
- [attribute]="fieldState.attribute"
58
- [displayableErrors]="fieldState.displayableErrors"
59
- >
60
- </kc-field-errors>
61
- @if (fieldState.attribute.annotations.inputHelperTextAfter) {
62
- <div
63
- [kcClass]="'kcInputHelperTextAfterClass'"
64
- [id]="'form-help-text-after-' + fieldState.attribute.name"
65
- aria-live="polite"
66
- >
67
- {{ fieldState.attribute.annotations.inputHelperTextAfter | advancedMsgStr }}
71
+ @if (afterField) {
72
+ <ng-container
73
+ [ngTemplateOutlet]="afterField"
74
+ [ngTemplateOutletContext]="{
75
+ attribute: fieldState.attribute,
76
+ valueOrValues: fieldState.valueOrValues,
77
+ displayableErrors: fieldState.displayableErrors
78
+ }"
79
+ >
80
+ </ng-container>
81
+ }
82
+ <!-- NOTE: Downloading of html5DataAnnotations scripts is done in the useUserProfileForm hook -->
68
83
  </div>
69
- }
70
-
71
- @if (afterField) {
72
- <ng-container
73
- [ngTemplateOutlet]="afterField"
74
- [ngTemplateOutletContext]="{
75
- attribute: fieldState.attribute,
76
- valueOrValues: fieldState.valueOrValues,
77
- displayableErrors: fieldState.displayableErrors,
78
- }"
79
- >
80
- </ng-container>
81
- }
82
- <!-- NOTE: Downloading of html5DataAnnotations scripts is done in the useUserProfileForm hook -->
83
84
  </div>
84
- </div>
85
85
  }