@keycloakify/angular 21.1.5 → 22.0.0-rc.1
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/README.md +2 -0
- package/bin/index.js +72 -1113
- package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-account.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-account.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-applications.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-applications.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-log.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-log.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-password.mjs +17 -10
- package/fesm2022/keycloakify-angular-account-pages-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-sessions.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-sessions.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-totp.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-totp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-services-account-resource-injector.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-services-account-resource-injector.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-services-i18n.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-services-i18n.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-template.mjs +5 -4
- package/fesm2022/keycloakify-angular-account-template.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs +5 -4
- package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-pipes-input-type.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-input-type.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-pipes-kc-sanitize.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-kc-sanitize.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-services-resource-injector.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-services-resource-injector.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs +13 -8
- package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-field-errors.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-components-field-errors.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-group-label.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-components-group-label.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs +13 -8
- package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-input-tag.mjs +15 -9
- package/fesm2022/keycloakify-angular-login-components-input-tag.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-logout-other-sessions.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-components-logout-other-sessions.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs +7 -5
- package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-select-tag.mjs +13 -8
- package/fesm2022/keycloakify-angular-login-components-select-tag.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-code.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-code.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-error.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-error.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-info.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-info.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-link-idp-action.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-link-idp-action.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-password.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-login-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-username.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-login-username.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-login.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-register.mjs +13 -8
- package/fesm2022/keycloakify-angular-login-pages-register.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-terms.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-terms.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-update-email.mjs +11 -7
- package/fesm2022/keycloakify-angular-login-pages-update-email.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs +9 -6
- package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-services-i18n.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-services-i18n.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-services-login-resource-injector.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-services-login-resource-injector.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-template.mjs +13 -8
- package/fesm2022/keycloakify-angular-login-template.mjs.map +1 -1
- package/package.json +1 -1
- package/src/bin/initialize-account-theme/boilerplate/KcPageStory.ts +2 -0
- package/src/bin/tsconfig.json +4 -5
- package/bin/187.index.js +0 -514
- package/bin/202.index.js +0 -7778
- package/bin/476.index.js +0 -400
- package/bin/671.index.js +0 -1354
- package/bin/942.index.js +0 -911
package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs
CHANGED
|
@@ -6,9 +6,12 @@ import { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';
|
|
|
6
6
|
class AddRemoveButtonsMultiValuedAttributeComponent {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.i18n = inject(LOGIN_I18N);
|
|
9
|
-
this.attribute = input(
|
|
10
|
-
|
|
11
|
-
this.
|
|
9
|
+
this.attribute = input(/* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [undefined, { debugName: "attribute" }] : /* istanbul ignore next */ []));
|
|
11
|
+
this.values = input(/* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [undefined, { debugName: "values" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.fieldIndex = input(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [undefined, { debugName: "fieldIndex" }] : /* istanbul ignore next */ []));
|
|
12
15
|
this.dispatchFormAction = output();
|
|
13
16
|
this.hasRemove = computed(() => {
|
|
14
17
|
const attribute = this.attribute();
|
|
@@ -22,7 +25,8 @@ class AddRemoveButtonsMultiValuedAttributeComponent {
|
|
|
22
25
|
}).hasRemove;
|
|
23
26
|
}
|
|
24
27
|
return false;
|
|
25
|
-
},
|
|
28
|
+
}, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "hasRemove" }] : /* istanbul ignore next */ []));
|
|
26
30
|
this.hasAdd = computed(() => {
|
|
27
31
|
const attribute = this.attribute();
|
|
28
32
|
const values = this.values();
|
|
@@ -35,7 +39,8 @@ class AddRemoveButtonsMultiValuedAttributeComponent {
|
|
|
35
39
|
}).hasAdd;
|
|
36
40
|
}
|
|
37
41
|
return false;
|
|
38
|
-
},
|
|
42
|
+
}, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "hasAdd" }] : /* istanbul ignore next */ []));
|
|
39
44
|
}
|
|
40
45
|
onAdd() {
|
|
41
46
|
this.dispatchFormAction.emit({
|
|
@@ -51,10 +56,10 @@ class AddRemoveButtonsMultiValuedAttributeComponent {
|
|
|
51
56
|
valueOrValues: (this.values() ?? []).filter((_, i) => i !== this.fieldIndex())
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
55
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: AddRemoveButtonsMultiValuedAttributeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
60
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: AddRemoveButtonsMultiValuedAttributeComponent, isStandalone: true, selector: "kc-add-remove-buttons-multi-valued-attribute", inputs: { attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, fieldIndex: { classPropertyName: "fieldIndex", publicName: "fieldIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dispatchFormAction: "dispatchFormAction" }, ngImport: i0, template: "@let idPostfix = attribute()?.name ?? '' + '-' + (fieldIndex() ?? 0 + 1);\n@if (hasRemove()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-remove-' + idPostfix\"\n (click)=\"onRemove()\"\n >\n {{ i18n.msgStr('remove') }}\n </button>\n @if (hasAdd()) {\n | \n }\n}\n@if (hasAdd()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-add-' + idPostfix\"\n (click)=\"onAdd()\"\n >\n {{ i18n.msgStr('addValue') }}\n </button>\n}\n", styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
56
61
|
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: AddRemoveButtonsMultiValuedAttributeComponent, decorators: [{
|
|
58
63
|
type: Component,
|
|
59
64
|
args: [{ selector: 'kc-add-remove-buttons-multi-valued-attribute', changeDetection: ChangeDetectionStrategy.OnPush, template: "@let idPostfix = attribute()?.name ?? '' + '-' + (fieldIndex() ?? 0 + 1);\n@if (hasRemove()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-remove-' + idPostfix\"\n (click)=\"onRemove()\"\n >\n {{ i18n.msgStr('remove') }}\n </button>\n @if (hasAdd()) {\n | \n }\n}\n@if (hasAdd()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-add-' + idPostfix\"\n (click)=\"onAdd()\"\n >\n {{ i18n.msgStr('addValue') }}\n </button>\n}\n", styles: [":host{display:contents}\n"] }]
|
|
60
65
|
}], propDecorators: { attribute: [{ type: i0.Input, args: [{ isSignal: true, alias: "attribute", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }], fieldIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldIndex", required: false }] }], dispatchFormAction: [{ type: i0.Output, args: ["dispatchFormAction"] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs","sources":["../../src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.ts","../../src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.html","../../src/login/components/add-remove-buttons-multi-valued-attribute/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\nimport { getButtonToDisplayForMultivaluedAttributeField, type FormAction } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n selector: 'kc-add-remove-buttons-multi-valued-attribute',\n templateUrl: 'add-remove-buttons-multi-valued-attribute.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AddRemoveButtonsMultiValuedAttributeComponent {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n values = input<string[]>();\n fieldIndex = input<number>();\n dispatchFormAction = output<FormAction>();\n\n hasRemove = computed(() => {\n const attribute = this.attribute();\n const values = this.values();\n const fieldIndex = this.fieldIndex();\n if (attribute && values && fieldIndex) {\n return getButtonToDisplayForMultivaluedAttributeField({\n attribute,\n values,\n fieldIndex\n }).hasRemove;\n }\n return false;\n });\n hasAdd = computed(() => {\n const attribute = this.attribute();\n const values = this.values();\n const fieldIndex = this.fieldIndex();\n if (attribute && values && fieldIndex) {\n return getButtonToDisplayForMultivaluedAttributeField({\n attribute,\n values,\n fieldIndex\n }).hasAdd;\n }\n return false;\n });\n\n onAdd() {\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: [...(this.values() ?? []), '']\n });\n }\n\n onRemove() {\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: (this.values() ?? []).filter((_, i) => i !== this.fieldIndex())\n });\n }\n}\n","@let idPostfix = attribute()?.name ?? '' + '-' + (fieldIndex() ?? 0 + 1);\n@if (hasRemove()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-remove-' + idPostfix\"\n (click)=\"onRemove()\"\n >\n {{ i18n.msgStr('remove') }}\n </button>\n @if (hasAdd()) {\n | \n }\n}\n@if (hasAdd()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-add-' + idPostfix\"\n (click)=\"onAdd()\"\n >\n {{ i18n.msgStr('addValue') }}\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAkBa,6CAA6C,CAAA;AAZ1D,IAAA,WAAA,GAAA;AAaI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs","sources":["../../src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.ts","../../src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.html","../../src/login/components/add-remove-buttons-multi-valued-attribute/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\nimport { getButtonToDisplayForMultivaluedAttributeField, type FormAction } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n selector: 'kc-add-remove-buttons-multi-valued-attribute',\n templateUrl: 'add-remove-buttons-multi-valued-attribute.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AddRemoveButtonsMultiValuedAttributeComponent {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n values = input<string[]>();\n fieldIndex = input<number>();\n dispatchFormAction = output<FormAction>();\n\n hasRemove = computed(() => {\n const attribute = this.attribute();\n const values = this.values();\n const fieldIndex = this.fieldIndex();\n if (attribute && values && fieldIndex) {\n return getButtonToDisplayForMultivaluedAttributeField({\n attribute,\n values,\n fieldIndex\n }).hasRemove;\n }\n return false;\n });\n hasAdd = computed(() => {\n const attribute = this.attribute();\n const values = this.values();\n const fieldIndex = this.fieldIndex();\n if (attribute && values && fieldIndex) {\n return getButtonToDisplayForMultivaluedAttributeField({\n attribute,\n values,\n fieldIndex\n }).hasAdd;\n }\n return false;\n });\n\n onAdd() {\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: [...(this.values() ?? []), '']\n });\n }\n\n onRemove() {\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: (this.values() ?? []).filter((_, i) => i !== this.fieldIndex())\n });\n }\n}\n","@let idPostfix = attribute()?.name ?? '' + '-' + (fieldIndex() ?? 0 + 1);\n@if (hasRemove()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-remove-' + idPostfix\"\n (click)=\"onRemove()\"\n >\n {{ i18n.msgStr('remove') }}\n </button>\n @if (hasAdd()) {\n | \n }\n}\n@if (hasAdd()) {\n <button\n type=\"button\"\n class=\"pf-c-button pf-m-inline pf-m-link\"\n [id]=\"'kc-add-' + idPostfix\"\n (click)=\"onAdd()\"\n >\n {{ i18n.msgStr('addValue') }}\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAkBa,6CAA6C,CAAA;AAZ1D,IAAA,WAAA,GAAA;AAaI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAa;AAC9B,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK;8FAAY;AAC1B,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK;kGAAU;QAC5B,IAAA,CAAA,kBAAkB,GAAG,MAAM,EAAc;AAEzC,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAK;AACtB,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;AAClC,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAC5B,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE;AACpC,YAAA,IAAI,SAAS,IAAI,MAAM,IAAI,UAAU,EAAE;AACnC,gBAAA,OAAO,8CAA8C,CAAC;oBAClD,SAAS;oBACT,MAAM;oBACN;iBACH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A,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6CAA6C,ijBClB1D,4mBAwBA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDNa,6CAA6C,EAAA,UAAA,EAAA,CAAA;kBAZzD,SAAS;+BAQI,8CAA8C,EAAA,eAAA,EAEvC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4mBAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AEhBnD;;AAEG;;;;"}
|
|
@@ -8,21 +8,24 @@ import { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';
|
|
|
8
8
|
class FieldErrorsComponent extends ComponentReference {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.attribute = input(
|
|
12
|
-
|
|
13
|
-
this.
|
|
11
|
+
this.attribute = input(/* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [undefined, { debugName: "attribute" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.displayableErrors = input(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [undefined, { debugName: "displayableErrors" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.fieldIndex = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "fieldIndex" }] : /* istanbul ignore next */ []));
|
|
14
17
|
this.doUseDefaultCss = inject(USE_DEFAULT_CSS);
|
|
15
18
|
this.classes = inject(LOGIN_CLASSES);
|
|
16
19
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: FieldErrorsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: FieldErrorsComponent, isStandalone: true, selector: "kc-field-errors", inputs: { attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: false, transformFunction: null }, displayableErrors: { classPropertyName: "displayableErrors", publicName: "displayableErrors", isSignal: true, isRequired: false, transformFunction: null }, fieldIndex: { classPropertyName: "fieldIndex", publicName: "fieldIndex", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
19
22
|
{
|
|
20
23
|
provide: ComponentReference,
|
|
21
24
|
useExisting: forwardRef(() => FieldErrorsComponent)
|
|
22
25
|
}
|
|
23
26
|
], usesInheritance: true, ngImport: i0, template: "@let index = fieldIndex();\n<span\n aria-live=\"polite\"\n [id]=\"'input-error-' + attribute.name + (index === undefined ? '' : '-' + index)\"\n [kcClass]=\"'kcInputErrorMessageClass'\"\n>\n @for (error of displayableErrors(); track error; let i = $index) {\n @if (error.fieldIndex === index) {\n <span [innerHTML]=\"error.errorMessage\"></span>\n @if (displayableErrors()?.length ?? 0 - 1 !== i) {\n <br />\n }\n }\n }\n</span>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: KcClassDirective, selector: "[kcClass]", inputs: ["class", "ngClass", "kcClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
24
27
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: FieldErrorsComponent, decorators: [{
|
|
26
29
|
type: Component,
|
|
27
30
|
args: [{ imports: [KcClassDirective], selector: 'kc-field-errors', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
28
31
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-components-field-errors.mjs","sources":["../../src/login/components/field-errors/field-errors.component.ts","../../src/login/components/field-errors/field-errors.component.html","../../src/login/components/field-errors/keycloakify-angular-login-components-field-errors.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, inject, input } from '@angular/core';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [KcClassDirective],\n selector: 'kc-field-errors',\n templateUrl: 'field-errors.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => FieldErrorsComponent)\n }\n ]\n})\nexport class FieldErrorsComponent extends ComponentReference {\n attribute = input<Attribute>();\n displayableErrors = input<FormFieldError[]>();\n fieldIndex = input<number>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n}\n","@let index = fieldIndex();\n<span\n aria-live=\"polite\"\n [id]=\"'input-error-' + attribute.name + (index === undefined ? '' : '-' + index)\"\n [kcClass]=\"'kcInputErrorMessageClass'\"\n>\n @for (error of displayableErrors(); track error; let i = $index) {\n @if (error.fieldIndex === index) {\n <span [innerHTML]=\"error.errorMessage\"></span>\n @if (displayableErrors()?.length ?? 0 - 1 !== i) {\n <br />\n }\n }\n }\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA4BM,MAAO,oBAAqB,SAAQ,kBAAkB,CAAA;AAnB5D,IAAA,WAAA,GAAA;;
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-components-field-errors.mjs","sources":["../../src/login/components/field-errors/field-errors.component.ts","../../src/login/components/field-errors/field-errors.component.html","../../src/login/components/field-errors/keycloakify-angular-login-components-field-errors.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, inject, input } from '@angular/core';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [KcClassDirective],\n selector: 'kc-field-errors',\n templateUrl: 'field-errors.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => FieldErrorsComponent)\n }\n ]\n})\nexport class FieldErrorsComponent extends ComponentReference {\n attribute = input<Attribute>();\n displayableErrors = input<FormFieldError[]>();\n fieldIndex = input<number>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n}\n","@let index = fieldIndex();\n<span\n aria-live=\"polite\"\n [id]=\"'input-error-' + attribute.name + (index === undefined ? '' : '-' + index)\"\n [kcClass]=\"'kcInputErrorMessageClass'\"\n>\n @for (error of displayableErrors(); track error; let i = $index) {\n @if (error.fieldIndex === index) {\n <span [innerHTML]=\"error.errorMessage\"></span>\n @if (displayableErrors()?.length ?? 0 - 1 !== i) {\n <br />\n }\n }\n }\n</span>\n","/**\n * Generated b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,kBAAkB;AAC3B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB;AACrD;SACJ,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC1BL,6fAeA,mFDEc,gBAAgB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAWjB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAnBhC,SAAS;8BAQG,CAAC,gBAAgB,CAAC,EAAA,QAAA,EACjB,iBAAiB,mBAEV,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,0BAA0B;AACrD;AACJ,qBAAA,EAAA,QAAA,EAAA,6fAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AE1BL;;AAEG;;;;"}
|
|
@@ -11,8 +11,10 @@ class GroupLabelComponent extends ComponentReference {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.i18n = inject(LOGIN_I18N);
|
|
14
|
-
this.attribute = input(
|
|
15
|
-
|
|
14
|
+
this.attribute = input(/* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [undefined, { debugName: "attribute" }] : /* istanbul ignore next */ []));
|
|
16
|
+
this.groupName = input(/* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [undefined, { debugName: "groupName" }] : /* istanbul ignore next */ []));
|
|
16
18
|
this.doUseDefaultCss = inject(USE_DEFAULT_CSS);
|
|
17
19
|
this.classes = inject(LOGIN_CLASSES);
|
|
18
20
|
this.groupNameRef = computed(() => {
|
|
@@ -22,17 +24,18 @@ class GroupLabelComponent extends ComponentReference {
|
|
|
22
24
|
return attribute?.group?.name ?? '';
|
|
23
25
|
}
|
|
24
26
|
return '';
|
|
25
|
-
},
|
|
27
|
+
}, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "groupNameRef" }] : /* istanbul ignore next */ []));
|
|
26
29
|
}
|
|
27
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
28
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: GroupLabelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
31
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: GroupLabelComponent, isStandalone: true, selector: "kc-group-label", inputs: { attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: false, transformFunction: null }, groupName: { classPropertyName: "groupName", publicName: "groupName", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
29
32
|
{
|
|
30
33
|
provide: ComponentReference,
|
|
31
34
|
useExisting: forwardRef(() => GroupLabelComponent)
|
|
32
35
|
}
|
|
33
36
|
], usesInheritance: true, ngImport: i0, template: "@let attr = attribute();\n@let groupName = groupNameRef();\n@if (attr && groupName !== '') {\n <div\n [kcClass]=\"'kcFormGroupClass'\"\n [kcAttributes]=\"attr.group?.html5DataAnnotations\"\n >\n @let groupDisplayHeader = attr.group?.displayHeader ?? '';\n @let groupHeaderText = groupDisplayHeader !== '' ? groupDisplayHeader : (attr.group?.name ?? '');\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <label\n [id]=\"'header-' + attr.group?.name\"\n [kcClass]=\"'kcFormGroupHeader'\"\n >\n {{ i18n.advancedMsgStr(groupHeaderText) }}\n </label>\n </div>\n @let groupDisplayDescription = attr.group?.displayDescription ?? '';\n @if (groupDisplayDescription !== '') {\n <div [kcClass]=\"'kcLabelWrapperClass'\">\n <label\n [id]=\"'description-' + attr.group?.name\"\n [kcClass]=\"'kcLabelClass'\"\n >\n {{ i18n.advancedMsgStr(groupDisplayDescription) }}\n </label>\n </div>\n }\n </div>\n}\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: KcClassDirective, selector: "[kcClass]", inputs: ["class", "ngClass", "kcClass"] }, { kind: "directive", type: AttributesDirective, selector: "[kcAttributes]", inputs: ["kcAttributes"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
34
37
|
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: GroupLabelComponent, decorators: [{
|
|
36
39
|
type: Component,
|
|
37
40
|
args: [{ imports: [KcClassDirective, AttributesDirective], selector: 'kc-group-label', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
38
41
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-components-group-label.mjs","sources":["../../src/login/components/group-label/group-label.component.ts","../../src/login/components/group-label/group-label.component.html","../../src/login/components/group-label/keycloakify-angular-login-components-group-label.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input } from '@angular/core';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { AttributesDirective } from '@keycloakify/angular/lib/directives/attributes';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [KcClassDirective, AttributesDirective],\n selector: 'kc-group-label',\n templateUrl: 'group-label.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => GroupLabelComponent)\n }\n ]\n})\nexport class GroupLabelComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n groupName = input<string>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n groupNameRef = computed(() => {\n const attribute = this.attribute();\n const groupName = this.groupName();\n if (attribute?.group?.name !== groupName) {\n return attribute?.group?.name ?? '';\n }\n return '';\n });\n}\n","@let attr = attribute();\n@let groupName = groupNameRef();\n@if (attr && groupName !== '') {\n <div\n [kcClass]=\"'kcFormGroupClass'\"\n [kcAttributes]=\"attr.group?.html5DataAnnotations\"\n >\n @let groupDisplayHeader = attr.group?.displayHeader ?? '';\n @let groupHeaderText = groupDisplayHeader !== '' ? groupDisplayHeader : (attr.group?.name ?? '');\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <label\n [id]=\"'header-' + attr.group?.name\"\n [kcClass]=\"'kcFormGroupHeader'\"\n >\n {{ i18n.advancedMsgStr(groupHeaderText) }}\n </label>\n </div>\n @let groupDisplayDescription = attr.group?.displayDescription ?? '';\n @if (groupDisplayDescription !== '') {\n <div [kcClass]=\"'kcLabelWrapperClass'\">\n <label\n [id]=\"'description-' + attr.group?.name\"\n [kcClass]=\"'kcLabelClass'\"\n >\n {{ i18n.advancedMsgStr(groupDisplayDescription) }}\n </label>\n </div>\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA8BM,MAAO,mBAAoB,SAAQ,kBAAkB,CAAA;AAnB3D,IAAA,WAAA,GAAA;;AAoBI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-components-group-label.mjs","sources":["../../src/login/components/group-label/group-label.component.ts","../../src/login/components/group-label/group-label.component.html","../../src/login/components/group-label/keycloakify-angular-login-components-group-label.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input } from '@angular/core';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { AttributesDirective } from '@keycloakify/angular/lib/directives/attributes';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [KcClassDirective, AttributesDirective],\n selector: 'kc-group-label',\n templateUrl: 'group-label.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => GroupLabelComponent)\n }\n ]\n})\nexport class GroupLabelComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n groupName = input<string>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n groupNameRef = computed(() => {\n const attribute = this.attribute();\n const groupName = this.groupName();\n if (attribute?.group?.name !== groupName) {\n return attribute?.group?.name ?? '';\n }\n return '';\n });\n}\n","@let attr = attribute();\n@let groupName = groupNameRef();\n@if (attr && groupName !== '') {\n <div\n [kcClass]=\"'kcFormGroupClass'\"\n [kcAttributes]=\"attr.group?.html5DataAnnotations\"\n >\n @let groupDisplayHeader = attr.group?.displayHeader ?? '';\n @let groupHeaderText = groupDisplayHeader !== '' ? groupDisplayHeader : (attr.group?.name ?? '');\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <label\n [id]=\"'header-' + attr.group?.name\"\n [kcClass]=\"'kcFormGroupHeader'\"\n >\n {{ i18n.advancedMsgStr(groupHeaderText) }}\n </label>\n </div>\n @let groupDisplayDescription = attr.group?.displayDescription ?? '';\n @if (groupDisplayDescription !== '') {\n <div [kcClass]=\"'kcLabelWrapperClass'\">\n <label\n [id]=\"'description-' + attr.group?.name\"\n [kcClass]=\"'kcLabelClass'\"\n >\n {{ i18n.advancedMsgStr(groupDisplayDescription) }}\n </label>\n </div>\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA8BM,MAAO,mBAAoB,SAAQ,kBAAkB,CAAA;AAnB3D,IAAA,WAAA,GAAA;;AAoBI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAa;AAC9B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAU;AAClB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAU,eAAe,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAoC,aAAa,CAAC;AAC3E,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAK;AACzB,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;AAClC,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;YAClC,IAAI,SAAS,EAAE,KAAK,EAAE,IAAI,KAAK,SAAS,EAAE;AACtC,gBAAA,OAAO,SAAS,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE;YACvC;AACA,YAAA,OAAO,EAAE;QACb,CAAC;yFAAC;AACL,IAAA;8GAd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BAAmB,EAAA,UAAA,EAAA,CAAA;kBAnB/B,SAAS;8BAQG,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,EAAA,QAAA,EACtC,gBAAgB,EAAA,eAAA,EAET,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,yBAAyB;AACpD;AACJ,qBAAA,EAAA,QAAA,EAAA,6oCAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AE5BL;;AAEG;;;;"}
|
|
@@ -14,9 +14,12 @@ import { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';
|
|
|
14
14
|
class InputFieldByTypeComponent extends ComponentReference {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
-
this.attribute = input(
|
|
18
|
-
|
|
19
|
-
this.
|
|
17
|
+
this.attribute = input(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [undefined, { debugName: "attribute" }] : /* istanbul ignore next */ []));
|
|
19
|
+
this.valueOrValues = input(/* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [undefined, { debugName: "valueOrValues" }] : /* istanbul ignore next */ []));
|
|
21
|
+
this.displayableErrors = input(/* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [undefined, { debugName: "displayableErrors" }] : /* istanbul ignore next */ []));
|
|
20
23
|
this.dispatchFormAction = output();
|
|
21
24
|
this.doUseDefaultCss = inject(USE_DEFAULT_CSS);
|
|
22
25
|
this.classes = inject(LOGIN_CLASSES);
|
|
@@ -26,17 +29,18 @@ class InputFieldByTypeComponent extends ComponentReference {
|
|
|
26
29
|
...attribute,
|
|
27
30
|
annotations: { ...(attribute.annotations ?? {}), inputType: 'password' }
|
|
28
31
|
};
|
|
29
|
-
},
|
|
32
|
+
}, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "attributePassword" }] : /* istanbul ignore next */ []));
|
|
30
34
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: InputFieldByTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: InputFieldByTypeComponent, isStandalone: true, selector: "kc-input-field-by-type", inputs: { attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: false, transformFunction: null }, valueOrValues: { classPropertyName: "valueOrValues", publicName: "valueOrValues", isSignal: true, isRequired: false, transformFunction: null }, displayableErrors: { classPropertyName: "displayableErrors", publicName: "displayableErrors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dispatchFormAction: "dispatchFormAction" }, providers: [
|
|
33
37
|
{
|
|
34
38
|
provide: ComponentReference,
|
|
35
39
|
useExisting: forwardRef(() => InputFieldByTypeComponent)
|
|
36
40
|
}
|
|
37
41
|
], usesInheritance: true, ngImport: i0, template: "@let attr = attribute();\n@if (attr) {\n @let type = attr.annotations.inputType;\n @switch (type) {\n @case ('hidden') {\n <input\n type=\"hidden\"\n [name]=\"attr.name\"\n [value]=\"$any(valueOrValues())\"\n />\n }\n @case ('textarea') {\n <kc-textarea-tag\n [attribute]=\"attribute()\"\n [value]=\"$any(valueOrValues())\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @case (type === 'select' || type === 'multiselect' ? type : '') {\n <kc-select-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @case (type === 'select-radiobuttons' || type === 'multiselect-checkboxes' ? type : '') {\n <kc-input-tag-selects\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @default {\n @let values = valueOrValues();\n <!-- if valueOrValues is string skip -->\n @if (values && (values | toArray: true).length) {\n @for (value of values; track value; let i = $index) {\n <kc-input-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [fieldIndex]=\"i\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n } @else {\n @if (attr.name === 'password' || attr.name === 'password-confirm') {\n <kc-password-wrapper [passwordInputId]=\"attr.name\">\n <kc-input-tag\n [attribute]=\"attributePassword()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n </kc-password-wrapper>\n } @else {\n <kc-input-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n }\n }\n }\n}\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "component", type: TextareaTagComponent, selector: "kc-textarea-tag", inputs: ["attribute", "value", "displayableErrors"], outputs: ["dispatchFormAction"] }, { kind: "component", type: SelectTagComponent, selector: "kc-select-tag", inputs: ["attribute", "valueOrValues", "displayableErrors"], outputs: ["dispatchFormAction"] }, { kind: "component", type: InputTagSelectsComponent, selector: "kc-input-tag-selects", inputs: ["attribute", "valueOrValues", "displayableErrors"], outputs: ["dispatchFormAction"] }, { kind: "component", type: InputTagComponent, selector: "kc-input-tag", inputs: ["attribute", "valueOrValues", "fieldIndex", "values", "displayableErrors"], outputs: ["dispatchFormAction"] }, { kind: "component", type: PasswordWrapperComponent, selector: "kc-password-wrapper", inputs: ["passwordInputId"] }, { kind: "pipe", type: ToArrayPipe, name: "toArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
42
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: InputFieldByTypeComponent, decorators: [{
|
|
40
44
|
type: Component,
|
|
41
45
|
args: [{ imports: [ToArrayPipe, TextareaTagComponent, SelectTagComponent, InputTagSelectsComponent, InputTagComponent, PasswordWrapperComponent], selector: 'kc-input-field-by-type', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
42
46
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-components-input-field-by-type.mjs","sources":["../../src/login/components/input-field-by-type/input-field-by-type.component.ts","../../src/login/components/input-field-by-type/input-field-by-type.component.html","../../src/login/components/input-field-by-type/keycloakify-angular-login-components-input-field-by-type.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { ToArrayPipe } from '@keycloakify/angular/lib/pipes/to-array';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { InputTagComponent } from '@keycloakify/angular/login/components/input-tag';\nimport { InputTagSelectsComponent } from '@keycloakify/angular/login/components/input-tag-selects';\nimport { PasswordWrapperComponent } from '@keycloakify/angular/login/components/password-wrapper';\nimport { SelectTagComponent } from '@keycloakify/angular/login/components/select-tag';\nimport { TextareaTagComponent } from '@keycloakify/angular/login/components/textarea-tag';\nimport { type FormAction, type FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [ToArrayPipe, TextareaTagComponent, SelectTagComponent, InputTagSelectsComponent, InputTagComponent, PasswordWrapperComponent],\n selector: 'kc-input-field-by-type',\n templateUrl: 'input-field-by-type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => InputFieldByTypeComponent)\n }\n ]\n})\nexport class InputFieldByTypeComponent extends ComponentReference {\n attribute = input<Attribute>();\n valueOrValues = input<string | string[]>();\n displayableErrors = input<FormFieldError[]>();\n dispatchFormAction = output<FormAction>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n\n attributePassword = computed<Attribute>(() => {\n const attribute: Attribute = this.attribute() ?? ({} as Attribute);\n return {\n ...attribute,\n annotations: { ...(attribute.annotations ?? {}), inputType: 'password' }\n };\n });\n}\n","@let attr = attribute();\n@if (attr) {\n @let type = attr.annotations.inputType;\n @switch (type) {\n @case ('hidden') {\n <input\n type=\"hidden\"\n [name]=\"attr.name\"\n [value]=\"$any(valueOrValues())\"\n />\n }\n @case ('textarea') {\n <kc-textarea-tag\n [attribute]=\"attribute()\"\n [value]=\"$any(valueOrValues())\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @case (type === 'select' || type === 'multiselect' ? type : '') {\n <kc-select-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @case (type === 'select-radiobuttons' || type === 'multiselect-checkboxes' ? type : '') {\n <kc-input-tag-selects\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @default {\n @let values = valueOrValues();\n <!-- if valueOrValues is string skip -->\n @if (values && (values | toArray: true).length) {\n @for (value of values; track value; let i = $index) {\n <kc-input-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [fieldIndex]=\"i\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n } @else {\n @if (attr.name === 'password' || attr.name === 'password-confirm') {\n <kc-password-wrapper [passwordInputId]=\"attr.name\">\n <kc-input-tag\n [attribute]=\"attributePassword()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n </kc-password-wrapper>\n } @else {\n <kc-input-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiCM,MAAO,yBAA0B,SAAQ,kBAAkB,CAAA;AAnBjE,IAAA,WAAA,GAAA;;
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-components-input-field-by-type.mjs","sources":["../../src/login/components/input-field-by-type/input-field-by-type.component.ts","../../src/login/components/input-field-by-type/input-field-by-type.component.html","../../src/login/components/input-field-by-type/keycloakify-angular-login-components-input-field-by-type.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { ToArrayPipe } from '@keycloakify/angular/lib/pipes/to-array';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { InputTagComponent } from '@keycloakify/angular/login/components/input-tag';\nimport { InputTagSelectsComponent } from '@keycloakify/angular/login/components/input-tag-selects';\nimport { PasswordWrapperComponent } from '@keycloakify/angular/login/components/password-wrapper';\nimport { SelectTagComponent } from '@keycloakify/angular/login/components/select-tag';\nimport { TextareaTagComponent } from '@keycloakify/angular/login/components/textarea-tag';\nimport { type FormAction, type FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [ToArrayPipe, TextareaTagComponent, SelectTagComponent, InputTagSelectsComponent, InputTagComponent, PasswordWrapperComponent],\n selector: 'kc-input-field-by-type',\n templateUrl: 'input-field-by-type.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => InputFieldByTypeComponent)\n }\n ]\n})\nexport class InputFieldByTypeComponent extends ComponentReference {\n attribute = input<Attribute>();\n valueOrValues = input<string | string[]>();\n displayableErrors = input<FormFieldError[]>();\n dispatchFormAction = output<FormAction>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n\n attributePassword = computed<Attribute>(() => {\n const attribute: Attribute = this.attribute() ?? ({} as Attribute);\n return {\n ...attribute,\n annotations: { ...(attribute.annotations ?? {}), inputType: 'password' }\n };\n });\n}\n","@let attr = attribute();\n@if (attr) {\n @let type = attr.annotations.inputType;\n @switch (type) {\n @case ('hidden') {\n <input\n type=\"hidden\"\n [name]=\"attr.name\"\n [value]=\"$any(valueOrValues())\"\n />\n }\n @case ('textarea') {\n <kc-textarea-tag\n [attribute]=\"attribute()\"\n [value]=\"$any(valueOrValues())\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @case (type === 'select' || type === 'multiselect' ? type : '') {\n <kc-select-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @case (type === 'select-radiobuttons' || type === 'multiselect-checkboxes' ? type : '') {\n <kc-input-tag-selects\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n @default {\n @let values = valueOrValues();\n <!-- if valueOrValues is string skip -->\n @if (values && (values | toArray: true).length) {\n @for (value of values; track value; let i = $index) {\n <kc-input-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [fieldIndex]=\"i\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n } @else {\n @if (attr.name === 'password' || attr.name === 'password-confirm') {\n <kc-password-wrapper [passwordInputId]=\"attr.name\">\n <kc-input-tag\n [attribute]=\"attributePassword()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n </kc-password-wrapper>\n } @else {\n <kc-input-tag\n [attribute]=\"attribute()\"\n [valueOrValues]=\"valueOrValues()\"\n [displayableErrors]=\"displayableErrors()\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiCM,MAAO,yBAA0B,SAAQ,kBAAkB,CAAA;AAnBjE,IAAA,WAAA,GAAA;;AAoBI,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAa;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK;qGAAqB;AAC1C,QAAA,IAAA,CAAA,iBAAiB,GAAG,KAAK;yGAAoB;QAC7C,IAAA,CAAA,kB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AAW,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAWZ,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAnBrC,SAAS;AAQG,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAC,WAAW,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,wBAAwB,CAAC,EAAA,QAAA,EAC7H,wBAAwB,mBAEjB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,+BAA+B;AAC1D;AACJ,qBAAA,EAAA,QAAA,EAAA,k8FAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AE/BL;;AAEG;;;;"}
|
|
@@ -10,10 +10,13 @@ class InputTagSelectsComponent extends ComponentReference {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.i18n = inject(LOGIN_I18N);
|
|
13
|
-
this.attribute = input(
|
|
14
|
-
|
|
13
|
+
this.attribute = input(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [undefined, { debugName: "attribute" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.valueOrValues = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "valueOrValues" }] : /* istanbul ignore next */ []));
|
|
15
17
|
this.dispatchFormAction = output();
|
|
16
|
-
this.displayableErrors = input(
|
|
18
|
+
this.displayableErrors = input(/* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [undefined, { debugName: "displayableErrors" }] : /* istanbul ignore next */ []));
|
|
17
20
|
this.doUseDefaultCss = inject(USE_DEFAULT_CSS);
|
|
18
21
|
this.classes = inject(LOGIN_CLASSES);
|
|
19
22
|
this.context = computed(() => {
|
|
@@ -38,7 +41,8 @@ class InputTagSelectsComponent extends ComponentReference {
|
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
return null;
|
|
41
|
-
},
|
|
44
|
+
}, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
42
46
|
this.options = computed(() => {
|
|
43
47
|
const attribute = this.attribute();
|
|
44
48
|
if (attribute) {
|
|
@@ -61,7 +65,8 @@ class InputTagSelectsComponent extends ComponentReference {
|
|
|
61
65
|
})();
|
|
62
66
|
}
|
|
63
67
|
return [];
|
|
64
|
-
},
|
|
68
|
+
}, /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
65
70
|
}
|
|
66
71
|
checked(option) {
|
|
67
72
|
const valueOrValues = this.valueOrValues();
|
|
@@ -98,15 +103,15 @@ class InputTagSelectsComponent extends ComponentReference {
|
|
|
98
103
|
fieldIndex: undefined
|
|
99
104
|
});
|
|
100
105
|
}
|
|
101
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
102
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
106
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: InputTagSelectsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
107
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: InputTagSelectsComponent, isStandalone: true, selector: "kc-input-tag-selects", inputs: { attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: false, transformFunction: null }, valueOrValues: { classPropertyName: "valueOrValues", publicName: "valueOrValues", isSignal: true, isRequired: false, transformFunction: null }, displayableErrors: { classPropertyName: "displayableErrors", publicName: "displayableErrors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dispatchFormAction: "dispatchFormAction" }, providers: [
|
|
103
108
|
{
|
|
104
109
|
provide: ComponentReference,
|
|
105
110
|
useExisting: forwardRef(() => InputTagSelectsComponent)
|
|
106
111
|
}
|
|
107
112
|
], usesInheritance: true, ngImport: i0, template: "@let inputType = context()?.inputType;\n@let classInput = context()?.classInput;\n@let classLabel = context()?.classLabel;\n@let classDiv = context()?.classDiv;\n@let attr = attribute();\n@if (attr) {\n @for (option of options(); track option) {\n <div [kcClass]=\"classDiv\">\n <input\n [type]=\"inputType\"\n [id]=\"attr.name + '-' + option\"\n [name]=\"attr.name\"\n [value]=\"option\"\n [kcClass]=\"classInput\"\n [attr.aria-invalid]=\"!!displayableErrors()?.length\"\n [disabled]=\"attr.readOnly\"\n [checked]=\"checked(option)\"\n (change)=\"onChange($event, option)\"\n (blur)=\"onBlur()\"\n />\n <label\n [for]=\"attr.name + '-' + option\"\n [kcClass]=\"[classLabel!, attr.readOnly ? 'kcInputClassRadioCheckboxLabelDisabled' : $any('')]\"\n >\n {{ i18n.advancedMsgStr(option) }}\n </label>\n </div>\n }\n}\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: KcClassDirective, selector: "[kcClass]", inputs: ["class", "ngClass", "kcClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
108
113
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: InputTagSelectsComponent, decorators: [{
|
|
110
115
|
type: Component,
|
|
111
116
|
args: [{ imports: [KcClassDirective], selector: 'kc-input-tag-selects', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
112
117
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-components-input-tag-selects.mjs","sources":["../../src/login/components/input-tag-selects/input-tag-selects.component.ts","../../src/login/components/input-tag-selects/input-tag-selects.component.html","../../src/login/components/input-tag-selects/keycloakify-angular-login-components-input-tag-selects.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output, type Signal } from '@angular/core';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { FormAction, FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [KcClassDirective],\n selector: 'kc-input-tag-selects',\n templateUrl: 'input-tag-selects.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => InputTagSelectsComponent)\n }\n ]\n})\nexport class InputTagSelectsComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n valueOrValues = input<string | string[]>();\n dispatchFormAction = output<FormAction>();\n displayableErrors = input<FormFieldError[]>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n\n context: Signal<{\n inputType: 'radio' | 'checkbox';\n classDiv: ClassKey;\n classInput: ClassKey;\n classLabel: ClassKey;\n } | null> = computed(() => {\n const attribute = this.attribute();\n if (attribute) {\n const { inputType } = attribute.annotations;\n switch (inputType) {\n case 'select-radiobuttons':\n return {\n inputType: 'radio',\n classDiv: 'kcInputClassRadio',\n classInput: 'kcInputClassRadioInput',\n classLabel: 'kcInputClassRadioLabel'\n };\n case 'multiselect-checkboxes':\n return {\n inputType: 'checkbox',\n classDiv: 'kcInputClassCheckbox',\n classInput: 'kcInputClassCheckboxInput',\n classLabel: 'kcInputClassCheckboxLabel'\n };\n }\n }\n return null;\n });\n\n options = computed(() => {\n const attribute = this.attribute();\n if (attribute) {\n return (() => {\n walk: {\n const { inputOptionsFromValidation } = attribute.annotations;\n\n if (inputOptionsFromValidation === undefined) {\n break walk;\n }\n\n const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];\n\n if (validator === undefined) {\n break walk;\n }\n\n if (validator.options === undefined) {\n break walk;\n }\n\n return validator.options;\n }\n\n return attribute.validators.options?.options ?? [];\n })();\n }\n return [];\n });\n\n checked(option: string) {\n const valueOrValues = this.valueOrValues();\n if (valueOrValues instanceof Array) {\n return valueOrValues.includes(option);\n }\n return valueOrValues === option;\n }\n\n onChange(event: Event, option: string) {\n const valueOrValues = this.valueOrValues();\n const isChecked = (event.target as HTMLInputElement).checked;\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: (() => {\n if (valueOrValues instanceof Array) {\n const newValues = [...valueOrValues];\n\n if (isChecked) {\n newValues.push(option);\n } else {\n newValues.splice(newValues.indexOf(option), 1);\n }\n\n return newValues;\n }\n\n return (event.target as HTMLInputElement)?.checked ? option : '';\n })()\n });\n }\n\n onBlur() {\n this.dispatchFormAction.emit({\n action: 'focus lost',\n name: this.attribute()?.name ?? '',\n fieldIndex: undefined\n });\n }\n}\n","@let inputType = context()?.inputType;\n@let classInput = context()?.classInput;\n@let classLabel = context()?.classLabel;\n@let classDiv = context()?.classDiv;\n@let attr = attribute();\n@if (attr) {\n @for (option of options(); track option) {\n <div [kcClass]=\"classDiv\">\n <input\n [type]=\"inputType\"\n [id]=\"attr.name + '-' + option\"\n [name]=\"attr.name\"\n [value]=\"option\"\n [kcClass]=\"classInput\"\n [attr.aria-invalid]=\"!!displayableErrors()?.length\"\n [disabled]=\"attr.readOnly\"\n [checked]=\"checked(option)\"\n (change)=\"onChange($event, option)\"\n (blur)=\"onBlur()\"\n />\n <label\n [for]=\"attr.name + '-' + option\"\n [kcClass]=\"[classLabel!, attr.readOnly ? 'kcInputClassRadioCheckboxLabelDisabled' : $any('')]\"\n >\n {{ i18n.advancedMsgStr(option) }}\n </label>\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA8BM,MAAO,wBAAyB,SAAQ,kBAAkB,CAAA;AAnBhE,IAAA,WAAA,GAAA;;AAoBI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;QAC/B,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAa;QAC9B,IAAA,CAAA,aAAa,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAqB;QAC1C,IAAA,CAAA,kBAAkB,GAAG,MAAM,EAAc;QACzC,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAoB;AACpC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAU,eAAe,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAoC,aAAa,CAAC;AAE3E,QAAA,IAAA,CAAA,OAAO,GAKK,QAAQ,CAAC,MAAK;AACtB,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;YAClC,IAAI,SAAS,EAAE;AACX,gBAAA,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,WAAW;gBAC3C,QAAQ,SAAS;AACb,oBAAA,K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C;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,8BAA8B;AACzD;AACJ,qBAAA,EAAA,QAAA,EAAA,+jCAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AE5BL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-components-input-tag-selects.mjs","sources":["../../src/login/components/input-tag-selects/input-tag-selects.component.ts","../../src/login/components/input-tag-selects/input-tag-selects.component.html","../../src/login/components/input-tag-selects/keycloakify-angular-login-components-input-tag-selects.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output, type Signal } from '@angular/core';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { FormAction, FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [KcClassDirective],\n selector: 'kc-input-tag-selects',\n templateUrl: 'input-tag-selects.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => InputTagSelectsComponent)\n }\n ]\n})\nexport class InputTagSelectsComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n valueOrValues = input<string | string[]>();\n dispatchFormAction = output<FormAction>();\n displayableErrors = input<FormFieldError[]>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n\n context: Signal<{\n inputType: 'radio' | 'checkbox';\n classDiv: ClassKey;\n classInput: ClassKey;\n classLabel: ClassKey;\n } | null> = computed(() => {\n const attribute = this.attribute();\n if (attribute) {\n const { inputType } = attribute.annotations;\n switch (inputType) {\n case 'select-radiobuttons':\n return {\n inputType: 'radio',\n classDiv: 'kcInputClassRadio',\n classInput: 'kcInputClassRadioInput',\n classLabel: 'kcInputClassRadioLabel'\n };\n case 'multiselect-checkboxes':\n return {\n inputType: 'checkbox',\n classDiv: 'kcInputClassCheckbox',\n classInput: 'kcInputClassCheckboxInput',\n classLabel: 'kcInputClassCheckboxLabel'\n };\n }\n }\n return null;\n });\n\n options = computed(() => {\n const attribute = this.attribute();\n if (attribute) {\n return (() => {\n walk: {\n const { inputOptionsFromValidation } = attribute.annotations;\n\n if (inputOptionsFromValidation === undefined) {\n break walk;\n }\n\n const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];\n\n if (validator === undefined) {\n break walk;\n }\n\n if (validator.options === undefined) {\n break walk;\n }\n\n return validator.options;\n }\n\n return attribute.validators.options?.options ?? [];\n })();\n }\n return [];\n });\n\n checked(option: string) {\n const valueOrValues = this.valueOrValues();\n if (valueOrValues instanceof Array) {\n return valueOrValues.includes(option);\n }\n return valueOrValues === option;\n }\n\n onChange(event: Event, option: string) {\n const valueOrValues = this.valueOrValues();\n const isChecked = (event.target as HTMLInputElement).checked;\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: (() => {\n if (valueOrValues instanceof Array) {\n const newValues = [...valueOrValues];\n\n if (isChecked) {\n newValues.push(option);\n } else {\n newValues.splice(newValues.indexOf(option), 1);\n }\n\n return newValues;\n }\n\n return (event.target as HTMLInputElement)?.checked ? option : '';\n })()\n });\n }\n\n onBlur() {\n this.dispatchFormAction.emit({\n action: 'focus lost',\n name: this.attribute()?.name ?? '',\n fieldIndex: undefined\n });\n }\n}\n","@let inputType = context()?.inputType;\n@let classInput = context()?.classInput;\n@let classLabel = context()?.classLabel;\n@let classDiv = context()?.classDiv;\n@let attr = attribute();\n@if (attr) {\n @for (option of options(); track option) {\n <div [kcClass]=\"classDiv\">\n <input\n [type]=\"inputType\"\n [id]=\"attr.name + '-' + option\"\n [name]=\"attr.name\"\n [value]=\"option\"\n [kcClass]=\"classInput\"\n [attr.aria-invalid]=\"!!displayableErrors()?.length\"\n [disabled]=\"attr.readOnly\"\n [checked]=\"checked(option)\"\n (change)=\"onChange($event, option)\"\n (blur)=\"onBlur()\"\n />\n <label\n [for]=\"attr.name + '-' + option\"\n [kcClass]=\"[classLabel!, attr.readOnly ? 'kcInputClassRadioCheckboxLabelDisabled' : $any('')]\"\n >\n {{ i18n.advancedMsgStr(option) }}\n </label>\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA8BM,MAAO,wBAAyB,SAAQ,kBAAkB,CAAA;AAnBhE,IAAA,WAAA,GAAA;;AAoBI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAa;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK;qGAAqB;QAC1C,IAAA,CAAA,kBAAkB,GAAG,MAAM,EAAc;AACzC,QAAA,IAAA,CAAA,iBAAiB,GAAG,KAAK;yGAAoB;AACpC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAU,eAAe,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAoC,aAAa,CAAC;AAE3E,QAAA,IAAA,CAAA,OAAO,GAKK,QAAQ,CAAC,MAAK;AACtB,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;YAClC,IAAI,SAAS,EAAE;AACX,gBAAA,MAAM,EAAE,SAAS,EAAE,GAAG,SA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f,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,8BAA8B;AACzD;AACJ,qBAAA,EAAA,QAAA,EAAA,+jCAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AE5BL;;AAEG;;;;"}
|
|
@@ -17,11 +17,16 @@ class InputTagComponent extends ComponentReference {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.i18n = inject(LOGIN_I18N);
|
|
20
|
-
this.attribute = input(
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
this.
|
|
20
|
+
this.attribute = input(/* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [undefined, { debugName: "attribute" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.valueOrValues = input(/* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [undefined, { debugName: "valueOrValues" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.fieldIndex = input(undefined, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "fieldIndex" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.values = input(/* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [undefined, { debugName: "values" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.displayableErrors = input(/* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [undefined, { debugName: "displayableErrors" }] : /* istanbul ignore next */ []));
|
|
25
30
|
this.dispatchFormAction = output();
|
|
26
31
|
this.doUseDefaultCss = inject(USE_DEFAULT_CSS);
|
|
27
32
|
this.classes = inject(LOGIN_CLASSES);
|
|
@@ -35,7 +40,8 @@ class InputTagComponent extends ComponentReference {
|
|
|
35
40
|
return null;
|
|
36
41
|
}
|
|
37
42
|
return valueOrValues ?? null;
|
|
38
|
-
},
|
|
43
|
+
}, /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
39
45
|
}
|
|
40
46
|
onChange(event) {
|
|
41
47
|
const valueOrValues = this.valueOrValues();
|
|
@@ -64,15 +70,15 @@ class InputTagComponent extends ComponentReference {
|
|
|
64
70
|
fieldIndex: this.fieldIndex()
|
|
65
71
|
});
|
|
66
72
|
}
|
|
67
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
68
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: InputTagComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: InputTagComponent, isStandalone: true, selector: "kc-input-tag", inputs: { attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: false, transformFunction: null }, valueOrValues: { classPropertyName: "valueOrValues", publicName: "valueOrValues", isSignal: true, isRequired: false, transformFunction: null }, fieldIndex: { classPropertyName: "fieldIndex", publicName: "fieldIndex", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, displayableErrors: { classPropertyName: "displayableErrors", publicName: "displayableErrors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dispatchFormAction: "dispatchFormAction" }, providers: [
|
|
69
75
|
{
|
|
70
76
|
provide: ComponentReference,
|
|
71
77
|
useExisting: forwardRef(() => InputTagComponent)
|
|
72
78
|
}
|
|
73
79
|
], usesInheritance: true, ngImport: i0, template: "@let attr = attribute();\n@let index = fieldIndex();\n@if (attr) {\n <input\n [type]=\"attr.annotations.inputType | inputType\"\n [id]=\"attr.name\"\n [name]=\"attr.name\"\n [value]=\"value()\"\n [kcClass]=\"'kcInputClass'\"\n [attr.aria-invalid]=\"index && displayableErrors()?.[index] !== undefined\"\n [disabled]=\"attr.readOnly\"\n [autocomplete]=\"attr.autocomplete\"\n [placeholder]=\"i18n.advancedMsgStr(attr.annotations.inputTypePlaceholder ?? '')\"\n [attr.pattern]=\"attr.annotations.inputTypePattern\"\n [attr.size]=\"\n !attr.annotations.inputTypeSize\n ? undefined\n : (attr.annotations.inputTypeSize | toNumber) === 0\n ? undefined\n : (attr.annotations.inputTypeSize | toNumber)\n \"\n [attr.maxlength]=\"!attr.annotations.inputTypeMaxlength ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)\"\n [attr.minlength]=\"!attr.annotations.inputTypeMinlength ? undefined : (attr.annotations.inputTypeMinlength | toNumber)\"\n [attr.max]=\"attr.annotations.inputTypeMax\"\n [attr.min]=\"attr.annotations.inputTypeMin\"\n [attr.step]=\"attr.annotations.inputTypeStep\"\n [kcAttributes]=\"attr.html5DataAnnotations\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (index !== undefined) {\n @let values = valueOrValues() ?? [] | toArray;\n <kc-field-errors\n [attribute]=\"attr\"\n [displayableErrors]=\"displayableErrors()\"\n [fieldIndex]=\"index\"\n />\n <kc-add-remove-buttons-multi-valued-attribute\n [attribute]=\"attr\"\n [values]=\"values\"\n [fieldIndex]=\"index\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n}\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: KcClassDirective, selector: "[kcClass]", inputs: ["class", "ngClass", "kcClass"] }, { kind: "directive", type: AttributesDirective, selector: "[kcAttributes]", inputs: ["kcAttributes"] }, { kind: "component", type: FieldErrorsComponent, selector: "kc-field-errors", inputs: ["attribute", "displayableErrors", "fieldIndex"] }, { kind: "component", type: AddRemoveButtonsMultiValuedAttributeComponent, selector: "kc-add-remove-buttons-multi-valued-attribute", inputs: ["attribute", "values", "fieldIndex"], outputs: ["dispatchFormAction"] }, { kind: "pipe", type: InputTypePipe, name: "inputType" }, { kind: "pipe", type: ToNumberPipe, name: "toNumber" }, { kind: "pipe", type: ToArrayPipe, name: "toArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
74
80
|
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: InputTagComponent, decorators: [{
|
|
76
82
|
type: Component,
|
|
77
83
|
args: [{ imports: [
|
|
78
84
|
InputTypePipe,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-components-input-tag.mjs","sources":["../../src/login/components/input-tag/input-tag.component.ts","../../src/login/components/input-tag/input-tag.component.html","../../src/login/components/input-tag/keycloakify-angular-login-components-input-tag.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { AttributesDirective } from '@keycloakify/angular/lib/directives/attributes';\nimport { InputTypePipe } from '@keycloakify/angular/lib/pipes/input-type';\nimport { ToArrayPipe } from '@keycloakify/angular/lib/pipes/to-array';\nimport { ToNumberPipe } from '@keycloakify/angular/lib/pipes/to-number';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { AddRemoveButtonsMultiValuedAttributeComponent } from '@keycloakify/angular/login/components/add-remove-buttons-multi-valued-attribute';\nimport { FieldErrorsComponent } from '@keycloakify/angular/login/components/field-errors';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\nimport { type FormAction, type FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [\n InputTypePipe,\n KcClassDirective,\n ToNumberPipe,\n AttributesDirective,\n ToArrayPipe,\n FieldErrorsComponent,\n AddRemoveButtonsMultiValuedAttributeComponent\n ],\n selector: 'kc-input-tag',\n templateUrl: 'input-tag.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => InputTagComponent)\n }\n ]\n})\nexport class InputTagComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n valueOrValues = input<string | string[]>();\n fieldIndex = input<number | undefined>(undefined);\n values = input<string[]>();\n displayableErrors = input<FormFieldError[]>();\n dispatchFormAction = output<FormAction>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n\n value = computed(() => {\n const valueOrValues = this.valueOrValues();\n const index = this.fieldIndex();\n if (valueOrValues instanceof Array) {\n if (index) {\n return valueOrValues[index] ?? null;\n }\n return null;\n }\n return valueOrValues ?? null;\n });\n\n onChange(event: Event) {\n const valueOrValues = this.valueOrValues();\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: (() => {\n if (this.fieldIndex !== undefined) {\n if (valueOrValues instanceof Array) {\n return valueOrValues.map((value, i) => {\n if (i === this.fieldIndex()) {\n return (event.target as HTMLInputElement)?.value;\n }\n\n return value;\n });\n }\n }\n\n return (event.target as HTMLInputElement)?.value;\n })()\n });\n }\n\n onBlur() {\n this.dispatchFormAction.emit({\n action: 'focus lost',\n name: this.attribute()?.name ?? '',\n fieldIndex: this.fieldIndex()\n });\n }\n}\n","@let attr = attribute();\n@let index = fieldIndex();\n@if (attr) {\n <input\n [type]=\"attr.annotations.inputType | inputType\"\n [id]=\"attr.name\"\n [name]=\"attr.name\"\n [value]=\"value()\"\n [kcClass]=\"'kcInputClass'\"\n [attr.aria-invalid]=\"index && displayableErrors()?.[index] !== undefined\"\n [disabled]=\"attr.readOnly\"\n [autocomplete]=\"attr.autocomplete\"\n [placeholder]=\"i18n.advancedMsgStr(attr.annotations.inputTypePlaceholder ?? '')\"\n [attr.pattern]=\"attr.annotations.inputTypePattern\"\n [attr.size]=\"\n !attr.annotations.inputTypeSize\n ? undefined\n : (attr.annotations.inputTypeSize | toNumber) === 0\n ? undefined\n : (attr.annotations.inputTypeSize | toNumber)\n \"\n [attr.maxlength]=\"!attr.annotations.inputTypeMaxlength ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)\"\n [attr.minlength]=\"!attr.annotations.inputTypeMinlength ? undefined : (attr.annotations.inputTypeMinlength | toNumber)\"\n [attr.max]=\"attr.annotations.inputTypeMax\"\n [attr.min]=\"attr.annotations.inputTypeMin\"\n [attr.step]=\"attr.annotations.inputTypeStep\"\n [kcAttributes]=\"attr.html5DataAnnotations\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (index !== undefined) {\n @let values = valueOrValues() ?? [] | toArray;\n <kc-field-errors\n [attribute]=\"attr\"\n [displayableErrors]=\"displayableErrors()\"\n [fieldIndex]=\"index\"\n />\n <kc-add-remove-buttons-multi-valued-attribute\n [attribute]=\"attr\"\n [values]=\"values\"\n [fieldIndex]=\"index\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4CM,MAAO,iBAAkB,SAAQ,kBAAkB,CAAA;AA3BzD,IAAA,WAAA,GAAA;;AA4BI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;QAC/B,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,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AA,EAAA,WAAA,EAAA,IAAA,EAEnB,oBAAoB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,mBAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACpB,6CAA6C,EAAA,QAAA,EAAA,8CAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,QAAA,EAAA,YAAA,CAAA,EAAA,OAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAN7C,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAEb,YAAY,4CAEZ,WAAW,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAcN,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBA3B7B,SAAS;AAQG,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACL,aAAa;wBACb,gBAAgB;wBAChB,YAAY;wBACZ,mBAAmB;wBACnB,WAAW;wBACX,oBAAoB;wBACpB;AACH,qBAAA,EAAA,QAAA,EACS,cAAc,EAAA,eAAA,EAEP,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB;AAClD;AACJ,qBAAA,EAAA,QAAA,EAAA,k4DAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AE1CL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-components-input-tag.mjs","sources":["../../src/login/components/input-tag/input-tag.component.ts","../../src/login/components/input-tag/input-tag.component.html","../../src/login/components/input-tag/keycloakify-angular-login-components-input-tag.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, output } from '@angular/core';\nimport { AttributesDirective } from '@keycloakify/angular/lib/directives/attributes';\nimport { InputTypePipe } from '@keycloakify/angular/lib/pipes/input-type';\nimport { ToArrayPipe } from '@keycloakify/angular/lib/pipes/to-array';\nimport { ToNumberPipe } from '@keycloakify/angular/lib/pipes/to-number';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { AddRemoveButtonsMultiValuedAttributeComponent } from '@keycloakify/angular/login/components/add-remove-buttons-multi-valued-attribute';\nimport { FieldErrorsComponent } from '@keycloakify/angular/login/components/field-errors';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\nimport { type FormAction, type FormFieldError } from '@keycloakify/angular/login/services/user-profile-form';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport type { Attribute } from 'keycloakify/login/KcContext';\nimport type { ClassKey } from 'keycloakify/login/lib/kcClsx';\n\n@Component({\n styles: [\n `\n :host {\n display: contents;\n }\n `\n ],\n imports: [\n InputTypePipe,\n KcClassDirective,\n ToNumberPipe,\n AttributesDirective,\n ToArrayPipe,\n FieldErrorsComponent,\n AddRemoveButtonsMultiValuedAttributeComponent\n ],\n selector: 'kc-input-tag',\n templateUrl: 'input-tag.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => InputTagComponent)\n }\n ]\n})\nexport class InputTagComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n attribute = input<Attribute>();\n valueOrValues = input<string | string[]>();\n fieldIndex = input<number | undefined>(undefined);\n values = input<string[]>();\n displayableErrors = input<FormFieldError[]>();\n dispatchFormAction = output<FormAction>();\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n\n value = computed(() => {\n const valueOrValues = this.valueOrValues();\n const index = this.fieldIndex();\n if (valueOrValues instanceof Array) {\n if (index) {\n return valueOrValues[index] ?? null;\n }\n return null;\n }\n return valueOrValues ?? null;\n });\n\n onChange(event: Event) {\n const valueOrValues = this.valueOrValues();\n this.dispatchFormAction.emit({\n action: 'update',\n name: this.attribute()?.name ?? '',\n valueOrValues: (() => {\n if (this.fieldIndex !== undefined) {\n if (valueOrValues instanceof Array) {\n return valueOrValues.map((value, i) => {\n if (i === this.fieldIndex()) {\n return (event.target as HTMLInputElement)?.value;\n }\n\n return value;\n });\n }\n }\n\n return (event.target as HTMLInputElement)?.value;\n })()\n });\n }\n\n onBlur() {\n this.dispatchFormAction.emit({\n action: 'focus lost',\n name: this.attribute()?.name ?? '',\n fieldIndex: this.fieldIndex()\n });\n }\n}\n","@let attr = attribute();\n@let index = fieldIndex();\n@if (attr) {\n <input\n [type]=\"attr.annotations.inputType | inputType\"\n [id]=\"attr.name\"\n [name]=\"attr.name\"\n [value]=\"value()\"\n [kcClass]=\"'kcInputClass'\"\n [attr.aria-invalid]=\"index && displayableErrors()?.[index] !== undefined\"\n [disabled]=\"attr.readOnly\"\n [autocomplete]=\"attr.autocomplete\"\n [placeholder]=\"i18n.advancedMsgStr(attr.annotations.inputTypePlaceholder ?? '')\"\n [attr.pattern]=\"attr.annotations.inputTypePattern\"\n [attr.size]=\"\n !attr.annotations.inputTypeSize\n ? undefined\n : (attr.annotations.inputTypeSize | toNumber) === 0\n ? undefined\n : (attr.annotations.inputTypeSize | toNumber)\n \"\n [attr.maxlength]=\"!attr.annotations.inputTypeMaxlength ? undefined : (attr.annotations.inputTypeMaxlength | toNumber)\"\n [attr.minlength]=\"!attr.annotations.inputTypeMinlength ? undefined : (attr.annotations.inputTypeMinlength | toNumber)\"\n [attr.max]=\"attr.annotations.inputTypeMax\"\n [attr.min]=\"attr.annotations.inputTypeMin\"\n [attr.step]=\"attr.annotations.inputTypeStep\"\n [kcAttributes]=\"attr.html5DataAnnotations\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (index !== undefined) {\n @let values = valueOrValues() ?? [] | toArray;\n <kc-field-errors\n [attribute]=\"attr\"\n [displayableErrors]=\"displayableErrors()\"\n [fieldIndex]=\"index\"\n />\n <kc-add-remove-buttons-multi-valued-attribute\n [attribute]=\"attr\"\n [values]=\"values\"\n [fieldIndex]=\"index\"\n (dispatchFormAction)=\"dispatchFormAction.emit($event)\"\n />\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4CM,MAAO,iBAAkB,SAAQ,kBAAkB,CAAA;AA3BzD,IAAA,WAAA,GAAA;;AA4BI,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAa;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK;qGAAqB;QAC1C,IAAA,CAAA,UAAU,GAAG,KAAK,CAAqB,SAAS;uFAAC;AACjD,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK;8FAAY;AAC1B,QAAA,IAAA,CAAA,iBAAiB,GAAG,KAAK;yGAAoB;QAC7C,IAAA,CAAA,kBAAkB,GAAG,MAAM,EAAc;AAChC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAU,eAAe,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAoC,aAAa,CAAC;AAE3E,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,MAAK;AAClB,YAAA,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE;AAC1C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE;AAC/B,YAAA,IAAI,aAAa,YAAY,KAAK,EAAE;gBACh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