/**  
 * @since Last modified: 2024-09-10 11:20:41
 * @see {@link https://codepen.io/axui/pen/yLwbrvm|demo @ codepen}
 * @example
 * ax.Tooltip('#id');
 */
import getEl from '../utils/getEl';
import extend from '../utils/extend';
import isEmpty from '../utils/isEmpty';
import instance from '../utils/instance';
import preventDft from '../utils/preventDft';
import { T_el, T_fn, T_fn_obj, T_obj, T_required, T_sel } from '../../../types/ax';
import ax from '../ax';
import { T_popup } from '../../../types/popup';
import prefix from '../global/prefix';
import alias from '../global/alias';
import Popup from './Popup';
import isNull from '../utils/isNull';
import config from '../global/config';
class Tooltip extends Popup {
    options: any;
    constructor(elem: T_sel, options: T_popup={}, initial: boolean = config.initial) {
        isNull(options.size) ? (options as T_obj).size = 'sm' : null;
        options?.tools === true ? options.tools = { enable: true, placement: 'outside' } : !options?.tools ? (options as T_obj).tools = { enable: false, placement: 'outside' } : null;
        !options?.placement ? (options as T_obj).placement = 'top' : null;
        !options?.footer ? (options as T_obj).footer = false : null;
        !options?.padding ? (options as T_obj).padding = false : null;
        !options?.theme ? (options as T_obj).theme = 'text' : null;
        super(elem, options, initial);
        this.on('init', () => {
            this.mainEl.classList.add(`${prefix}tooltip`);
        });
    }
}
export default Tooltip;
