initial commit

This commit is contained in:
2026-02-26 21:29:34 +01:00
commit d9d84634e8
72 changed files with 18491 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
import { defineStore } from 'pinia'
export const usePasswordToolBoxStore = defineStore('passwordToolBox', {
state: () => ({
password: '',
confirmPassword: '',
// --- REGEX ---
regNumberOfCaracteres: /^.{8,22}$/,
regSpecialCaractere: /[^A-Za-z0-9]/,
regCapitalizeCaractere: /[A-Z]/,
regMinimizeCaractere: /[a-z]/,
regNumber: /\d/,
regPassword: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,22}$/,
}),
actions: {
updatePassword(newPassword: string) {
this.password = newPassword
},
updateConfirmPassword(newConfirm: string) {
this.confirmPassword = newConfirm
},
// --- CHECK FUNCTIONS ---
checkRegex(regex: RegExp) {
return regex.test(this.password)
},
isNumberOfCaracteresValid() {
return this.checkRegex(this.regNumberOfCaracteres)
},
isSpecialCaractereValid() {
return this.checkRegex(this.regSpecialCaractere)
},
isCapitalizeCaractereValid() {
return this.checkRegex(this.regCapitalizeCaractere)
},
isMinimizeCaractereValid() {
return this.checkRegex(this.regMinimizeCaractere)
},
isNumberValid() {
return this.checkRegex(this.regNumber)
},
isPasswordValid() {
return this.checkRegex(this.regPassword)
},
isPasswordConfirmationValid() {
return this.password === this.confirmPassword && this.isPasswordValid()
},
// --- UI HELPER ---
uiClass(valid: boolean) {
return valid ? 'has-success' : 'has-error'
}
}
})