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. */