ng-prime-tools 1.0.88 → 1.0.89
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.
|
@@ -7355,6 +7355,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
7355
7355
|
}]
|
|
7356
7356
|
}] });
|
|
7357
7357
|
|
|
7358
|
+
const applyChangePasswordCardDefaults = (config) => {
|
|
7359
|
+
config.title = {
|
|
7360
|
+
text: 'Changer le mot de passe',
|
|
7361
|
+
position: 'center',
|
|
7362
|
+
color: '#333',
|
|
7363
|
+
fontSize: '24px',
|
|
7364
|
+
...config.title,
|
|
7365
|
+
};
|
|
7366
|
+
config.logoUrl = {
|
|
7367
|
+
altText: 'Logo',
|
|
7368
|
+
imageUrl: '',
|
|
7369
|
+
width: '100px',
|
|
7370
|
+
height: 'auto',
|
|
7371
|
+
...config.logoUrl,
|
|
7372
|
+
};
|
|
7373
|
+
config.footer = {
|
|
7374
|
+
version: 'V1.0',
|
|
7375
|
+
copyright: 'Your Company © 2026',
|
|
7376
|
+
...config.footer,
|
|
7377
|
+
};
|
|
7378
|
+
config.changePassword = {
|
|
7379
|
+
currentPassword: config.changePassword?.currentPassword ?? '',
|
|
7380
|
+
newPassword: config.changePassword?.newPassword ?? '',
|
|
7381
|
+
confirmationPassword: config.changePassword?.confirmationPassword ?? '',
|
|
7382
|
+
};
|
|
7383
|
+
config.changePasswordCardConfig = {
|
|
7384
|
+
noBorder: true,
|
|
7385
|
+
width: '480px',
|
|
7386
|
+
padding: '40px',
|
|
7387
|
+
...config.changePasswordCardConfig,
|
|
7388
|
+
};
|
|
7389
|
+
config.showCurrentPasswordField = config.showCurrentPasswordField ?? false;
|
|
7390
|
+
config.showPasswordStrength = config.showPasswordStrength ?? true;
|
|
7391
|
+
config.newPasswordField = {
|
|
7392
|
+
name: 'newPassword',
|
|
7393
|
+
label: 'Nouveau mot de passe',
|
|
7394
|
+
required: true,
|
|
7395
|
+
placeholder: 'Saisir le nouveau mot de passe',
|
|
7396
|
+
type: FormInputTypeEnum.PASSWORD,
|
|
7397
|
+
toggleMask: true,
|
|
7398
|
+
feedback: false,
|
|
7399
|
+
...config.newPasswordField,
|
|
7400
|
+
};
|
|
7401
|
+
config.confirmationPasswordField = {
|
|
7402
|
+
name: 'confirmationPassword',
|
|
7403
|
+
label: 'Confirmer le mot de passe',
|
|
7404
|
+
required: true,
|
|
7405
|
+
placeholder: 'Confirmer le nouveau mot de passe',
|
|
7406
|
+
type: FormInputTypeEnum.PASSWORD,
|
|
7407
|
+
toggleMask: true,
|
|
7408
|
+
feedback: false,
|
|
7409
|
+
...config.confirmationPasswordField,
|
|
7410
|
+
};
|
|
7411
|
+
if (config.showCurrentPasswordField) {
|
|
7412
|
+
config.currentPasswordField = {
|
|
7413
|
+
name: 'currentPassword',
|
|
7414
|
+
label: 'Mot de passe actuel',
|
|
7415
|
+
required: true,
|
|
7416
|
+
placeholder: 'Saisir le mot de passe actuel',
|
|
7417
|
+
type: FormInputTypeEnum.PASSWORD,
|
|
7418
|
+
toggleMask: true,
|
|
7419
|
+
feedback: false,
|
|
7420
|
+
...config.currentPasswordField,
|
|
7421
|
+
};
|
|
7422
|
+
}
|
|
7423
|
+
config.buttonConfig = {
|
|
7424
|
+
label: 'Changer le mot de passe',
|
|
7425
|
+
type: 'submit',
|
|
7426
|
+
icon: 'pi pi-lock',
|
|
7427
|
+
iconPos: 'left',
|
|
7428
|
+
styleClass: 'p-button-primary',
|
|
7429
|
+
disabled: true,
|
|
7430
|
+
width: '100%',
|
|
7431
|
+
...config.buttonConfig,
|
|
7432
|
+
};
|
|
7433
|
+
config.passwordPolicyRules = config.passwordPolicyRules ?? [];
|
|
7434
|
+
config.additionalContent = config.additionalContent ?? [];
|
|
7435
|
+
};
|
|
7436
|
+
|
|
7358
7437
|
class PTChangePasswordCardComponent {
|
|
7359
7438
|
constructor(formBuilder) {
|
|
7360
7439
|
this.formBuilder = formBuilder;
|
|
@@ -7362,14 +7441,29 @@ class PTChangePasswordCardComponent {
|
|
|
7362
7441
|
this.passwordValueChange = new EventEmitter();
|
|
7363
7442
|
this.changePasswordSubmit = new EventEmitter();
|
|
7364
7443
|
this.destroy$ = new Subject();
|
|
7444
|
+
this.initialized = false;
|
|
7365
7445
|
this.formGroup = this.formBuilder.group({}, {
|
|
7366
7446
|
validators: [this.passwordMatchValidator()],
|
|
7367
7447
|
});
|
|
7368
7448
|
}
|
|
7369
7449
|
ngOnInit() {
|
|
7370
|
-
this.
|
|
7450
|
+
applyChangePasswordCardDefaults(this.changePasswordPageConfig);
|
|
7371
7451
|
this.setupFormFields();
|
|
7372
7452
|
this.listenToPasswordChanges();
|
|
7453
|
+
this.initialized = true;
|
|
7454
|
+
this.updateButtonDisabledState();
|
|
7455
|
+
}
|
|
7456
|
+
ngOnChanges(changes) {
|
|
7457
|
+
const configChange = changes['changePasswordPageConfig'];
|
|
7458
|
+
if (!configChange?.currentValue || !this.initialized) {
|
|
7459
|
+
return;
|
|
7460
|
+
}
|
|
7461
|
+
applyChangePasswordCardDefaults(this.changePasswordPageConfig);
|
|
7462
|
+
/*
|
|
7463
|
+
* The parent recreates the configuration after calculating
|
|
7464
|
+
* passwordPolicyRules. Therefore the button must be recalculated
|
|
7465
|
+
* each time the input configuration changes.
|
|
7466
|
+
*/
|
|
7373
7467
|
this.updateButtonDisabledState();
|
|
7374
7468
|
}
|
|
7375
7469
|
ngOnDestroy() {
|
|
@@ -7388,6 +7482,10 @@ class PTChangePasswordCardComponent {
|
|
|
7388
7482
|
}
|
|
7389
7483
|
onSubmit() {
|
|
7390
7484
|
this.formGroup.markAllAsTouched();
|
|
7485
|
+
this.formGroup.updateValueAndValidity({
|
|
7486
|
+
emitEvent: false,
|
|
7487
|
+
});
|
|
7488
|
+
this.updateButtonDisabledState();
|
|
7391
7489
|
if (!this.formGroup.valid) {
|
|
7392
7490
|
this.changePasswordPageConfig.errorMessage =
|
|
7393
7491
|
this.changePasswordPageConfig.emptyFieldsErrorMessage ??
|
|
@@ -7408,89 +7506,6 @@ class PTChangePasswordCardComponent {
|
|
|
7408
7506
|
item.styleClass ?? '',
|
|
7409
7507
|
].filter(Boolean);
|
|
7410
7508
|
}
|
|
7411
|
-
initializeDefaults() {
|
|
7412
|
-
this.changePasswordPageConfig.title = {
|
|
7413
|
-
text: 'Changer le mot de passe',
|
|
7414
|
-
position: 'center',
|
|
7415
|
-
color: '#333',
|
|
7416
|
-
fontSize: '24px',
|
|
7417
|
-
...this.changePasswordPageConfig.title,
|
|
7418
|
-
};
|
|
7419
|
-
this.changePasswordPageConfig.logoUrl = {
|
|
7420
|
-
altText: 'Logo',
|
|
7421
|
-
imageUrl: '',
|
|
7422
|
-
width: '100px',
|
|
7423
|
-
height: 'auto',
|
|
7424
|
-
...this.changePasswordPageConfig.logoUrl,
|
|
7425
|
-
};
|
|
7426
|
-
this.changePasswordPageConfig.footer = {
|
|
7427
|
-
version: 'V1.0',
|
|
7428
|
-
copyright: 'Your Company © 2026',
|
|
7429
|
-
...this.changePasswordPageConfig.footer,
|
|
7430
|
-
};
|
|
7431
|
-
this.changePasswordPageConfig.changePassword = {
|
|
7432
|
-
currentPassword: this.changePasswordPageConfig.changePassword?.currentPassword ?? '',
|
|
7433
|
-
newPassword: this.changePasswordPageConfig.changePassword?.newPassword ?? '',
|
|
7434
|
-
confirmationPassword: this.changePasswordPageConfig.changePassword?.confirmationPassword ??
|
|
7435
|
-
'',
|
|
7436
|
-
};
|
|
7437
|
-
this.changePasswordPageConfig.changePasswordCardConfig = {
|
|
7438
|
-
noBorder: true,
|
|
7439
|
-
width: '480px',
|
|
7440
|
-
padding: '40px',
|
|
7441
|
-
...this.changePasswordPageConfig.changePasswordCardConfig,
|
|
7442
|
-
};
|
|
7443
|
-
this.changePasswordPageConfig.showCurrentPasswordField =
|
|
7444
|
-
this.changePasswordPageConfig.showCurrentPasswordField ?? false;
|
|
7445
|
-
this.changePasswordPageConfig.showPasswordStrength =
|
|
7446
|
-
this.changePasswordPageConfig.showPasswordStrength ?? true;
|
|
7447
|
-
this.changePasswordPageConfig.newPasswordField = {
|
|
7448
|
-
name: 'newPassword',
|
|
7449
|
-
label: 'Nouveau mot de passe',
|
|
7450
|
-
required: true,
|
|
7451
|
-
placeholder: 'Saisir le nouveau mot de passe',
|
|
7452
|
-
type: FormInputTypeEnum.PASSWORD,
|
|
7453
|
-
toggleMask: true,
|
|
7454
|
-
feedback: false,
|
|
7455
|
-
...this.changePasswordPageConfig.newPasswordField,
|
|
7456
|
-
};
|
|
7457
|
-
this.changePasswordPageConfig.confirmationPasswordField = {
|
|
7458
|
-
name: 'confirmationPassword',
|
|
7459
|
-
label: 'Confirmer le mot de passe',
|
|
7460
|
-
required: true,
|
|
7461
|
-
placeholder: 'Confirmer le nouveau mot de passe',
|
|
7462
|
-
type: FormInputTypeEnum.PASSWORD,
|
|
7463
|
-
toggleMask: true,
|
|
7464
|
-
feedback: false,
|
|
7465
|
-
...this.changePasswordPageConfig.confirmationPasswordField,
|
|
7466
|
-
};
|
|
7467
|
-
if (this.changePasswordPageConfig.showCurrentPasswordField) {
|
|
7468
|
-
this.changePasswordPageConfig.currentPasswordField = {
|
|
7469
|
-
name: 'currentPassword',
|
|
7470
|
-
label: 'Mot de passe actuel',
|
|
7471
|
-
required: true,
|
|
7472
|
-
placeholder: 'Saisir le mot de passe actuel',
|
|
7473
|
-
type: FormInputTypeEnum.PASSWORD,
|
|
7474
|
-
toggleMask: true,
|
|
7475
|
-
feedback: false,
|
|
7476
|
-
...this.changePasswordPageConfig.currentPasswordField,
|
|
7477
|
-
};
|
|
7478
|
-
}
|
|
7479
|
-
this.changePasswordPageConfig.buttonConfig = {
|
|
7480
|
-
label: 'Changer le mot de passe',
|
|
7481
|
-
type: 'submit',
|
|
7482
|
-
icon: 'pi pi-lock',
|
|
7483
|
-
iconPos: 'left',
|
|
7484
|
-
styleClass: 'p-button-primary',
|
|
7485
|
-
disabled: true,
|
|
7486
|
-
width: '100%',
|
|
7487
|
-
...this.changePasswordPageConfig.buttonConfig,
|
|
7488
|
-
};
|
|
7489
|
-
this.changePasswordPageConfig.passwordPolicyRules =
|
|
7490
|
-
this.changePasswordPageConfig.passwordPolicyRules ?? [];
|
|
7491
|
-
this.changePasswordPageConfig.additionalContent =
|
|
7492
|
-
this.changePasswordPageConfig.additionalContent ?? [];
|
|
7493
|
-
}
|
|
7494
7509
|
setupFormFields() {
|
|
7495
7510
|
const changePassword = this.changePasswordPageConfig.changePassword;
|
|
7496
7511
|
if (this.changePasswordPageConfig.showCurrentPasswordField) {
|
|
@@ -7504,13 +7519,19 @@ class PTChangePasswordCardComponent {
|
|
|
7504
7519
|
}
|
|
7505
7520
|
listenToPasswordChanges() {
|
|
7506
7521
|
this.formGroup.valueChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
7507
|
-
const changePasswordModel = this.buildChangePasswordModel();
|
|
7508
|
-
this.changePasswordPageConfig.changePassword = changePasswordModel;
|
|
7509
|
-
this.passwordValueChange.emit(changePasswordModel);
|
|
7510
7522
|
this.formGroup.updateValueAndValidity({
|
|
7511
7523
|
emitEvent: false,
|
|
7512
7524
|
});
|
|
7513
|
-
|
|
7525
|
+
/*
|
|
7526
|
+
* First synchronize the local form state.
|
|
7527
|
+
*/
|
|
7528
|
+
const changePasswordModel = this.buildChangePasswordModel();
|
|
7529
|
+
this.changePasswordPageConfig.changePassword = changePasswordModel;
|
|
7530
|
+
/*
|
|
7531
|
+
* The parent will compute the policy state and replace the config.
|
|
7532
|
+
* ngOnChanges() then recalculates disabled status with fresh rules.
|
|
7533
|
+
*/
|
|
7534
|
+
this.passwordValueChange.emit(changePasswordModel);
|
|
7514
7535
|
});
|
|
7515
7536
|
this.formGroup.statusChanges
|
|
7516
7537
|
.pipe(takeUntil(this.destroy$))
|
|
@@ -7553,6 +7574,9 @@ class PTChangePasswordCardComponent {
|
|
|
7553
7574
|
.every((rule) => rule.valid === true);
|
|
7554
7575
|
}
|
|
7555
7576
|
updateButtonDisabledState() {
|
|
7577
|
+
if (!this.changePasswordPageConfig?.buttonConfig) {
|
|
7578
|
+
return;
|
|
7579
|
+
}
|
|
7556
7580
|
const isFormValid = this.formGroup.valid;
|
|
7557
7581
|
const arePoliciesValid = this.areFrontendPasswordPolicyRulesValid();
|
|
7558
7582
|
this.changePasswordPageConfig.buttonConfig = {
|
|
@@ -7561,7 +7585,7 @@ class PTChangePasswordCardComponent {
|
|
|
7561
7585
|
};
|
|
7562
7586
|
}
|
|
7563
7587
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTChangePasswordCardComponent, deps: [{ token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7564
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTChangePasswordCardComponent, isStandalone: true, selector: "pt-change-password-card", inputs: { changePasswordPageConfig: "changePasswordPageConfig", changePasswordErrorMessage: "changePasswordErrorMessage" }, outputs: { passwordValueChange: "passwordValueChange", changePasswordSubmit: "changePasswordSubmit" }, ngImport: i0, template: "<pt-card [config]=\"changePasswordPageConfig.changePasswordCardConfig!\">\n @if (changePasswordPageConfig.logoUrl?.imageUrl) {\n <div class=\"logo-container\">\n <img\n [src]=\"changePasswordPageConfig.logoUrl?.imageUrl\"\n [alt]=\"changePasswordPageConfig.logoUrl?.altText || 'Logo'\"\n [style.width]=\"changePasswordPageConfig.logoUrl?.width || '100px'\"\n [style.height]=\"changePasswordPageConfig.logoUrl?.height || 'auto'\"\n />\n </div>\n }\n\n <div class=\"title-container\">\n <h1\n [ngStyle]=\"{\n color: changePasswordPageConfig.title?.color || '#333',\n 'font-size': changePasswordPageConfig.title?.fontSize || '24px',\n }\"\n >\n {{ changePasswordPageConfig.title?.text || \"Changer le mot de passe\" }}\n </h1>\n </div>\n\n @if (changePasswordErrorMessage) {\n <div class=\"error-message\" role=\"alert\">\n {{ changePasswordErrorMessage }}\n </div>\n }\n\n <form class=\"form-container\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\n @if (changePasswordPageConfig.errorMessage) {\n <div class=\"error-message\" role=\"alert\">\n {{ changePasswordPageConfig.errorMessage }}\n </div>\n }\n\n @if (changePasswordPageConfig.showCurrentPasswordField) {\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"changePasswordPageConfig.currentPasswordField!\"\n ></pt-text-input>\n </div>\n }\n\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"changePasswordPageConfig.newPasswordField!\"\n ></pt-text-input>\n </div>\n\n @if (changePasswordPageConfig.showPasswordStrength) {\n <div class=\"password-strength-section\">\n <div class=\"password-strength-header\">\n <span>\n {{\n changePasswordPageConfig.passwordStrengthLabel ||\n \"Robustesse du mot de passe\"\n }}\n </span>\n\n <span\n class=\"strength-label\"\n [ngClass]=\"\n 'strength-' +\n (changePasswordPageConfig.passwordStrengthSeverity || 'neutral')\n \"\n >\n {{\n changePasswordPageConfig.passwordStrengthText || \"Non renseign\u00E9\"\n }}\n </span>\n </div>\n\n <p-progressbar\n [value]=\"changePasswordPageConfig.passwordStrengthPercentage || 0\"\n [showValue]=\"false\"\n [ngClass]=\"\n 'password-progressbar strength-' +\n (changePasswordPageConfig.passwordStrengthSeverity || 'neutral')\n \"\n ></p-progressbar>\n </div>\n }\n\n @if (visiblePasswordPolicyRules.length > 0) {\n <div class=\"password-policy-section\">\n <strong class=\"password-policy-title\">\n {{\n changePasswordPageConfig.passwordPolicyTitle || \"R\u00E8gles de s\u00E9curit\u00E9\"\n }}\n </strong>\n\n <ul class=\"password-policy-list\">\n @for (rule of visiblePasswordPolicyRules; track rule.code) {\n <li\n [class.valid]=\"rule.valid\"\n [class.invalid]=\"!rule.valid && !rule.backendOnly\"\n [class.backend-only]=\"rule.backendOnly\"\n >\n @if (rule.backendOnly) {\n <i class=\"pi pi-shield\"></i>\n } @else if (rule.valid) {\n <i class=\"pi pi-check-circle\"></i>\n } @else {\n <i class=\"pi pi-times-circle\"></i>\n }\n\n <span>{{ rule.label }}</span>\n </li>\n }\n </ul>\n </div>\n }\n\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"changePasswordPageConfig.confirmationPasswordField!\"\n ></pt-text-input>\n\n @if (\n confirmationPasswordControl?.touched &&\n formGroup.hasError(\"passwordMismatch\")\n ) {\n <small class=\"field-error\">\n {{\n changePasswordPageConfig.passwordMismatchErrorMessage ||\n \"Les deux mots de passe ne correspondent pas.\"\n }}\n </small>\n }\n </div>\n\n <div class=\"submit-btn\">\n <pt-button\n [buttonConfig]=\"changePasswordPageConfig.buttonConfig!\"\n ></pt-button>\n </div>\n\n @if (visibleAdditionalContent.length > 0) {\n <div class=\"additional-content-list\">\n @for (item of visibleAdditionalContent; track item.id || $index) {\n <div\n class=\"additional-content-item\"\n [ngClass]=\"getAdditionalContentClass(item)\"\n [ngStyle]=\"item.style\"\n >\n @if (item.text) {\n <span class=\"additional-content-text\">\n {{ item.text }}\n </span>\n }\n </div>\n }\n </div>\n }\n </form>\n\n <div class=\"change-password-footer\">\n {{ changePasswordPageConfig.footer?.version }}\n\n <span>\n {{ changePasswordPageConfig.footer?.copyright }}\n </span>\n </div>\n</pt-card>\n", styles: [":host{display:block;width:100%;min-width:0}.logo-container{display:flex;align-items:center;justify-content:center;margin-bottom:1.25rem}.logo-container img{display:block;max-width:100%;object-fit:contain}.title-container{margin-bottom:1.25rem;text-align:center}.title-container h1{margin:0;line-height:1.25}.form-container{width:100%}.field{display:flex;flex-direction:column;width:100%;margin-bottom:1.25rem}.error-message{width:100%;box-sizing:border-box;margin-bottom:.75rem;padding:.75rem .875rem;color:var(--p-message-error-color, #b91c1c);background:var(--p-message-error-background, #fef2f2);border:1px solid var(--p-message-error-border-color, #fecaca);border-radius:var(--p-content-border-radius, .5rem);font-size:.875rem;line-height:1.4;text-align:center}.password-strength-section{width:100%;margin-top:-.25rem;margin-bottom:1.25rem}.password-strength-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem;color:var(--p-text-color, #1e293b);font-size:.875rem;font-weight:600}.strength-label{font-size:.82rem;font-weight:700;white-space:nowrap}.strength-neutral{color:var(--p-text-muted-color, #64748b)}.strength-danger{color:var(--p-red-500, #ef4444)}.strength-warn{color:var(--p-orange-500, #f97316)}.strength-success{color:var(--p-green-500, #22c55e)}:host ::ng-deep .password-progressbar{height:.65rem;overflow:hidden;border-radius:999px}:host ::ng-deep .password-progressbar .p-progressbar-value{transition:width .22s ease,background-color .22s ease}:host ::ng-deep .password-progressbar.strength-neutral .p-progressbar-value{background:var(--p-surface-400, #94a3b8)}:host ::ng-deep .password-progressbar.strength-danger .p-progressbar-value{background:var(--p-red-500, #ef4444)}:host ::ng-deep .password-progressbar.strength-warn .p-progressbar-value{background:var(--p-orange-500, #f97316)}:host ::ng-deep .password-progressbar.strength-success .p-progressbar-value{background:var(--p-green-500, #22c55e)}.password-policy-section{width:100%;box-sizing:border-box;margin-bottom:1.25rem;padding:1rem;background:var(--p-content-background, rgba(255, 255, 255, .12));border:1px solid var(--p-content-border-color, rgba(255, 255, 255, .25));border-radius:var(--p-content-border-radius, .5rem)}.password-policy-title{display:block;margin-bottom:.75rem;color:var(--p-text-color, #1e293b);font-size:.9rem;font-weight:700}.password-policy-list{display:flex;flex-direction:column;margin:0;padding:0;gap:.55rem;list-style:none}.password-policy-list li{display:flex;align-items:flex-start;gap:.6rem;color:var(--p-text-muted-color, #64748b);font-size:.84rem;line-height:1.35}.password-policy-list li i{width:1rem;margin-top:.1rem;text-align:center}.password-policy-list li.valid{color:var(--p-green-600, #16a34a)}.password-policy-list li.invalid{color:var(--p-red-500, #ef4444)}.password-policy-list li.backend-only{color:var(--p-text-muted-color, #64748b)}.password-policy-list li.backend-only i{color:var(--p-primary-color, #3b82f6)}.field-error{display:block;margin-top:.45rem;color:var(--p-message-error-color, #b91c1c);font-size:.78rem;line-height:1.35}.submit-btn{display:flex;justify-content:center;width:100%}:host ::ng-deep .submit-btn pt-button{display:block;width:100%}:host ::ng-deep .submit-btn p-button,:host ::ng-deep .submit-btn p-button button{width:100%}.additional-content-list{display:flex;flex-direction:column;width:100%;margin-top:1rem;gap:.55rem}.additional-content-item{display:flex;flex-wrap:wrap;align-items:baseline;width:100%;box-sizing:border-box;gap:.3rem;color:var(--p-text-muted-color, var(--text-color-secondary, #64748b));font-size:.875rem;line-height:1.45}.additional-content-left{justify-content:flex-start;text-align:left}.additional-content-center{justify-content:center;text-align:center}.additional-content-right{justify-content:flex-end;text-align:right}.additional-content-text{color:inherit}.change-password-footer{margin-top:1.25rem;color:var(--p-text-muted-color, var(--text-color-secondary, #64748b));font-size:.8rem;line-height:1.4;text-align:center}.change-password-footer span{display:block;margin-top:.25rem}:host-context(.p-dark) .error-message,:host-context(.app-dark) .error-message,:host-context(.dark) .error-message,:host-context(.dark-mode) .error-message,:host-context([data-theme=\"dark\"]) .error-message{color:var(--p-message-error-color, #fca5a5);background:var(--p-message-error-background, rgba(127, 29, 29, .25));border-color:var(--p-message-error-border-color, rgba(248, 113, 113, .4))}:host-context(.p-dark) .password-strength-header,:host-context(.app-dark) .password-strength-header,:host-context(.dark) .password-strength-header,:host-context(.dark-mode) .password-strength-header,:host-context([data-theme=\"dark\"]) .password-strength-header,:host-context(.p-dark) .password-policy-title,:host-context(.app-dark) .password-policy-title,:host-context(.dark) .password-policy-title,:host-context(.dark-mode) .password-policy-title,:host-context([data-theme=\"dark\"]) .password-policy-title{color:var(--p-text-color, #f8fafc)}:host-context(.p-dark) .password-policy-section,:host-context(.app-dark) .password-policy-section,:host-context(.dark) .password-policy-section,:host-context(.dark-mode) .password-policy-section,:host-context([data-theme=\"dark\"]) .password-policy-section{background:#0f172a59;border-color:#94a3b84d}:host-context(.p-dark) .additional-content-item,:host-context(.app-dark) .additional-content-item,:host-context(.dark) .additional-content-item,:host-context(.dark-mode) .additional-content-item,:host-context([data-theme=\"dark\"]) .additional-content-item,:host-context(.p-dark) .change-password-footer,:host-context(.app-dark) .change-password-footer,:host-context(.dark) .change-password-footer,:host-context(.dark-mode) .change-password-footer,:host-context([data-theme=\"dark\"]) .change-password-footer{color:var(--p-text-muted-color, var(--text-color-secondary, #cbd5e1))}@media(max-width:768px){:host ::ng-deep pt-card{width:100%;max-width:100%}.submit-btn{min-width:100%}.password-strength-header{align-items:flex-start;flex-direction:column;gap:.25rem}}@media(max-width:480px){.logo-container,.title-container,.field{margin-bottom:1rem}.additional-content-item{font-size:.82rem}.additional-content-list{gap:.5rem}.password-policy-section{padding:.85rem}.password-policy-list li{font-size:.8rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PTCardModule }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "ngmodule", type: PTButtonModule }, { kind: "component", type: PTButtonComponent, selector: "pt-button", inputs: ["buttonConfig"] }, { kind: "ngmodule", type: PTTextInputModule }, { kind: "component", type: PTTextInputComponent, selector: "pt-text-input", inputs: ["formGroup", "formField"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i13.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }] }); }
|
|
7588
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTChangePasswordCardComponent, isStandalone: true, selector: "pt-change-password-card", inputs: { changePasswordPageConfig: "changePasswordPageConfig", changePasswordErrorMessage: "changePasswordErrorMessage" }, outputs: { passwordValueChange: "passwordValueChange", changePasswordSubmit: "changePasswordSubmit" }, usesOnChanges: true, ngImport: i0, template: "<pt-card [config]=\"changePasswordPageConfig.changePasswordCardConfig!\">\n @if (changePasswordPageConfig.logoUrl?.imageUrl) {\n <div class=\"logo-container\">\n <img\n [src]=\"changePasswordPageConfig.logoUrl?.imageUrl\"\n [alt]=\"changePasswordPageConfig.logoUrl?.altText || 'Logo'\"\n [style.width]=\"changePasswordPageConfig.logoUrl?.width || '100px'\"\n [style.height]=\"changePasswordPageConfig.logoUrl?.height || 'auto'\"\n />\n </div>\n }\n\n <div class=\"title-container\">\n <h1\n [ngStyle]=\"{\n color: changePasswordPageConfig.title?.color || '#333',\n 'font-size': changePasswordPageConfig.title?.fontSize || '24px',\n }\"\n >\n {{ changePasswordPageConfig.title?.text || \"Changer le mot de passe\" }}\n </h1>\n </div>\n\n @if (changePasswordErrorMessage) {\n <div class=\"error-message\" role=\"alert\">\n {{ changePasswordErrorMessage }}\n </div>\n }\n\n <form class=\"form-container\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\n @if (changePasswordPageConfig.errorMessage) {\n <div class=\"error-message\" role=\"alert\">\n {{ changePasswordPageConfig.errorMessage }}\n </div>\n }\n\n @if (changePasswordPageConfig.showCurrentPasswordField) {\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"changePasswordPageConfig.currentPasswordField!\"\n ></pt-text-input>\n </div>\n }\n\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"changePasswordPageConfig.newPasswordField!\"\n ></pt-text-input>\n </div>\n\n @if (changePasswordPageConfig.showPasswordStrength) {\n <div class=\"password-strength-section\">\n <div class=\"password-strength-header\">\n <span>\n {{\n changePasswordPageConfig.passwordStrengthLabel ||\n \"Robustesse du mot de passe\"\n }}\n </span>\n\n <span\n class=\"strength-label\"\n [ngClass]=\"\n 'strength-' +\n (changePasswordPageConfig.passwordStrengthSeverity || 'neutral')\n \"\n >\n {{\n changePasswordPageConfig.passwordStrengthText || \"Non renseign\u00E9\"\n }}\n </span>\n </div>\n\n <p-progressbar\n [value]=\"changePasswordPageConfig.passwordStrengthPercentage || 0\"\n [showValue]=\"false\"\n [ngClass]=\"\n 'password-progressbar strength-' +\n (changePasswordPageConfig.passwordStrengthSeverity || 'neutral')\n \"\n ></p-progressbar>\n </div>\n }\n\n @if (visiblePasswordPolicyRules.length > 0) {\n <div class=\"password-policy-section\">\n <strong class=\"password-policy-title\">\n {{\n changePasswordPageConfig.passwordPolicyTitle || \"R\u00E8gles de s\u00E9curit\u00E9\"\n }}\n </strong>\n\n <ul class=\"password-policy-list\">\n @for (rule of visiblePasswordPolicyRules; track rule.code) {\n <li\n [class.valid]=\"rule.valid\"\n [class.invalid]=\"!rule.valid && !rule.backendOnly\"\n [class.backend-only]=\"rule.backendOnly\"\n >\n @if (rule.backendOnly) {\n <i class=\"pi pi-shield\"></i>\n } @else if (rule.valid) {\n <i class=\"pi pi-check-circle\"></i>\n } @else {\n <i class=\"pi pi-times-circle\"></i>\n }\n\n <span>{{ rule.label }}</span>\n </li>\n }\n </ul>\n </div>\n }\n\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"changePasswordPageConfig.confirmationPasswordField!\"\n ></pt-text-input>\n\n @if (\n confirmationPasswordControl?.touched &&\n formGroup.hasError(\"passwordMismatch\")\n ) {\n <small class=\"field-error\">\n {{\n changePasswordPageConfig.passwordMismatchErrorMessage ||\n \"Les deux mots de passe ne correspondent pas.\"\n }}\n </small>\n }\n </div>\n\n <div class=\"submit-btn\">\n <pt-button\n [buttonConfig]=\"changePasswordPageConfig.buttonConfig!\"\n ></pt-button>\n </div>\n\n @if (visibleAdditionalContent.length > 0) {\n <div class=\"additional-content-list\">\n @for (item of visibleAdditionalContent; track item.id || $index) {\n <div\n class=\"additional-content-item\"\n [ngClass]=\"getAdditionalContentClass(item)\"\n [ngStyle]=\"item.style\"\n >\n @if (item.text) {\n <span class=\"additional-content-text\">\n {{ item.text }}\n </span>\n }\n </div>\n }\n </div>\n }\n </form>\n\n <div class=\"change-password-footer\">\n {{ changePasswordPageConfig.footer?.version }}\n\n <span>\n {{ changePasswordPageConfig.footer?.copyright }}\n </span>\n </div>\n</pt-card>\n", styles: [":host{display:block;width:100%;min-width:0}.logo-container{display:flex;align-items:center;justify-content:center;margin-bottom:1.25rem}.logo-container img{display:block;max-width:100%;object-fit:contain}.title-container{margin-bottom:1.25rem;text-align:center}.title-container h1{margin:0;line-height:1.25}.form-container{width:100%}.field{display:flex;flex-direction:column;width:100%;margin-bottom:1.25rem}.error-message{width:100%;box-sizing:border-box;margin-bottom:.75rem;padding:.75rem .875rem;color:var(--p-message-error-color, #b91c1c);background:var(--p-message-error-background, #fef2f2);border:1px solid var(--p-message-error-border-color, #fecaca);border-radius:var(--p-content-border-radius, .5rem);font-size:.875rem;line-height:1.4;text-align:center}.password-strength-section{width:100%;margin-top:-.25rem;margin-bottom:1.25rem}.password-strength-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem;color:var(--p-text-color, #1e293b);font-size:.875rem;font-weight:600}.strength-label{font-size:.82rem;font-weight:700;white-space:nowrap}.strength-neutral{color:var(--p-text-muted-color, #64748b)}.strength-danger{color:var(--p-red-500, #ef4444)}.strength-warn{color:var(--p-orange-500, #f97316)}.strength-success{color:var(--p-green-500, #22c55e)}:host ::ng-deep .password-progressbar{height:.65rem;overflow:hidden;border-radius:999px}:host ::ng-deep .password-progressbar .p-progressbar-value{transition:width .22s ease,background-color .22s ease}:host ::ng-deep .password-progressbar.strength-neutral .p-progressbar-value{background:var(--p-surface-400, #94a3b8)}:host ::ng-deep .password-progressbar.strength-danger .p-progressbar-value{background:var(--p-red-500, #ef4444)}:host ::ng-deep .password-progressbar.strength-warn .p-progressbar-value{background:var(--p-orange-500, #f97316)}:host ::ng-deep .password-progressbar.strength-success .p-progressbar-value{background:var(--p-green-500, #22c55e)}.password-policy-section{width:100%;box-sizing:border-box;margin-bottom:1.25rem;padding:1rem;background:var(--p-content-background, rgba(255, 255, 255, .12));border:1px solid var(--p-content-border-color, rgba(255, 255, 255, .25));border-radius:var(--p-content-border-radius, .5rem)}.password-policy-title{display:block;margin-bottom:.75rem;color:var(--p-text-color, #1e293b);font-size:.9rem;font-weight:700}.password-policy-list{display:flex;flex-direction:column;margin:0;padding:0;gap:.55rem;list-style:none}.password-policy-list li{display:flex;align-items:flex-start;gap:.6rem;color:var(--p-text-muted-color, #64748b);font-size:.84rem;line-height:1.35}.password-policy-list li i{width:1rem;margin-top:.1rem;text-align:center}.password-policy-list li.valid{color:var(--p-green-600, #16a34a)}.password-policy-list li.invalid{color:var(--p-red-500, #ef4444)}.password-policy-list li.backend-only{color:var(--p-text-muted-color, #64748b)}.password-policy-list li.backend-only i{color:var(--p-primary-color, #3b82f6)}.field-error{display:block;margin-top:.45rem;color:var(--p-message-error-color, #b91c1c);font-size:.78rem;line-height:1.35}.submit-btn{display:flex;justify-content:center;width:100%}:host ::ng-deep .submit-btn pt-button{display:block;width:100%}:host ::ng-deep .submit-btn p-button,:host ::ng-deep .submit-btn p-button button{width:100%}.additional-content-list{display:flex;flex-direction:column;width:100%;margin-top:1rem;gap:.55rem}.additional-content-item{display:flex;flex-wrap:wrap;align-items:baseline;width:100%;box-sizing:border-box;gap:.3rem;color:var(--p-text-muted-color, var(--text-color-secondary, #64748b));font-size:.875rem;line-height:1.45}.additional-content-left{justify-content:flex-start;text-align:left}.additional-content-center{justify-content:center;text-align:center}.additional-content-right{justify-content:flex-end;text-align:right}.additional-content-text{color:inherit}.change-password-footer{margin-top:1.25rem;color:var(--p-text-muted-color, var(--text-color-secondary, #64748b));font-size:.8rem;line-height:1.4;text-align:center}.change-password-footer span{display:block;margin-top:.25rem}:host-context(.p-dark) .error-message,:host-context(.app-dark) .error-message,:host-context(.dark) .error-message,:host-context(.dark-mode) .error-message,:host-context([data-theme=\"dark\"]) .error-message{color:var(--p-message-error-color, #fca5a5);background:var(--p-message-error-background, rgba(127, 29, 29, .25));border-color:var(--p-message-error-border-color, rgba(248, 113, 113, .4))}:host-context(.p-dark) .password-strength-header,:host-context(.app-dark) .password-strength-header,:host-context(.dark) .password-strength-header,:host-context(.dark-mode) .password-strength-header,:host-context([data-theme=\"dark\"]) .password-strength-header,:host-context(.p-dark) .password-policy-title,:host-context(.app-dark) .password-policy-title,:host-context(.dark) .password-policy-title,:host-context(.dark-mode) .password-policy-title,:host-context([data-theme=\"dark\"]) .password-policy-title{color:var(--p-text-color, #f8fafc)}:host-context(.p-dark) .password-policy-section,:host-context(.app-dark) .password-policy-section,:host-context(.dark) .password-policy-section,:host-context(.dark-mode) .password-policy-section,:host-context([data-theme=\"dark\"]) .password-policy-section{background:#0f172a59;border-color:#94a3b84d}:host-context(.p-dark) .additional-content-item,:host-context(.app-dark) .additional-content-item,:host-context(.dark) .additional-content-item,:host-context(.dark-mode) .additional-content-item,:host-context([data-theme=\"dark\"]) .additional-content-item,:host-context(.p-dark) .change-password-footer,:host-context(.app-dark) .change-password-footer,:host-context(.dark) .change-password-footer,:host-context(.dark-mode) .change-password-footer,:host-context([data-theme=\"dark\"]) .change-password-footer{color:var(--p-text-muted-color, var(--text-color-secondary, #cbd5e1))}@media(max-width:768px){:host ::ng-deep pt-card{width:100%;max-width:100%}.submit-btn{min-width:100%}.password-strength-header{align-items:flex-start;flex-direction:column;gap:.25rem}}@media(max-width:480px){.logo-container,.title-container,.field{margin-bottom:1rem}.additional-content-item{font-size:.82rem}.additional-content-list{gap:.5rem}.password-policy-section{padding:.85rem}.password-policy-list li{font-size:.8rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PTCardModule }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "ngmodule", type: PTButtonModule }, { kind: "component", type: PTButtonComponent, selector: "pt-button", inputs: ["buttonConfig"] }, { kind: "ngmodule", type: PTTextInputModule }, { kind: "component", type: PTTextInputComponent, selector: "pt-text-input", inputs: ["formGroup", "formField"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i13.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }] }); }
|
|
7565
7589
|
}
|
|
7566
7590
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTChangePasswordCardComponent, decorators: [{
|
|
7567
7591
|
type: Component,
|