import { shortcut, Widget } from "@/core";

@shortcut()
export class Title extends Widget {
    static xtype = "demo.title";

    props = { baseCls: "demo-title" };

    render() {
        return {
            type: "bi.vertical",
            items: [
                {
                    type: "bi.label",
                    cls: "layout-bg1",
                    height: 50,
                    title: "title提示",
                    text: "移上去有title提示",
                    textAlign: "center",
                },
                {
                    type: "bi.label",
                    cls: "layout-bg6",
                    height: 50,
                    disabled: true,
                    warningTitle: "title错误提示",
                    text: "移上去有title错误提示",
                    textAlign: "center",
                },
                {
                    type: "bi.label",
                    cls: "layout-bg2",
                    height: 50,
                    disabled: true,
                    tipType: "success",
                    title: "自定义title提示效果",
                    warningTitle: "自定义title提示效果",
                    text: "自定义title提示效果",
                    textAlign: "center",
                },
                {
                    type: "bi.label",
                    cls: "layout-bg3",
                    height: 50,
                    title: () => "函数返回值作为title提示",
                    text: "title提示支持函数",
                    textAlign: "center",
                },
                {
                    type: "bi.label",
                    cls: "layout-bg4",
                    height: 50,
                    title() {
                        return {
                            level: "success",
                            text: "自定义title\n提示效果",
                            textAlign: "center",
                        };
                    },
                    text: "title提示支持对象,作为bi.tooltip的props",
                    textAlign: "center",
                }
            ],
            hgap: 300,
            vgap: 20,
        };
    }
}