import { JSXInterface } from '../jsx'; import { CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core'; import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js'; import '@refinitiv-ui/phrasebook/locale/en/password-field.js'; import { Translate } from '@refinitiv-ui/translate'; import '../icon/index.js'; import { TextField } from '../text-field/index.js'; /** * A form control element for password. * * @fires value-changed - Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically. * @fires error-changed - Fired when user inputs an invalid value. The event is not triggered if `error` property is changed programmatically. * * @attr {boolean} disabled - Set disabled state * @prop {boolean} [disabled=false] - Set disabled state * * @attr {boolean} error - Set error state * @prop {boolean} [error=false] - Set error state * * @attr {string} pattern - Set regular expression for input validation * @prop {string} [pattern=""] - Set regular expression for input validation * * @attr {string} placeholder - Set placeholder text * @prop {string} [placeholder=""] - Set placeholder text * * @attr {boolean} readonly - Set readonly state * @prop {boolean} [readonly=false] - Set readonly state * * @attr {boolean} transparent - Disables all other states and border/background styles. * @prop {boolean} [transparent=false] - Disables all other states and border/background styles. * * @attr {boolean} warning - Set warning state * @prop {boolean} [warning=false] - Set warning state * * @attr {string} value - Input's value * @prop {string} [value=""] - Input's value * * @attr {boolean} clears - Show clears button * @prop {boolean} [clears=false] - Show clears button */ export declare class PasswordField extends TextField { /** * Set character max limit */ maxLength: number | null; /** * Set character min limit */ minLength: number | null; /** * Used for translations */ protected t: Translate; /** * Defines whether password is visible or not */ private isPasswordVisible; /** * live region content presenting password field visibility state */ private liveRegionContent; /** * A `CSSResultGroup` that will be used to style the host, * slotted children and the internal template of the element. * @returns CSS template */ static get styles(): CSSResultGroup; /** * Called when the element’s DOM has been updated and rendered for the first time * @param changedProperties Properties that has changed * @return shouldUpdate */ protected firstUpdated(changedProperties: PropertyValues): void; /** * Returns `true` if the element input is valid; otherwise, returns `false`. * @returns element input validity */ checkValidity(): boolean; /** * Validate the element input and mark it as error if its input is invalid. * @returns `true` if the element input is valid; otherwise, returns `false`. */ reportValidity(): boolean; /** * Decorate `` element with common properties extended from text-field: * type="text|password" - text if password is visible * @returns template map */ protected get decorateInputMap(): TemplateMap; /** * Renders icon element * @returns {void} */ protected renderIcon(): TemplateResult | null; /** * update live region content describing password visibility state * @param event event trigging live region content update * @return void */ protected updateLiveRegionContent(event: Event): void; /** * Handle tap events of toggle password icon * @param event custom event * @returns {void} */ protected onTogglePasswordTap(event: CustomEvent): void; /** * Toggles password visibility state * @return void */ protected togglePasswordVisibility(): void; } declare global { interface HTMLElementTagNameMap { 'ef-password-field': PasswordField; } } declare global { interface HTMLElementTagNameMap { 'ef-password-field': PasswordField; } namespace JSX { interface IntrinsicElements { 'ef-password-field': Partial | JSXInterface.HTMLAttributes; } } } export {};