import { CustomSignalClass, Signal } from "typescene-async"; import Component from "../Component"; import { ComponentFactory, ValueOrAsync } from "../ComponentFactory"; import { ComponentRenderHtmlOutput } from "../ComponentRenderOutput"; /** UI control element base class */ export declare abstract class ControlElement extends Component { /** Create a control element (to be overridden) */ constructor(); /** Signal that is emitted whenever any control element receives focus */ static readonly ControlFocused: CustomSignalClass>; /** Initialize a control factory with given values */ static with: (values: ControlElement.Initializer) => ComponentFactory; /** Initialize with given (observable) values; returns this */ initializeWith: (values: ControlElement.Initializer) => this; /** Rendered output for this component (observable) */ out: ComponentRenderHtmlOutput; /** Control element ID */ protected elementID: string; private static _lastEltID; /** Width (CSS value), default auto (observed) */ width: string; /** Set to true to shrink this element to use as little horizontal space as possible in a row; set to false to expand (default false; observed) */ shrinkwrap: boolean; /** Set to true to automatically break text across lines (observed) */ wrapText: boolean; /** True if this element or a sub element has focus (observed/able) */ hasFocus: boolean; private _observeWidth; private _observeWrapText; private _domFocus; private _canFocus; } export declare namespace ControlElement { /** Initializer for .with({ ... }) */ interface Initializer extends Component.Initializer { /** Property initializer */ width?: ValueOrAsync; /** Property initializer */ shrinkwrap?: ValueOrAsync; /** Property initializer */ hasFocus?: ValueOrAsync; } } export default ControlElement;