velocity-ui
    Preparing search index...

    Variable defaultConst

    default: {
        BaseComponent: typeof BaseComponent;
        components: Map<string, ComponentConstructor>;
        config: VelocityConfig;
        DataSource: typeof DataSource;
        DateUtils: typeof DateUtils;
        DOMUtils: typeof DOMUtils;
        EventManager: typeof EventManager;
        StringUtils: typeof StringUtils;
        ThemeManager: typeof ThemeManager;
        ValidationUtils: typeof ValidationUtils;
        Validator: typeof Validator;
        version: "1.0.0";
        create(
            name: string,
            element: string | HTMLElement,
            options?: Record<string, any>,
        ): null | ComponentInstance;
        destroy(context?: HTMLElement | Document): void;
        getComponent(name: string): null | ComponentConstructor;
        getConfig<K extends keyof VelocityConfig>(
            key?: K,
        ): K extends undefined ? VelocityConfig : VelocityConfig[K];
        getTheme(): string;
        init(context?: HTMLElement | Document): void;
        isReady(): boolean;
        ready(callback: () => void): void;
        register(name: string, componentClass: ComponentConstructor): void;
        setConfig(key: string | Partial<VelocityConfig>, value?: any): void;
        setTheme(theme: string): void;
    } = ...

    VelocityUI Main Object

    Type declaration

    • BaseComponent: typeof BaseComponent
    • components: Map<string, ComponentConstructor>
    • config: VelocityConfig
    • DataSource: typeof DataSource
    • DateUtils: typeof DateUtils
    • DOMUtils: typeof DOMUtils
    • EventManager: typeof EventManager
    • StringUtils: typeof StringUtils
    • ThemeManager: typeof ThemeManager
    • ValidationUtils: typeof ValidationUtils
    • Validator: typeof Validator
    • version: "1.0.0"
    • create: function
      • Create component instance

        Parameters

        • name: string

          Component name

        • element: string | HTMLElement

          Target element

        • options: Record<string, any> = {}

          Component options

        Returns null | ComponentInstance

        Component instance or null

    • destroy: function
      • Destroy all component instances in context

        Parameters

        • context: HTMLElement | Document = document

          Context element

        Returns void

    • getComponent: function
      • Get a registered component

        Parameters

        • name: string

          Component name

        Returns null | ComponentConstructor

        Component class or null

    • getConfig: function
      • Get global configuration

        Type Parameters

        • K extends keyof VelocityConfig

        Parameters

        • Optionalkey: K

          Configuration key

        Returns K extends undefined ? VelocityConfig : VelocityConfig[K]

        Configuration value

    • getTheme: function
      • Get current theme

        Returns string

        Current theme name

    • init: function
      • Initialize components from data attributes

        Parameters

        • context: HTMLElement | Document = document

          Context element (default: document)

        Returns void

    • isReady: function
      • Check if VelocityUI is ready

        Returns boolean

        True if ready

    • ready: function
      • Execute callback when VelocityUI is ready

        Parameters

        • callback: () => void

          Callback function

        Returns void

    • register: function
      • Register a component

        Parameters

        • name: string

          Component name

        • componentClass: ComponentConstructor

          Component class

        Returns void

    • setConfig: function
      • Set global configuration

        Parameters

        • key: string | Partial<VelocityConfig>

          Configuration key or object

        • Optionalvalue: any

          Configuration value

        Returns void

    • setTheme: function
      • Set global theme

        Parameters

        • theme: string

          Theme name

        Returns void