@arsedizioni/ars-utils 20.0.16 → 20.0.18

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.
@@ -1031,7 +1031,7 @@ declare class ClipperDocumentMenuComponent implements OnInit, OnDestroy {
1031
1031
  private changeDetector;
1032
1032
  private clipperService;
1033
1033
  readonly useSelections: _angular_core.InputSignal<boolean>;
1034
- readonly selectionSource: _angular_core.InputSignal<"selection" | "bag" | "none">;
1034
+ readonly selectionSource: _angular_core.InputSignal<"none" | "selection" | "bag">;
1035
1035
  protected selection: () => ClipperDocumentInfo[];
1036
1036
  readonly parent: _angular_core.InputSignal<ClipperSearchResultManager>;
1037
1037
  readonly item: _angular_core.InputSignal<ClipperDocumentInfo>;
package/core/index.d.ts CHANGED
@@ -112,10 +112,10 @@ declare enum DateFormat {
112
112
  ShortISO8601 = 12
113
113
  }
114
114
  interface PasswordStrength {
115
- score: number;
116
- label: string;
117
- color: string;
118
- suggestions: string[];
115
+ score?: number;
116
+ label?: string;
117
+ color?: string;
118
+ suggestions?: string[];
119
119
  isValid: boolean;
120
120
  }
121
121
  declare class SystemUtils {
@@ -673,82 +673,86 @@ class SystemUtils {
673
673
  * @returns the password strength info
674
674
  */
675
675
  static calculatePasswordStrength(password) {
676
- let score = 0;
677
- const suggestions = [];
678
- // Length
679
- if (password.length >= 10)
680
- score++;
681
- else
682
- suggestions.push('Usa almeno 10 caratteri');
683
- if (password.length >= 12)
684
- score++;
685
- else if (password.length >= 10)
686
- suggestions.push('Considera di usare più di 12 caratteri');
687
- // Lowercase letters
688
- if (/[a-z]/.test(password))
689
- score++;
690
- else
691
- suggestions.push('Aggiungi lettere minuscole');
692
- // Uppercase letters
693
- if (/[A-Z]/.test(password))
694
- score++;
695
- else
696
- suggestions.push('Aggiungi lettere maiuscole');
697
- // Numbers
698
- if (/\d/.test(password))
699
- score++;
700
- else
701
- suggestions.push('Aggiungi numeri');
702
- // Special characters
703
- if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(password))
704
- score++;
705
- else
706
- suggestions.push('Aggiungi caratteri speciali (!@#$%^&*)');
707
- // Common patterns
708
- if (/(.)\1{2,}/.test(password)) {
709
- score = Math.max(0, score - 1);
710
- suggestions.push('Evita di ripetere lo stesso carattere');
711
- }
712
- if (/123|abc|qwe/i.test(password)) {
713
- score = Math.max(0, score - 1);
714
- suggestions.push('Evita sequenze comuni (123, abc, qwe)');
715
- }
716
- // Label and color
717
- let label;
718
- let color;
719
- let isValid;
720
- if (score <= 2) {
721
- label = 'Molto debole';
722
- color = '#f44336';
723
- isValid = false;
724
- }
725
- else if (score <= 3) {
726
- label = 'Debole';
727
- color = '#ff9800';
728
- isValid = false;
729
- }
730
- else if (score <= 4) {
731
- label = 'Media';
732
- color = '#ffc107';
733
- isValid = true;
734
- }
735
- else if (score <= 5) {
736
- label = 'Forte';
737
- color = '#8bc34a';
738
- isValid = true;
676
+ if (password?.length > 0) {
677
+ let score = 0;
678
+ const suggestions = [];
679
+ // Length
680
+ if (password.length >= 10)
681
+ score++;
682
+ else
683
+ suggestions.push('Usa almeno 10 caratteri');
684
+ if (password.length >= 12)
685
+ score++;
686
+ else if (password.length >= 10)
687
+ suggestions.push('Considera di usare più di 12 caratteri');
688
+ // Lowercase letters
689
+ if (/[a-z]/.test(password))
690
+ score++;
691
+ else
692
+ suggestions.push('Aggiungi lettere minuscole');
693
+ // Uppercase letters
694
+ if (/[A-Z]/.test(password))
695
+ score++;
696
+ else
697
+ suggestions.push('Aggiungi lettere maiuscole');
698
+ // Numbers
699
+ if (/\d/.test(password))
700
+ score++;
701
+ else
702
+ suggestions.push('Aggiungi numeri');
703
+ // Special characters
704
+ if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(password))
705
+ score++;
706
+ else
707
+ suggestions.push('Aggiungi caratteri speciali (!@#$%^&*)');
708
+ // Common patterns
709
+ if (/(.)\1{2,}/.test(password)) {
710
+ score = Math.max(0, score - 1);
711
+ suggestions.push('Evita di ripetere lo stesso carattere');
712
+ }
713
+ if (/123|abc|qwe/i.test(password)) {
714
+ score = Math.max(0, score - 1);
715
+ suggestions.push('Evita sequenze comuni (123, abc, qwe)');
716
+ }
717
+ // Label and color
718
+ let label;
719
+ let color;
720
+ let isValid;
721
+ if (score <= 2) {
722
+ label = 'Molto debole';
723
+ color = '#f44336';
724
+ isValid = false;
725
+ }
726
+ else if (score <= 3) {
727
+ label = 'Debole';
728
+ color = '#ff9800';
729
+ isValid = false;
730
+ }
731
+ else if (score <= 4) {
732
+ label = 'Media';
733
+ color = '#ffc107';
734
+ isValid = true;
735
+ }
736
+ else if (score <= 5) {
737
+ label = 'Forte';
738
+ color = '#8bc34a';
739
+ isValid = true;
740
+ }
741
+ else {
742
+ label = 'Molto forte';
743
+ color = '#4caf50';
744
+ isValid = true;
745
+ }
746
+ return {
747
+ score: score,
748
+ label: label,
749
+ color: color,
750
+ suggestions: suggestions,
751
+ isValid: isValid
752
+ };
739
753
  }
740
- else {
741
- label = 'Molto forte';
742
- color = '#4caf50';
743
- isValid = true;
744
- }
745
- return {
746
- score: score,
747
- label: label,
748
- color: color,
749
- suggestions: suggestions,
750
- isValid
751
- };
754
+ else
755
+ return { isValid: false };
752
756
  }
753
757
  /**
754
758
  * Check if current browser supports touch