Fixed #1836 - For Password
parent
d75cda39c6
commit
c222aa74e6
|
@ -1,33 +1,124 @@
|
||||||
import { VNode } from 'vue';
|
import { VNode, InputHTMLAttributes } from 'vue';
|
||||||
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
||||||
|
|
||||||
interface PasswordProps {
|
type PasswordAppendToType = 'body' | 'self' | string | undefined;
|
||||||
modelValue?: string;
|
|
||||||
promptLabel?: string;
|
export interface PasswordProps extends InputHTMLAttributes {
|
||||||
mediumRegex?: string;
|
/**
|
||||||
strongRegex?: string;
|
* Value of the component.
|
||||||
weakLabel?: string;
|
*/
|
||||||
mediumLabel?: string;
|
modelValue?: string | undefined;
|
||||||
strongLabel?: string;
|
/**
|
||||||
feedback?: boolean;
|
* Text to prompt password entry. Defaults to PrimeVue Locale configuration.
|
||||||
appendTo?: string;
|
*/
|
||||||
toggleMask?: boolean;
|
promptLabel?: string | undefined;
|
||||||
hideIcon?: string;
|
/**
|
||||||
showIcon?: string;
|
* Regex for a medium level password.
|
||||||
|
* Default value is '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})'.
|
||||||
|
*/
|
||||||
|
mediumRegex?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Regex for a strong level password.
|
||||||
|
* Default value is '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})'.
|
||||||
|
*/
|
||||||
|
strongRegex?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text for a weak password. Defaults to PrimeVue Locale configuration.
|
||||||
|
*/
|
||||||
|
weakLabel?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text for a medium password. Defaults to PrimeVue Locale configuration.
|
||||||
|
*/
|
||||||
|
mediumLabel?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Text for a strong password. Defaults to PrimeVue Locale configuration.
|
||||||
|
*/
|
||||||
|
strongLabel?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Whether to show the strength indicator or not.
|
||||||
|
* Default value is true.
|
||||||
|
*/
|
||||||
|
feedback?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are "body" for document body and "self" for the element itself.
|
||||||
|
* @see PasswordAppendToType
|
||||||
|
* Default value is 'body'.
|
||||||
|
*/
|
||||||
|
appendTo?: PasswordAppendToType;
|
||||||
|
/**
|
||||||
|
* Whether to show an icon to display the password as plain text.
|
||||||
|
*/
|
||||||
|
toggleMask?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Icon to hide displaying the password as plain text.
|
||||||
|
* Default value is 'pi pi-eye-slash'.
|
||||||
|
*/
|
||||||
|
hideIcon?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Icon to show displaying the password as plain text.
|
||||||
|
* Default value is 'pi pi-eye'.
|
||||||
|
*/
|
||||||
|
showIcon?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Inline style of the input field.
|
||||||
|
*/
|
||||||
inputStyle?: any;
|
inputStyle?: any;
|
||||||
inputClass?: string;
|
/**
|
||||||
|
* Style class of the input field.
|
||||||
|
*/
|
||||||
|
inputClass?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Inline style of the component.
|
||||||
|
*/
|
||||||
style?: any;
|
style?: any;
|
||||||
class?: string;
|
/**
|
||||||
panelClass?: string;
|
* Style class of the component input field.
|
||||||
|
*/
|
||||||
|
class?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Style class of the overlay panel.
|
||||||
|
*/
|
||||||
|
panelClass?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class Password {
|
export interface PasswordSlots {
|
||||||
$props: PasswordProps;
|
/**
|
||||||
$emit(eventName: 'update:modelValue', value: string): this;
|
* Custom header template.
|
||||||
$slots: {
|
*/
|
||||||
header: VNode[];
|
header: () => VNode[];
|
||||||
footer: VNode[];
|
/**
|
||||||
content: VNode[];
|
* Custom footer template.
|
||||||
|
*/
|
||||||
|
footer: () => VNode[];
|
||||||
|
/**
|
||||||
|
* Custom content template.
|
||||||
|
*/
|
||||||
|
content: () => VNode[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare type PasswordEmits = {
|
||||||
|
/**
|
||||||
|
* Emitted when the value changes.
|
||||||
|
* @param {string} value - New value.
|
||||||
|
*/
|
||||||
|
'update:modelValue': (value: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class Password extends ClassComponent<PasswordProps, PasswordSlots, PasswordEmits> { }
|
||||||
|
|
||||||
|
declare module '@vue/runtime-core' {
|
||||||
|
interface GlobalComponents {
|
||||||
|
Password: GlobalComponentConstructor<Password>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Password displays strength indicator for password fields.
|
||||||
|
*
|
||||||
|
* Demos:
|
||||||
|
*
|
||||||
|
* - [Password](https://www.primefaces.org/primevue/showcase/#/password)
|
||||||
|
*
|
||||||
|
*/
|
||||||
export default Password;
|
export default Password;
|
||||||
|
|
Loading…
Reference in New Issue