UNPKG

@edugouvfr/ngx-dsfr

Version:

NgxDsfr est un portage Angular des éléments d'interface du Système de Design de l'État Français (DSFR).

88 lines 19 kB
import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { DefaultControlComponent, newUniqueId } from '../../shared'; import * as i0 from "@angular/core"; import * as i1 from "../../shared"; import * as i2 from "@angular/common"; import * as i3 from "@angular/forms"; import * as i4 from "../../components/link/link.component"; export class DsfrFormPasswordComponent extends DefaultControlComponent { /** @internal */ constructor(i18n) { super(); this.i18n = i18n; /** @since 1.6 'current-password' par défaut */ this.autocomplete = 'current-password'; /** Propage l'évènement Event du DOM à la sélection d'un lien. */ this.recoveryRouteSelect = new EventEmitter(); this.label = i18n.t('password.label'); } /** @internal */ ngOnInit() { super.ngOnInit(); this.checkboxId = newUniqueId(); this.messagesGroupId = newUniqueId(); } /** @internal */ getIdRule(rule, i) { let status = 'info'; if (rule.onError === false) { status = 'error'; } else if (rule.onError === true) { status = 'error'; } return `password-${this.inputId}-input-message-${status}-${i}`; } /** @internal */ hasRecovery() { return this.recoveryLink || this.recoveryRoute || this.recoveryRouterLink; } /** @internal */ onRecovery(route) { if (this.recoveryRoute) { this.recoveryRouteSelect.emit(this.recoveryRoute); } } /** @internal */ hasMessages() { return this.validationRules && this.validationRules.length > 0; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DsfrFormPasswordComponent, deps: [{ token: i1.I18nService }], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DsfrFormPasswordComponent, selector: "dsfr-form-password", inputs: { autocomplete: "autocomplete", validationRules: "validationRules", recoveryLink: "recoveryLink", recoveryTargetLink: "recoveryTargetLink", recoveryRouterLink: "recoveryRouterLink", recoveryRouterLinkActive: "recoveryRouterLinkActive", recoveryRouterLinkExtras: "recoveryRouterLinkExtras", recoveryRoute: "recoveryRoute" }, outputs: { recoveryRouteSelect: "recoveryRouteSelect" }, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: DsfrFormPasswordComponent, multi: true, }, ], usesInheritance: true, ngImport: i0, template: "<div class=\"fr-password\">\n <label class=\"fr-label\" [for]=\"inputId\">\n {{ label }}\n <span *ngIf=\"hint\" class=\"fr-hint-text\">{{ hint }}</span>\n </label>\n\n <div class=\"fr-input-wrap\">\n <input\n class=\"fr-password__input fr-input\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n [attr.aria-describedby]=\"hasMessages() ? messagesGroupId : null\"\n aria-required=\"true\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled ?? false\"\n [attr.name]=\"name || null\"\n [autocomplete]=\"autocomplete\"\n [id]=\"inputId\"\n type=\"password\" />\n </div>\n\n <div *ngIf=\"hasMessages()\" class=\"fr-messages-group\" [id]=\"messagesGroupId\" aria-live=\"polite\">\n <p class=\"fr-message\">{{ i18n.t('password.message') }}</p>\n <p\n class=\"fr-message\"\n [id]=\"getIdRule(rule, i)\"\n [ngClass]=\"{\n 'fr-message--error': rule.onError,\n 'fr-message--info': rule.onError === undefined,\n 'fr-message--valid': rule.onError === false\n }\"\n *ngFor=\"let rule of validationRules; let i = index\">\n {{ rule.message }}\n </p>\n </div>\n\n <div class=\"fr-password__checkbox fr-checkbox-group fr-checkbox-group--sm\">\n <input [attr.aria-label]=\"i18n.t('password.aria.label')\" [id]=\"checkboxId\" type=\"checkbox\" />\n <label class=\"fr-password__checkbox fr-label\" [for]=\"checkboxId\"> {{ i18n.t('password.show') }} </label>\n </div>\n\n <p *ngIf=\"hasRecovery()\">\n <dsfr-link\n [label]=\"i18n.t('password.forgotPassword')\"\n [link]=\"recoveryLink\"\n [targetLink]=\"recoveryTargetLink\"\n [route]=\"recoveryRoute\"\n [routePath]=\"recoveryRouterLink\"\n [routerLinkActive]=\"recoveryRouterLinkActive ?? ''\"\n [routerLinkExtras]=\"recoveryRouterLinkExtras\"\n (linkSelect)=\"onRecovery($event)\"></dsfr-link>\n </p>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.DsfrLinkComponent, selector: "dsfr-link", inputs: ["ariaCurrent", "ariaLabel", "ariaControls", "customClass", "disabled", "icon", "iconPosition", "linkId", "label", "link", "linkTarget", "route", "routePath", "routerLinkActive", "routerLinkActiveOptions", "routerLinkExtras", "size", "tooltipMessage", "mode", "targetLink", "routerLink"], outputs: ["linkSelect"] }], encapsulation: i0.ViewEncapsulation.None }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DsfrFormPasswordComponent, decorators: [{ type: Component, args: [{ selector: 'dsfr-form-password', encapsulation: ViewEncapsulation.None, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: DsfrFormPasswordComponent, multi: true, }, ], template: "<div class=\"fr-password\">\n <label class=\"fr-label\" [for]=\"inputId\">\n {{ label }}\n <span *ngIf=\"hint\" class=\"fr-hint-text\">{{ hint }}</span>\n </label>\n\n <div class=\"fr-input-wrap\">\n <input\n class=\"fr-password__input fr-input\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n [attr.aria-describedby]=\"hasMessages() ? messagesGroupId : null\"\n aria-required=\"true\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled ?? false\"\n [attr.name]=\"name || null\"\n [autocomplete]=\"autocomplete\"\n [id]=\"inputId\"\n type=\"password\" />\n </div>\n\n <div *ngIf=\"hasMessages()\" class=\"fr-messages-group\" [id]=\"messagesGroupId\" aria-live=\"polite\">\n <p class=\"fr-message\">{{ i18n.t('password.message') }}</p>\n <p\n class=\"fr-message\"\n [id]=\"getIdRule(rule, i)\"\n [ngClass]=\"{\n 'fr-message--error': rule.onError,\n 'fr-message--info': rule.onError === undefined,\n 'fr-message--valid': rule.onError === false\n }\"\n *ngFor=\"let rule of validationRules; let i = index\">\n {{ rule.message }}\n </p>\n </div>\n\n <div class=\"fr-password__checkbox fr-checkbox-group fr-checkbox-group--sm\">\n <input [attr.aria-label]=\"i18n.t('password.aria.label')\" [id]=\"checkboxId\" type=\"checkbox\" />\n <label class=\"fr-password__checkbox fr-label\" [for]=\"checkboxId\"> {{ i18n.t('password.show') }} </label>\n </div>\n\n <p *ngIf=\"hasRecovery()\">\n <dsfr-link\n [label]=\"i18n.t('password.forgotPassword')\"\n [link]=\"recoveryLink\"\n [targetLink]=\"recoveryTargetLink\"\n [route]=\"recoveryRoute\"\n [routePath]=\"recoveryRouterLink\"\n [routerLinkActive]=\"recoveryRouterLinkActive ?? ''\"\n [routerLinkExtras]=\"recoveryRouterLinkExtras\"\n (linkSelect)=\"onRecovery($event)\"></dsfr-link>\n </p>\n</div>\n" }] }], ctorParameters: function () { return [{ type: i1.I18nService }]; }, propDecorators: { autocomplete: [{ type: Input }], validationRules: [{ type: Input }], recoveryLink: [{ type: Input }], recoveryTargetLink: [{ type: Input }], recoveryRouterLink: [{ type: Input }], recoveryRouterLinkActive: [{ type: Input }], recoveryRouterLinkExtras: [{ type: Input }], recoveryRoute: [{ type: Input }], recoveryRouteSelect: [{ type: Output }] } }); //# sourceMappingUR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