UNPKG

@universal-material/web

Version:
68 lines 2.53 kB
import { Context, ContextProvider } from '@lit/context'; import { CSSResultGroup } from '@lit/reactive-element/css-tag'; import { LitElement, nothing, TemplateResult } from 'lit'; import { UmFieldDefaults } from './field-defaults.js'; export declare abstract class UmFieldBase extends LitElement { static styles: CSSResultGroup; private readonly config; variant: 'filled' | 'outlined' | undefined; /** * The floating label for the field */ label: string | undefined; protected _innerCounter: string | undefined; counter: string | undefined; hideCounter: boolean; /** * Supporting text conveys additional information about the field, such as how it will be used */ supportingText: string | undefined; /** * For text fields that validate their content (such as passwords), replace supporting text with error text when applicable. * If `errorText` is not an empty string, changing the property `invalid` to `true` will show the `errorText` instead of `supportingText` */ errorText: string | undefined; /** * Whether the field is empty or not. This changes the behavior of the floating label when the field is not focused. */ empty: boolean; disabled: boolean; /** * Get or sets where or not the field is in a visually invalid state. */ invalid: boolean; static setDefaults(contextRoot: HTMLElement, config: UmFieldDefaults): ContextProvider<Context<HTMLElement, UmFieldDefaults>>; /** * Whether the field has a leading icon or not * * _Note:_ Readonly */ hasLeadingIcon: boolean; /** * Whether the field has a trailing icon or not * * _Note:_ Readonly */ hasTrailingIcon: boolean; /** * Whether the field has an error text or not * * _Note:_ Readonly */ hasErrorText: boolean; private readonly assignedLeadingIcons; private readonly assignedTrailingIcons; private readonly assignedErrorTexts; private readonly _labelElement; protected _container: HTMLElement; constructor(); protected render(): TemplateResult; protected abstract renderControl(): TemplateResult; protected renderAfterContent(): TemplateResult; connectedCallback(): void; private handleLeadingIconSlotChange; private handleTrailingIconSlotChange; private handleErrorTextSlotChange; protected renderDefaultTrailingIcon(): TemplateResult | typeof nothing; } //# sourceMappingURL=field-base.d.ts.map