//-*
     普通butto按钮
     content:按钮内容
     width:按钮宽度
     height:按钮高度
     out:鼠标移开颜色,
     hover:鼠标over颜色,
     active:激活状态颜色,如果有激活状态out,hover忽略
//-*/
//-mixin createHashId()
//-    - classHashId = classHashId.split('_')[0] +'_'+(parseInt(classHashId.split('_')[1])+1);

block ui-widget-button
    -if(!document||(document&&!(document.querySelector("style[UID='ui-widget-button']"))))
        style(UID='ui-widget-button').
            .ui-widget-button {
                display: inline-block;
                outline:none;
                cursor: pointer;
                font-size: 12px;
                padding: 0 10px;
                text-align: center;
            }
            .ui-widget-button-active {
                display: inline-block;
                outline:none;
                cursor: pointer;
                font-size: 12px;
                padding: 0 10px;
                text-align: center;
                color: #fff;
            }
    - var classHashId='';
    mixin genearalStyle(out,hover,outBg,hoverBg,active,groupID)

        - var hoverColor = hover
        - var outColor = out;
        - var hoverColorBg = hoverBg
        - var outColorBg = outBg;
        - var activeColor = active;
        - var _classHashId_=(groupID&&classHashId==groupID)?'.'+groupID:'.'+classHashId;
        - var _elm = document?document.querySelector("style[UID='ui-widget-button-inner-"+classHashId+"']"):null;
            //if(!document||(document&&!(_elm))||!_elm)
            style(UID='ui-widget-button-inner-'+classHashId).
                .ui-widget-button#{_classHashId_} > a:hover {
                    color: #{hoverColor};
                    background: #{hoverColorBg};
                    border: 1px solid #bababa;
                }
                .ui-widget-button#{_classHashId_} > a {
                    display: block;
                    color: #{outColor};
                    background: #{outColorBg};
                    border: 1px solid #ddd;
                    border-radius: 5px 5px;
                    text-decoration: none;
                }
                .ui-widget-button-active#{_classHashId_} > a {
                    color: #fff;
                    display: block;
                    border: 1px solid #{activeColor};
                    border-radius: 5px 5px;
                    background: #{activeColor};
                    text-decoration: none;
                }

    //-是否激活状态
    mixin genearalLabal(custom,content,width,height,active)
        if(!active)
            .ui-widget-button(custom=custom class='#{classHashId}' type="submit")
                a(style="width:" + width + ";height:"+ height +";line-height:" + height)= content
        else
            .ui-widget-button-active(custom=custom class='#{classHashId}' type="submit")
                a(style="width:" + width + ";height:"+ height +";line-height:" + height)= content

    //-通用按钮元素,默认类型,以组的方式存在,组内样式通用
    //-示例:ui-widget-button-default()(content='文本内容',width='宽px',height='高px',out='鼠标移开文字颜色',hover='鼠标触发文字颜色',outBg='鼠标移开背景颜色',hoverBg='鼠标触发背景颜色',active='激活颜色,8位颜色值',groupID='分组id')
    mixin ui-widget-button-default(custom)
        - var content = attributes.content||'',
        - width = attributes.width||'100px',
        - height = attributes.height||'50px',
        - out = attributes.out || '#fff',outBg = attributes.outBg || '#F2701E',
        - hover = attributes.hover || '#000',hoverBg = attributes.hoverBg || '#fff',
        - active = attributes.active || false,
        - groupID = attributes.groupID || 'default';groupID ="groupID-"+groupID;
        - classHashId=groupID;//css class 按组来起名
        +genearalStyle(out,hover,outBg,hoverBg,active,groupID)
        +genearalLabal(custom,content,width,height,active)

    //-特殊按钮元素,以单个样式存在,通过hash值不同,命名不同
    //-示例:ui-widget-button-single()(content='文本内容',width='宽px',height='高px',out='鼠标移开文字颜色',hover='鼠标触发文字颜色',outBg='鼠标移开背景颜色',hoverBg='鼠标触发背景颜色',active='激活颜色,8位颜色值',groupID='分组id')
    mixin ui-widget-button-single(custom)
        - var content = attributes.content||'',
        - width = attributes.width||'100px',
        - height = attributes.height||'50px',
        - out = attributes.out || '#fff',outBg = attributes.outBg || '#F2701E',
        - hover = attributes.hover || '#000',hoverBg = attributes.hoverBg || '#fff',
        - active = attributes.active || false,
        - groupID = attributes.groupID || 'default';

        +createHashId()
        - classHashId=__classHashId__;
        +genearalStyle(out,hover,outBg,hoverBg,active,groupID)
        +genearalLabal(custom,content,width,height,active)
