import { LitElement, PropertyValues } from '../../../../../node_modules/lit'; import { SbAuthIdentifier } from '../../../../types'; import { IdentifierFieldAutocomplete, IdentifierFieldPart, IdentifierFieldValidation, SbIdentifierFieldProps as Props } from './field.types'; /** * Self-validating identifier input field for use in auth widget forms. * * @part identifier-field - rtg-field: root * @part identifier-field-label - rtg-field-label * @part identifier-field-mark - span: decorative marker text/caret in label * @part identifier-field-description - rtg-field-description * @part identifier-field-input - rtg-input * @part identifier-field-error - rtg-field-error: inline validation error message * * @event sb-identifier-field:validate - Fired when validation runs, on form submit or via the public `validate()` method. * Detail: `{ id: string; inputId: string; name: string; identifiers: SbIdentifier[]; value: string; valid: boolean; type: IdentifierFieldValidateType; message: string }` * - type: `"success" | "required"` */ export declare class SbIdentifierField extends LitElement implements Props { static readonly ROOT = "identifier-field"; static readonly LABEL = "label"; static readonly MARK = "mark"; static readonly DESCRIPTION = "description"; static readonly INPUT = "input"; static readonly ERROR = "error"; static readonly TAG: string; static readonly VALIDATE_EVENT: string; static readonly PARTS: Record; static readonly INPUT_SELECTORS: string; /** * Substring used in generated part IDs. */ seed: string; /** * Custom ID used as the root part ID and as the base of subpart IDs. */ customId?: string; /** * ID given to the input part, forwarded to its inner input element. */ private _inputId?; private get _defaultInputId(); get inputId(): string; set inputId(value: string | null | undefined); /** * HTML `name` attribute forwarded to the inner input, used as the form data * key on submission. */ private _name; get name(): string; set name(value: string); /** * Pre-fills the input until the user types and their input takes over. * Resetting the form restores this value. */ defaultValue?: string; /** * Accepted authentication identifier types. */ identifiers: SbAuthIdentifier[]; /** * Text used in the label part of the field. */ private _label?; private get _defaultLabel(); get label(): string; set label(value: string | null | undefined); /** * Placeholder text shown inside the input when empty. */ placeholder?: string; /** * Text used in the description part of the field. */ description?: string; /** * Custom text used in the mark part of the field label. */ mark?: string; /** * When provided with `required`, the mark part is rendered with an asterisk. * Has no effect if a custom `mark` text is provided. */ caret?: boolean; /** * HTML `autocomplete` hint forwarded to the inner input element. */ autocomplete?: IdentifierFieldAutocomplete; /** * Disables the field and its inner input element, preventing interaction. */ disabled?: boolean; /** * Marks the field as required: validation fails if field is empty. */ required?: boolean; /** * Controls validation depth, only enforcing the required check if `"simple"`. */ validation: IdentifierFieldValidation; /** * Error message used when the field is required but empty. */ private _requiredError?; private get _defaultRequiredError(); get requiredError(): string; set requiredError(value: string | null | undefined); /** * Tracks whether the field is currently in an invalid state. */ private _invalid; /** * Error message displayed in the error part when the field is invalid. */ private _error; /** * Raw value of the identifier field input, synced on each input event. */ private _value; /** * Gates whether `defaultValue` or `_value` is authoritative for `this.value`. * True once the user has typed into the input. */ private _dirty; /** * Reference to the nearest `
` ancestor. */ private _form; protected createRenderRoot(): this; get rootId(): string; get labelId(): string; get markId(): string; get descriptionId(): string; get errorId(): string; /** * Normalized value of the identifier field input. */ get value(): string; /** * Input element `type`, using identifier-specific types if possible. */ private get _type(); updated(changed: PropertyValues): void; connectedCallback(): void; disconnectedCallback(): void; /** * Triggers validation and returns `true` if the current value is valid, * `false` otherwise. */ validate(): boolean; private _dispatchValidate; private _onValidateSuccess; private _onValidateError; private _validate; private _handleInput; private _handleFormSubmit; private _handleFormReset; private _renderMark; render(): import('../../../../../node_modules/lit-html').TemplateResult<1>; }