@testgorilla/tgo-ui 11.22.3 → 12.0.0
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/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1795
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/mcp/catalog.json +1 -1
- package/package.json +16 -17
- package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
- package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
- package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
- package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
- package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
- package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
- package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
- package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
- package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
- package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
- package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
- package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
- package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
- package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
- package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
- package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
- package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
- package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
- package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
- package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
- package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
- package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
- package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
- package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
- package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
- package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
- package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
- package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
- package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
- package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
- package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
- package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
- package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
- package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
- package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
- package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
- package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
- package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
- package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
- package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
- package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
- package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
- package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
- package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
- package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
- package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
- package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
- package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
- package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
- package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
- package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
- package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
- package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
- package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
- package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
- package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
- package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
- package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
- package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
- package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
- package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
- package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
- package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
- package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
- package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
- package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
- package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
- package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
- package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
- package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
- package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
- package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
- package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
- package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
- package/types/testgorilla-tgo-ui.d.ts +52 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-password-criteria.mjs","sources":["../../../components/password-criteria/password.component.ts","../../../components/password-criteria/password.component.html","../../../components/password-criteria/password.component.module.ts","../../../components/password-criteria/testgorilla-tgo-ui-components-password-criteria.ts"],"sourcesContent":["import { NgClass, AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n forwardRef,\n inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n Validators,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { FieldComponent } from '@testgorilla/tgo-ui/components/field';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ProgressBarComponentModule } from '@testgorilla/tgo-ui/components/progress-bar';\n\n@Component({\n selector: 'ui-password-criteria',\n templateUrl: './password.component.html',\n styleUrls: ['./password.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PasswordComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FieldComponent,\n FormsModule,\n ReactiveFormsModule,\n ProgressBarComponentModule,\n NgClass,\n IconComponentModule,\n AsyncPipe,\n UiTranslatePipe,\n ],\n})\nexport class PasswordComponent implements ControlValueAccessor {\n /**\n * Show criteria for password. Defaults true\n *\n * @type {boolean}\n * @memberof PasswordComponent\n */\n @Input() showCriteria = true;\n\n /**\n * Password is required or not\n *\n * @type {boolean}\n * @memberof PasswordComponent\n */\n @Input() required = false;\n\n @Output() passwordChange = new EventEmitter<string>();\n\n @Output() allCriteriaPassed = new EventEmitter<boolean>();\n\n @ViewChild('requiredCriteria') requiredCriteria: ElementRef<HTMLElement>;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method -- Validators.required is a static Angular validator with no `this` binding\n protected formControl = new FormControl('', Validators.required);\n protected criteriaPassed: { [key: string]: boolean } = {};\n protected showError: boolean;\n protected progressValue: number;\n protected criteria: { translateKey: string; key: string }[] = [\n { translateKey: 'PASSWORD.LOWERCASE', key: 'hasLowercase' },\n { translateKey: 'PASSWORD.UPPERCASE', key: 'hasUppercase' },\n { translateKey: 'PASSWORD.NUMBER', key: 'hasNumber' },\n { translateKey: 'PASSWORD.SPECIAL_CHARACTER', key: 'hasSpecialChar' },\n { translateKey: 'PASSWORD.CHARACTERS', key: 'hasMinLength' },\n ];\n\n constructor(private readonly destroyRef: DestroyRef) {\n this.formControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.checkCriteria();\n });\n }\n\n checkCriteria(): void {\n const password = this.formControl.value ?? '';\n this.criteriaPassed = {\n hasLowercase: /^(?=.*?[a-z])/.test(password),\n hasUppercase: /^(?=.*?[A-Z])/.test(password),\n hasNumber: /^(?=.*?[0-9])/.test(password),\n hasSpecialChar: /^(?=.*?[\" !#$%&'()*+,-./:;<=>?@[\\]^_`{|}~])/.test(password),\n hasMinLength: password.length >= 12,\n };\n\n const passedCount = this.countPassed();\n this.progressValue = Math.min(Math.max(passedCount * (100 / Object.keys(this.criteriaPassed).length), 1), 100);\n this.passwordChange.emit(password);\n this.allCriteriaPassed.emit(passedCount === Object.keys(this.criteriaPassed).length);\n this.onChange(password);\n }\n\n countPassed(): number {\n let count = 0;\n for (const key in this.criteriaPassed) {\n if (Object.prototype.hasOwnProperty.call(this.criteriaPassed, key) && this.criteriaPassed[key]) {\n count++;\n }\n }\n return count;\n }\n onChange = (_v: string) => {};\n onTouch = () => {};\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n writeValue(obj?: string | null): void {\n this.formControl.setValue(obj ?? null);\n // setValue() re-evaluates the criteria fields the template renders; the\n // forms API calls this from outside the component's own change detection.\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n get allRequirementsMet(): boolean {\n return this.countPassed() === Object.keys(this.criteriaPassed).length && Boolean(this.countPassed());\n }\n}\n","<div class=\"password-criteria-container\">\n <ui-field\n [applicationTheme]=\"'dark'\"\n [formControl]=\"formControl\"\n [ariaLabel]=\"requiredCriteria?.nativeElement?.innerText ?? ''\"\n [type]=\"'password'\"\n [placeholder]=\"('PASSWORD.PASSWORD_PLACEHOLDER' | uiTranslate | async) + (required ? ' *' : '')\"\n (keydown.enter)=\"showError = true\"\n (focusout)=\"showError = true\"\n ></ui-field>\n\n @if (showCriteria) {\n <div class=\"criteria-container\" #requiredCriteria>\n <div class=\"progress\">\n <ui-progress-bar\n [progress]=\"progressValue === 1 ? 0 : progressValue\"\n [applicationTheme]=\"'dark'\"\n ></ui-progress-bar>\n </div>\n @if (allRequirementsMet) {\n <span style=\"position: absolute; left: -9999px\" [attr.aria-live]=\"'polite'\">{{\n 'FIELD.ALL_PASSWORD_REQ_PASSED' | uiTranslate | async\n }}</span>\n }\n @for (criterion of criteria; track criterion) {\n <div\n class=\"criterion\"\n [attr.aria-live]=\"!allRequirementsMet ? 'polite' : ''\"\n [ngClass]=\"{ passed: criteriaPassed[criterion.key], error: !criteriaPassed[criterion.key] && showError }\"\n >\n <ui-icon\n [size]=\"'24'\"\n [color]=\"'rebrand-black'\"\n [name]=\"!criteriaPassed[criterion.key] && showError ? 'Info-in-line' : 'Check-round-in-line'\"\n applicationTheme=\"dark\"\n ></ui-icon>\n <span>{{ criterion.translateKey | uiTranslate | async }}</span>\n <span style=\"position: absolute; left: -9999px\">{{\n (criteriaPassed[criterion.key] ? 'COMMON.PASSED' : 'COMMON.FAILED') | uiTranslate | async\n }}</span>\n </div>\n }\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { FieldComponentModule } from '@testgorilla/tgo-ui/components/field';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ProgressBarComponentModule } from '@testgorilla/tgo-ui/components/progress-bar';\n\nimport { PasswordComponent } from './password.component';\n\n@NgModule({\n exports: [PasswordComponent],\n imports: [\n CommonModule,\n FieldComponentModule,\n ReactiveFormsModule,\n IconComponentModule,\n ProgressBarComponentModule,\n UiTranslatePipe,\n PasswordComponent,\n ],\n})\nexport class PasswordComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAoDa,iBAAiB,CAAA;AAoC5B,IAAA,WAAA,CAA6B,UAAsB,EAAA;QAAtB,IAAA,CAAA,UAAU,GAAV,UAAU;AAnCvC;;;;;AAKG;QACM,IAAA,CAAA,YAAY,GAAG,IAAI;AAE5B;;;;;AAKG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEf,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAU;AAE3C,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,EAAW;;QAK/C,IAAA,CAAA,WAAW,GAAG,IAAI,WAAW,CAAC,EAAE,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,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAThC,YAAY;YACZ,oBAAoB;YACpB,mBAAmB;YACnB,mBAAmB;YACnB,0BAA0B;YAC1B,eAAe;AACf,YAAA,iBAAiB,aART,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAWhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAThC,YAAY;YACZ,oBAAoB;YACpB,mBAAmB;YACnB,mBAAmB;YACnB,0BAA0B;YAE1B,iBAAiB,CAAA,EAAA,CAAA,CAAA;;4FAGR,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAZnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC5B,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,oBAAoB;wBACpB,mBAAmB;wBACnB,mBAAmB;wBACnB,0BAA0B;wBAC1B,eAAe;wBACf,iBAAiB;AAClB,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-password-criteria.mjs","names":[],"sources":["../../../components/password-criteria/password.component.ts","../../../components/password-criteria/password.component.html","../../../components/password-criteria/password.component.module.ts"],"sourcesContent":["import { NgClass, AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n forwardRef,\n inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n Validators,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { FieldComponent } from '@testgorilla/tgo-ui/components/field';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ProgressBarComponentModule } from '@testgorilla/tgo-ui/components/progress-bar';\n\n@Component({\n selector: 'ui-password-criteria',\n templateUrl: './password.component.html',\n styleUrls: ['./password.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PasswordComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FieldComponent,\n FormsModule,\n ReactiveFormsModule,\n ProgressBarComponentModule,\n NgClass,\n IconComponentModule,\n AsyncPipe,\n UiTranslatePipe,\n ],\n})\nexport class PasswordComponent implements ControlValueAccessor {\n /**\n * Show criteria for password. Defaults true\n *\n * @type {boolean}\n * @memberof PasswordComponent\n */\n @Input() showCriteria = true;\n\n /**\n * Password is required or not\n *\n * @type {boolean}\n * @memberof PasswordComponent\n */\n @Input() required = false;\n\n @Output() passwordChange = new EventEmitter<string>();\n\n @Output() allCriteriaPassed = new EventEmitter<boolean>();\n\n @ViewChild('requiredCriteria') requiredCriteria: ElementRef<HTMLElement>;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method -- Validators.required is a static Angular validator with no `this` binding\n protected formControl = new FormControl('', Validators.required);\n protected criteriaPassed: { [key: string]: boolean } = {};\n protected showError: boolean;\n protected progressValue: number;\n protected criteria: { translateKey: string; key: string }[] = [\n { translateKey: 'PASSWORD.LOWERCASE', key: 'hasLowercase' },\n { translateKey: 'PASSWORD.UPPERCASE', key: 'hasUppercase' },\n { translateKey: 'PASSWORD.NUMBER', key: 'hasNumber' },\n { translateKey: 'PASSWORD.SPECIAL_CHARACTER', key: 'hasSpecialChar' },\n { translateKey: 'PASSWORD.CHARACTERS', key: 'hasMinLength' },\n ];\n\n constructor(private readonly destroyRef: DestroyRef) {\n this.formControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.checkCriteria();\n });\n }\n\n checkCriteria(): void {\n const password = this.formControl.value ?? '';\n this.criteriaPassed = {\n hasLowercase: /^(?=.*?[a-z])/.test(password),\n hasUppercase: /^(?=.*?[A-Z])/.test(password),\n hasNumber: /^(?=.*?[0-9])/.test(password),\n hasSpecialChar: /^(?=.*?[\" !#$%&'()*+,-./:;<=>?@[\\]^_`{|}~])/.test(password),\n hasMinLength: password.length >= 12,\n };\n\n const passedCount = this.countPassed();\n this.progressValue = Math.min(Math.max(passedCount * (100 / Object.keys(this.criteriaPassed).length), 1), 100);\n this.passwordChange.emit(password);\n this.allCriteriaPassed.emit(passedCount === Object.keys(this.criteriaPassed).length);\n this.onChange(password);\n }\n\n countPassed(): number {\n let count = 0;\n for (const key in this.criteriaPassed) {\n if (Object.prototype.hasOwnProperty.call(this.criteriaPassed, key) && this.criteriaPassed[key]) {\n count++;\n }\n }\n return count;\n }\n onChange = (_v: string) => {};\n onTouch = () => {};\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n writeValue(obj?: string | null): void {\n this.formControl.setValue(obj ?? null);\n // setValue() re-evaluates the criteria fields the template renders; the\n // forms API calls this from outside the component's own change detection.\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n get allRequirementsMet(): boolean {\n return this.countPassed() === Object.keys(this.criteriaPassed).length && Boolean(this.countPassed());\n }\n}\n","<div class=\"password-criteria-container\">\n <ui-field\n [applicationTheme]=\"'dark'\"\n [formControl]=\"formControl\"\n [ariaLabel]=\"requiredCriteria?.nativeElement?.innerText ?? ''\"\n [type]=\"'password'\"\n [placeholder]=\"('PASSWORD.PASSWORD_PLACEHOLDER' | uiTranslate | async) + (required ? ' *' : '')\"\n (keydown.enter)=\"showError = true\"\n (focusout)=\"showError = true\"\n ></ui-field>\n\n @if (showCriteria) {\n <div class=\"criteria-container\" #requiredCriteria>\n <div class=\"progress\">\n <ui-progress-bar\n [progress]=\"progressValue === 1 ? 0 : progressValue\"\n [applicationTheme]=\"'dark'\"\n ></ui-progress-bar>\n </div>\n @if (allRequirementsMet) {\n <span style=\"position: absolute; left: -9999px\" [attr.aria-live]=\"'polite'\">{{\n 'FIELD.ALL_PASSWORD_REQ_PASSED' | uiTranslate | async\n }}</span>\n }\n @for (criterion of criteria; track criterion) {\n <div\n class=\"criterion\"\n [attr.aria-live]=\"!allRequirementsMet ? 'polite' : ''\"\n [ngClass]=\"{ passed: criteriaPassed[criterion.key], error: !criteriaPassed[criterion.key] && showError }\"\n >\n <ui-icon\n [size]=\"'24'\"\n [color]=\"'rebrand-black'\"\n [name]=\"!criteriaPassed[criterion.key] && showError ? 'Info-in-line' : 'Check-round-in-line'\"\n applicationTheme=\"dark\"\n ></ui-icon>\n <span>{{ criterion.translateKey | uiTranslate | async }}</span>\n <span style=\"position: absolute; left: -9999px\">{{\n (criteriaPassed[criterion.key] ? 'COMMON.PASSED' : 'COMMON.FAILED') | uiTranslate | async\n }}</span>\n </div>\n }\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { FieldComponentModule } from '@testgorilla/tgo-ui/components/field';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ProgressBarComponentModule } from '@testgorilla/tgo-ui/components/progress-bar';\n\nimport { PasswordComponent } from './password.component';\n\n@NgModule({\n exports: [PasswordComponent],\n imports: [\n CommonModule,\n FieldComponentModule,\n ReactiveFormsModule,\n IconComponentModule,\n ProgressBarComponentModule,\n UiTranslatePipe,\n PasswordComponent,\n ],\n})\nexport class PasswordComponentModule {}\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAa,oBAAb,MAAa,kBAAi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AA,QAAA,CAAA,g/FAAA;EAAA,CAAA;;;;E,iBASA,MAAA,M;E,aAQA,MAAA,M;E,mBAEA,MAAA,O;E,sBAEA,MAAA,O;;GAEA,MAAA;GAAU,MAAA,CAAA,kBAAkB;;;;AElD/B,IAAa,0BAAb,MAAa,wBAAuB;CAAvB;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAvB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,SAAA;IAThC;IACA;IACA;IACA;IACA;IACA;IACA;GAAiB;GAAA,SAAA,CART,iBAAiB;EAAA,CAAA;CAAA;CAWhB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,SAAA;IAThC;IACA;IACA;IACA;IACA;IAEA;GAAiB;EAAA,CAAA;CAAA;;AAGR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EAZnC,MAAA;EAAS,MAAA,CAAA;GACR,SAAS,CAAC,iBAAiB;GAC3B,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACD;EACF,CAAA"}
|
|
@@ -1,119 +1,254 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { UiTranslatePipe } from
|
|
5
|
-
import * as i2 from
|
|
6
|
-
import { IconComponentModule } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { ProgressBarComponentModule } from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
import { AsyncPipe, CommonModule, NgClass } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, NgModule, Optional, Output } from "@angular/core";
|
|
4
|
+
import { UiTranslatePipe } from "@testgorilla/tgo-ui/components/core";
|
|
5
|
+
import * as i2 from "@testgorilla/tgo-ui/components/icon";
|
|
6
|
+
import { IconComponentModule } from "@testgorilla/tgo-ui/components/icon";
|
|
7
|
+
import * as i1 from "@testgorilla/tgo-ui/components/progress-bar";
|
|
8
|
+
import { ProgressBarComponentModule } from "@testgorilla/tgo-ui/components/progress-bar";
|
|
9
|
+
var PasswordStrengthComponent = class PasswordStrengthComponent {
|
|
10
|
+
set password(value) {
|
|
11
|
+
this._password = value;
|
|
12
|
+
if (value && value.length > 0) this.showError = true;
|
|
13
|
+
this.checkCriteria(this._password);
|
|
14
|
+
}
|
|
15
|
+
constructor(defaultAppTheme) {
|
|
16
|
+
this.defaultAppTheme = defaultAppTheme;
|
|
17
|
+
this.applicationTheme = "light";
|
|
18
|
+
this.validationCheck = new EventEmitter();
|
|
19
|
+
this.criteriaPassed = {};
|
|
20
|
+
this.showError = false;
|
|
21
|
+
this._password = "";
|
|
22
|
+
this.criteria = [
|
|
23
|
+
{
|
|
24
|
+
translateKey: "PASSWORD.LOWERCASE",
|
|
25
|
+
key: "hasLowercase"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
translateKey: "PASSWORD.UPPERCASE",
|
|
29
|
+
key: "hasUppercase"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
translateKey: "PASSWORD.NUMBER",
|
|
33
|
+
key: "hasNumber"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
translateKey: "PASSWORD.SPECIAL_CHARACTER",
|
|
37
|
+
key: "hasSpecialChar"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
translateKey: "PASSWORD.CHARACTERS",
|
|
41
|
+
key: "hasMinLength"
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
if (this.defaultAppTheme) this.applicationTheme = defaultAppTheme;
|
|
45
|
+
}
|
|
46
|
+
checkCriteria(password) {
|
|
47
|
+
this.criteriaPassed = {
|
|
48
|
+
hasLowercase: /^(?=.*?[a-z])/.test(password),
|
|
49
|
+
hasUppercase: /^(?=.*?[A-Z])/.test(password),
|
|
50
|
+
hasNumber: /^(?=.*?[0-9])/.test(password),
|
|
51
|
+
hasSpecialChar: /^(?=.*?[" !#$%&'()*+,-./:;<=>?@[\]^_`{|}~])/.test(password),
|
|
52
|
+
hasMinLength: password.length >= 12
|
|
53
|
+
};
|
|
54
|
+
const passedCount = this.countPassed();
|
|
55
|
+
this.progressValue = Math.min(Math.max(passedCount * (100 / Object.keys(this.criteriaPassed).length), 1), 100);
|
|
56
|
+
this.validationCheck.emit(passedCount === Object.keys(this.criteriaPassed).length);
|
|
57
|
+
}
|
|
58
|
+
countPassed() {
|
|
59
|
+
let count = 0;
|
|
60
|
+
for (const key in this.criteriaPassed) if (Object.prototype.hasOwnProperty.call(this.criteriaPassed, key) && this.criteriaPassed[key]) count++;
|
|
61
|
+
return count;
|
|
62
|
+
}
|
|
63
|
+
get infoIcon() {
|
|
64
|
+
return this.applicationTheme === "classic" ? "Info" : "Info-in-line";
|
|
65
|
+
}
|
|
66
|
+
get checkIcon() {
|
|
67
|
+
return this.applicationTheme === "classic" ? "Round-check" : "Check-round-in-line";
|
|
68
|
+
}
|
|
69
|
+
static {
|
|
70
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
71
|
+
minVersion: "12.0.0",
|
|
72
|
+
version: "22.2.4",
|
|
73
|
+
ngImport: i0,
|
|
74
|
+
type: PasswordStrengthComponent,
|
|
75
|
+
deps: [{
|
|
76
|
+
token: "CANOPYUI_DEFAULT_APPLICATION_THEME",
|
|
77
|
+
optional: true
|
|
78
|
+
}],
|
|
79
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
static {
|
|
83
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
84
|
+
minVersion: "17.0.0",
|
|
85
|
+
version: "22.2.4",
|
|
86
|
+
type: PasswordStrengthComponent,
|
|
87
|
+
isStandalone: true,
|
|
88
|
+
selector: "ui-password-strength",
|
|
89
|
+
inputs: {
|
|
90
|
+
applicationTheme: "applicationTheme",
|
|
91
|
+
password: "password"
|
|
92
|
+
},
|
|
93
|
+
outputs: { validationCheck: "validationCheck" },
|
|
94
|
+
ngImport: i0,
|
|
95
|
+
template: "<div class=\"criteria-container\">\n <div class=\"progress\">\n <ui-progress-bar\n [progress]=\"progressValue === 1 ? 0 : progressValue\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-progress-bar>\n </div>\n\n @for (criterion of criteria; track criterion) {\n <div\n class=\"criterion\"\n [ngClass]=\"{ passed: criteriaPassed[criterion.key], error: !criteriaPassed[criterion.key] && showError }\"\n >\n <ui-icon\n [size]=\"'24'\"\n [color]=\"'rebrand-black'\"\n [name]=\"!criteriaPassed[criterion.key] ? infoIcon : checkIcon\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-icon>\n <span>{{ criterion.translateKey | uiTranslate | async }}</span>\n </div>\n }\n</div>\n",
|
|
96
|
+
styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.criteria-container{margin-top:14px}.criteria-container .progress{margin-bottom:16px}.criteria-container .criterion{display:flex;flex-direction:row;align-items:center;gap:8px}.criteria-container .criterion ui-icon ::ng-deep svg{color:#e9e9e9}.criteria-container .criterion span{text-align:center;font-size:14px;line-height:23px;color:#242424}.criteria-container .criterion.passed ui-icon ::ng-deep svg{color:#242424}.criteria-container .criterion.passed span{color:#666;text-decoration:line-through}.criteria-container .criterion.error ui-icon ::ng-deep svg{color:#e02800}.criteria-container .criterion.error span{color:#e02800}\n"],
|
|
97
|
+
dependencies: [
|
|
98
|
+
{
|
|
99
|
+
kind: "ngmodule",
|
|
100
|
+
type: ProgressBarComponentModule
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
kind: "component",
|
|
104
|
+
type: i1.ProgressBarComponent,
|
|
105
|
+
selector: "ui-progress-bar",
|
|
106
|
+
inputs: [
|
|
107
|
+
"companyColor",
|
|
108
|
+
"progress",
|
|
109
|
+
"mode",
|
|
110
|
+
"buffer",
|
|
111
|
+
"applicationTheme",
|
|
112
|
+
"ariaLabel",
|
|
113
|
+
"ariaDescribedBy",
|
|
114
|
+
"showPercentage"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
kind: "directive",
|
|
119
|
+
type: NgClass,
|
|
120
|
+
selector: "[ngClass]",
|
|
121
|
+
inputs: ["class", "ngClass"]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
kind: "ngmodule",
|
|
125
|
+
type: IconComponentModule
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
kind: "component",
|
|
129
|
+
type: i2.IconComponent,
|
|
130
|
+
selector: "ui-icon",
|
|
131
|
+
inputs: [
|
|
132
|
+
"size",
|
|
133
|
+
"cssClass",
|
|
134
|
+
"name",
|
|
135
|
+
"color",
|
|
136
|
+
"filled",
|
|
137
|
+
"toggleIconStyle",
|
|
138
|
+
"applicationTheme",
|
|
139
|
+
"useFullIconName"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
kind: "pipe",
|
|
144
|
+
type: AsyncPipe,
|
|
145
|
+
name: "async"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
kind: "pipe",
|
|
149
|
+
type: UiTranslatePipe,
|
|
150
|
+
name: "uiTranslate"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
158
|
+
minVersion: "12.0.0",
|
|
159
|
+
version: "22.2.4",
|
|
160
|
+
ngImport: i0,
|
|
161
|
+
type: PasswordStrengthComponent,
|
|
162
|
+
decorators: [{
|
|
163
|
+
type: Component,
|
|
164
|
+
args: [{
|
|
165
|
+
selector: "ui-password-strength",
|
|
166
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
167
|
+
imports: [
|
|
168
|
+
ProgressBarComponentModule,
|
|
169
|
+
NgClass,
|
|
170
|
+
IconComponentModule,
|
|
171
|
+
AsyncPipe,
|
|
172
|
+
UiTranslatePipe
|
|
173
|
+
],
|
|
174
|
+
template: "<div class=\"criteria-container\">\n <div class=\"progress\">\n <ui-progress-bar\n [progress]=\"progressValue === 1 ? 0 : progressValue\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-progress-bar>\n </div>\n\n @for (criterion of criteria; track criterion) {\n <div\n class=\"criterion\"\n [ngClass]=\"{ passed: criteriaPassed[criterion.key], error: !criteriaPassed[criterion.key] && showError }\"\n >\n <ui-icon\n [size]=\"'24'\"\n [color]=\"'rebrand-black'\"\n [name]=\"!criteriaPassed[criterion.key] ? infoIcon : checkIcon\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-icon>\n <span>{{ criterion.translateKey | uiTranslate | async }}</span>\n </div>\n }\n</div>\n",
|
|
175
|
+
styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.criteria-container{margin-top:14px}.criteria-container .progress{margin-bottom:16px}.criteria-container .criterion{display:flex;flex-direction:row;align-items:center;gap:8px}.criteria-container .criterion ui-icon ::ng-deep svg{color:#e9e9e9}.criteria-container .criterion span{text-align:center;font-size:14px;line-height:23px;color:#242424}.criteria-container .criterion.passed ui-icon ::ng-deep svg{color:#242424}.criteria-container .criterion.passed span{color:#666;text-decoration:line-through}.criteria-container .criterion.error ui-icon ::ng-deep svg{color:#e02800}.criteria-container .criterion.error span{color:#e02800}\n"]
|
|
176
|
+
}]
|
|
177
|
+
}],
|
|
178
|
+
ctorParameters: () => [{
|
|
179
|
+
type: void 0,
|
|
180
|
+
decorators: [{ type: Optional }, {
|
|
181
|
+
type: Inject,
|
|
182
|
+
args: ["CANOPYUI_DEFAULT_APPLICATION_THEME"]
|
|
183
|
+
}]
|
|
184
|
+
}],
|
|
185
|
+
propDecorators: {
|
|
186
|
+
applicationTheme: [{ type: Input }],
|
|
187
|
+
password: [{ type: Input }],
|
|
188
|
+
validationCheck: [{ type: Output }]
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
var PasswordStrengthComponentModule = class PasswordStrengthComponentModule {
|
|
192
|
+
static {
|
|
193
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
194
|
+
minVersion: "12.0.0",
|
|
195
|
+
version: "22.2.4",
|
|
196
|
+
ngImport: i0,
|
|
197
|
+
type: PasswordStrengthComponentModule,
|
|
198
|
+
deps: [],
|
|
199
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
static {
|
|
203
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
204
|
+
minVersion: "14.0.0",
|
|
205
|
+
version: "22.2.4",
|
|
206
|
+
ngImport: i0,
|
|
207
|
+
type: PasswordStrengthComponentModule,
|
|
208
|
+
imports: [
|
|
209
|
+
CommonModule,
|
|
210
|
+
IconComponentModule,
|
|
211
|
+
ProgressBarComponentModule,
|
|
212
|
+
UiTranslatePipe,
|
|
213
|
+
PasswordStrengthComponent
|
|
214
|
+
],
|
|
215
|
+
exports: [PasswordStrengthComponent]
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
static {
|
|
219
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
220
|
+
minVersion: "12.0.0",
|
|
221
|
+
version: "22.2.4",
|
|
222
|
+
ngImport: i0,
|
|
223
|
+
type: PasswordStrengthComponentModule,
|
|
224
|
+
imports: [
|
|
225
|
+
CommonModule,
|
|
226
|
+
IconComponentModule,
|
|
227
|
+
ProgressBarComponentModule,
|
|
228
|
+
PasswordStrengthComponent
|
|
229
|
+
]
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
234
|
+
minVersion: "12.0.0",
|
|
235
|
+
version: "22.2.4",
|
|
236
|
+
ngImport: i0,
|
|
237
|
+
type: PasswordStrengthComponentModule,
|
|
238
|
+
decorators: [{
|
|
239
|
+
type: NgModule,
|
|
240
|
+
args: [{
|
|
241
|
+
imports: [
|
|
242
|
+
CommonModule,
|
|
243
|
+
IconComponentModule,
|
|
244
|
+
ProgressBarComponentModule,
|
|
245
|
+
UiTranslatePipe,
|
|
246
|
+
PasswordStrengthComponent
|
|
247
|
+
],
|
|
248
|
+
exports: [PasswordStrengthComponent]
|
|
249
|
+
}]
|
|
250
|
+
}]
|
|
251
|
+
});
|
|
118
252
|
export { PasswordStrengthComponent, PasswordStrengthComponentModule };
|
|
119
|
-
|
|
253
|
+
|
|
254
|
+
//# sourceMappingURL=testgorilla-tgo-ui-components-password-strength.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-password-strength.mjs","sources":["../../../components/password-strength/password-strength.component.ts","../../../components/password-strength/password-strength.component.html","../../../components/password-strength/password-strength.component.module.ts"
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-password-strength.mjs","names":[],"sources":["../../../components/password-strength/password-strength.component.ts","../../../components/password-strength/password-strength.component.html","../../../components/password-strength/password-strength.component.module.ts"],"sourcesContent":["import { NgClass, AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, Optional, Output } from '@angular/core';\n\nimport { ApplicationTheme, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconName, IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ProgressBarComponentModule } from '@testgorilla/tgo-ui/components/progress-bar';\n\n@Component({\n selector: 'ui-password-strength',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './password-strength.component.html',\n styleUrls: ['./password-strength.component.scss'],\n imports: [ProgressBarComponentModule, NgClass, IconComponentModule, AsyncPipe, UiTranslatePipe],\n})\nexport class PasswordStrengthComponent {\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof PasswordStrengthComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * The password that needs to be checked\n * @property password\n * @type {string}\n * @memberof PasswordStrengthComponent\n */\n @Input() set password(value: string) {\n this._password = value;\n if (value && value.length > 0) {\n this.showError = true;\n }\n this.checkCriteria(this._password);\n }\n\n /**\n * Event that outputs validation check result\n * @property validationCheck\n * @type {boolean}\n * @memberof PasswordStrengthComponent\n */\n @Output() validationCheck = new EventEmitter<boolean>();\n\n protected progressValue: number;\n protected criteriaPassed: { [key: string]: boolean } = {};\n protected showError = false;\n private _password = '';\n protected criteria: { translateKey: string; key: string }[] = [\n { translateKey: 'PASSWORD.LOWERCASE', key: 'hasLowercase' },\n { translateKey: 'PASSWORD.UPPERCASE', key: 'hasUppercase' },\n { translateKey: 'PASSWORD.NUMBER', key: 'hasNumber' },\n { translateKey: 'PASSWORD.SPECIAL_CHARACTER', key: 'hasSpecialChar' },\n { translateKey: 'PASSWORD.CHARACTERS', key: 'hasMinLength' },\n ];\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (this.defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n checkCriteria(password: string): void {\n this.criteriaPassed = {\n hasLowercase: /^(?=.*?[a-z])/.test(password),\n hasUppercase: /^(?=.*?[A-Z])/.test(password),\n hasNumber: /^(?=.*?[0-9])/.test(password),\n hasSpecialChar: /^(?=.*?[\" !#$%&'()*+,-./:;<=>?@[\\]^_`{|}~])/.test(password),\n hasMinLength: password.length >= 12,\n };\n\n const passedCount = this.countPassed();\n this.progressValue = Math.min(Math.max(passedCount * (100 / Object.keys(this.criteriaPassed).length), 1), 100);\n this.validationCheck.emit(passedCount === Object.keys(this.criteriaPassed).length);\n }\n\n private countPassed(): number {\n let count = 0;\n for (const key in this.criteriaPassed) {\n if (Object.prototype.hasOwnProperty.call(this.criteriaPassed, key) && this.criteriaPassed[key]) {\n count++;\n }\n }\n return count;\n }\n\n get infoIcon(): IconName {\n return this.applicationTheme === 'classic' ? 'Info' : 'Info-in-line';\n }\n\n get checkIcon(): IconName {\n return this.applicationTheme === 'classic' ? 'Round-check' : 'Check-round-in-line';\n }\n}\n","<div class=\"criteria-container\">\n <div class=\"progress\">\n <ui-progress-bar\n [progress]=\"progressValue === 1 ? 0 : progressValue\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-progress-bar>\n </div>\n\n @for (criterion of criteria; track criterion) {\n <div\n class=\"criterion\"\n [ngClass]=\"{ passed: criteriaPassed[criterion.key], error: !criteriaPassed[criterion.key] && showError }\"\n >\n <ui-icon\n [size]=\"'24'\"\n [color]=\"'rebrand-black'\"\n [name]=\"!criteriaPassed[criterion.key] ? infoIcon : checkIcon\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-icon>\n <span>{{ criterion.translateKey | uiTranslate | async }}</span>\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ProgressBarComponentModule } from '@testgorilla/tgo-ui/components/progress-bar';\n\nimport { PasswordStrengthComponent } from './password-strength.component';\n\n@NgModule({\n imports: [CommonModule, IconComponentModule, ProgressBarComponentModule, UiTranslatePipe, PasswordStrengthComponent],\n exports: [PasswordStrengthComponent],\n})\nexport class PasswordStrengthComponentModule {}\n"],"mappings":";;;;;;;;AAcA,IAAa,4BAAb,MAAa,0BA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