import { PropDef, SyElement } from '@sylar_iii/ui'; import '@sylar_iii/ui/icon'; import type { SyInputAction, SyInputOption, SyInputType, SyOtpMode, SyPasswordRule, SyPasswordStrength, SyPasswordStrengthFn, SyPasswordToggle } from './input.types'; /** * One field for every kind of input: text types, password, textarea, select, multiselect and OTP. * Form-associated: it submits, resets and validates with its form like a native control. * * Icons: `icon`, `iconEnd`, `addonBeforeIcon`, `addonAfterIcon` and `actionIcon` take sy-* names or SVG URLs. * A CSS icon class (e.g. `pi pi-user`) goes in the light DOM as an element with the matching slot: * `prefix` (start), `suffix` (end), `addon-before`, `addon-after`. Its style comes from ::slotted() in the stylesheet. */ export declare class SyInputElement extends SyElement { static formAssociated: boolean; static shadowOptions: ShadowRootInit; static props: Record; static styles: string; /** The value of every type except multiselect. */ value: string; /** Selected values of a multiselect. */ values: string[]; type: SyInputType; label: string; /** Label inside the field that rises on focus or value. */ floatLabel: boolean; placeholder: string; /** id of the native control inside the shadow root. Generated when empty. */ inputId: string; /** Form field name. */ name: string; /** Native autocomplete. Empty uses 'current-password' for passwords, 'one-time-code' for OTP. */ autocomplete: string; hint: string; /** Error text; also marks the field invalid. Does not change validity. */ error: string; required: boolean; readonly: boolean; /** Inactive state. Also set by a disabled fieldset. */ disabled: boolean; /** Spinner at the end of the field. */ loading: boolean; /** Maximum length (text types, textarea). 0 = none. */ maxLength: number; /** Show "n / maxLength" under the field. */ showCounter: boolean; /** Clear button while the field has a value. */ clearable: boolean; /** Copy-to-clipboard button. */ copy: boolean; copyText: string; copiedText: string; appearance: 'outlined' | 'filled' | 'soft' | 'underlined'; shape: 'rounded' | 'pill' | 'square'; size: 'sm' | 'md' | 'lg'; /** Focus/accent color, any CSS color. */ color: string; /** CSS border-radius. Overrides shape. */ radius: string; /** Soft appearance: the shade (bottom-end) shadow color. Empty derives it from --sylar-bg. */ shadeColor: string; /** Soft appearance: the light (top-start) highlight color. Empty derives it from --sylar-bg. */ lightColor: string; /** Soft appearance: how far the surface is raised. 0 flat, 1 default, 2 deep. */ depth: number; /** Sylar icon name (sy-...) or SVG URL, drawn at the start. CSS icon classes go in the `prefix` slot. */ icon: string; /** Same as `icon`, drawn at the end. CSS icon classes go in the `suffix` slot. */ iconEnd: string; addonBefore: string; /** Sylar icon name or SVG URL shown in the before-addon. */ addonBeforeIcon: string; addonAfter: string; addonAfterIcon: string; action: SyInputAction; /** Sylar icon name or SVG URL for the action button. Empty uses the search icon. */ actionIcon: string; actionLabel: string; /** Options for select, multiselect and text suggestions. Plain strings are accepted too. */ options: ReadonlyArray; /** Search box inside the select / multiselect list. */ filter: boolean; filterPlaceholder: string; emptyText: string; /** Multiselect limit. 0 = none. */ maxSelected: number; min: number | null; max: number | null; step: number | null; /** Textarea rows. */ rows: number; /** Textarea grows with its content. */ autoResize: boolean; /** Number of OTP boxes. */ otpLength: number; otpMode: SyOtpMode; /** Hide OTP characters like a password. */ otpMask: boolean; /** Password show/hide control: `icon` eye, `text` Show/Hide link, `none`. */ toggle: SyPasswordToggle; showText: string; hideText: string; /** Password strength meter. */ strength: boolean; strengthLabel: string; /** Replaces the default level texts (Weak, Fair, Good, Strong). */ strengthTexts: Partial>; /** Custom scoring: receives the value and the rules. */ strengthFn: SyPasswordStrengthFn; /** Password requirements checklist. */ checklist: boolean; checklistTitle: string; /** Length used by the default password rules. */ minLength: number; /** Replaces the default password rules. */ rules: ReadonlyArray | null; /** Fails validity while a rule is not met. */ enforceRules: boolean; /** Button that fills a random password. */ generate: boolean; generateLength: number; generateText: string; /** Warns while Caps Lock is on (password). */ capsLockWarning: boolean; capsLockText: string; private readonly _internals; private readonly _autoId; private _built; private _hasInitial; private _initialValue; private _initialValues; private _formDisabled; private _open; private _active; private _query; private _visible; private _focused; private _capsLock; private _copied; private _copyTimer; private _lastStrength; private _typed; private _typedAt; private _hostClasses; private _otpBoxes; private readonly _optionOf; private readonly _chipOf; private _wrap; private _labelEl; private _floatEl; private _otpGroup; private _row; private _box; private _addonBefore; private _iconStart; private _control; private _native; private _area; private _chips; private _chipList; private _trigger; private _triggerIcon; private _triggerText; private _triggerSr; private _tools; private _spinner; private _clearBtn; private _generateBtn; private _copyBtn; private _eyeBtn; private _textToggle; private _iconEnd; private _chevron; private _suffix; private _action; private _addonAfter; private _panel; private _filterBox; private _list; private _emptyItem; private _caps; private _messages; private _error; private _hintEl; private _counter; private _strengthEl; private _strengthSr; private _strengthLevel; private _strengthLabel; private _strengthText; private _rulesEl; private _rulesTitle; private _rulesList; private readonly _onDocPointerDown; /** The form this element belongs to, if any. */ get form(): HTMLFormElement | null; /** Validity of the value, as a native control reports it. */ get validity(): ValidityState; get validationMessage(): string; checkValidity(): boolean; reportValidity(): boolean; /** Focuses the control; OTP focuses the first empty box. */ focus(options?: FocusOptions): void; connectedCallback(): void; disconnectedCallback(): void; formDisabledCallback(disabled: boolean): void; formResetCallback(): void; formStateRestoreCallback(state: File | string | FormData | null): void; protected render(root: ShadowRoot): void; protected update(): void; private _iconButton; private _slot; private _createOption; private _patchOption; private _createRule; private _patchRule; private _addon; private _syncAddon; private _syncHost; private _syncNative; private _syncArea; private _syncTrigger; private _syncChips; private _createChip; private _syncOtp; private _createOtpBox; private _syncTools; private _syncAction; private _id; private _isDisabled; private _items; private _hasSuggestions; private _shown; private _selectedItem; private _hasValue; private _isRaised; private _isSelected; private _limitReached; private _activeDescendant; private _otpChars; private _activeRules; private _level; private _describedBy; /** The control that takes focus and carries the validation message. */ private _anchorEl; /** Pushes the value to the form and recomputes validity. Runs after every change and before validity is read. */ private _sync; private _validate; private _detail; /** A value changed: sync the form, track strength and fire `input`. */ private _changed; /** A committed change (blur, choose, clear): fires `change`. */ private _commit; private _setValue; private _setValues; private _onInput; private _onFocus; private _onBlur; private _onTextKeydown; private _checkCaps; private _toggleVisibility; private _generatePassword; private _copyValue; private _clear; private _runAction; private _resize; private _toggleList; private _openList; private _closeList; private _activate; private _choose; private _removeValue; private _onTriggerKeydown; /** Letters move through the options (or choose, for a closed select), like a native select. */ private _typeAhead; /** Arrow/Home/End/Enter/Escape/Tab for an open list. Returns true when handled. */ private _listKey; private _onOtpFocus; private _onOtpInput; private _onOtpPaste; private _onOtpKeydown; private _otpWrite; private _focusOtp; } declare global { interface HTMLElementTagNameMap { 'sy-input': SyInputElement; } }