From ad15757ccb81ddb387312bdd69440cc5e9f442b2 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Fri, 7 Jun 2024 12:05:40 +0300 Subject: [PATCH] Fixed #5816 - Invalid Prop Type For Strong and Medium Regex on Password Component --- components/lib/password/BasePassword.vue | 4 ++-- components/lib/password/Password.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/password/BasePassword.vue b/components/lib/password/BasePassword.vue index a8a34d561..42563f142 100644 --- a/components/lib/password/BasePassword.vue +++ b/components/lib/password/BasePassword.vue @@ -12,11 +12,11 @@ export default { default: null }, mediumRegex: { - type: String, + type: [String, RegExp], default: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})' // eslint-disable-line }, strongRegex: { - type: String, + type: [String, RegExp], default: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})' // eslint-disable-line }, weakLabel: { diff --git a/components/lib/password/Password.d.ts b/components/lib/password/Password.d.ts index 6c305c8ac..67f53c105 100755 --- a/components/lib/password/Password.d.ts +++ b/components/lib/password/Password.d.ts @@ -178,12 +178,12 @@ export interface PasswordProps extends InputHTMLAttributes { * Regex for a medium level password. * @defaultValue ^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,}) */ - mediumRegex?: string | undefined; + mediumRegex?: string | RegExp | undefined; /** * Regex for a strong level password. * @defaultValue ^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,}) */ - strongRegex?: string | undefined; + strongRegex?: string | RegExp | undefined; /** * Text for a weak password. Defaults to PrimeVue Locale configuration. */