@import "../node_modules/tinper-bee-core/scss/minxin-variables";
@import "../node_modules/tinper-bee-core/scss/minxin-mixins";
@import "../node_modules/bee-form-control/src/FormControl.scss";
@import "../node_modules/bee-input-group/src/InputGroup.scss";

$disable-border-color:#dfe1e6;

.u-input-number {
    width: 100%;
    border: 1px solid $border-color-base;
    border-radius: $border-radius;
    &-out{
        position: relative;
    }
    &-placeholder{
        color: #757575;
        position: absolute;
        z-index: 2;
        font-size: 12px;
        width: calc(100% - 34px);
        white-space: nowrap;
        overflow: hidden;
    }
    &.u-input-group.simple .u-input-number-placeholder{
        left: 12px;
        top: 8px;
    }
    &.u-input-number-sm {
        .u-input-number-placeholder{
            left: 31px;
            top: 4px;
            width: calc(100% - 63px);
            text-align: center;
        }
        &.u-input-group.simple {
            .u-input-group-btn .icon-group{
                height: 26px;
            }
            .u-input-number-placeholder{
                top: 4px;
                text-align: left;
                width: auto;
                max-width: calc(100% - 63px);
            }
        }
        
        
    }
    &.u-input-number-lg {
        .u-input-number-placeholder{
            left: 31px;
            top: 12px;
            width: calc(100% - 63px);
            text-align: center;
        }
        &.u-input-group.simple{
            .u-input-group-btn .icon-group{
                height: 40px;
            }
            .u-input-number-placeholder{
                top: 12px;
                text-align: left;
                width: auto;
                max-width: calc(100% - 63px);
            }
        }
        
    }

    &.u-input-group{
        border-spacing: 0; 
    }

    &.u-input-group>span:first-child{
        border-right: 1px solid $border-color-base;
    }
  
    &.u-input-group>span:last-child{
        border-left: 1px solid $border-color-base;
        border-top-right-radius:  $border-radius;
        border-bottom-right-radius: $border-radius;
    }

    &.disabled-con>span:first-child{
        border-right: 1px solid $disable-border-color;
    }

    &.disabled-con>span:last-child{
        border-left: 1px solid $disable-border-color;
    }
    // &.u-input-group-addon.disabled-cursor{
    //     border-right: 1px solid red ;
    // } 

    // &.disabled-cursor>span:first-child{
    //     border-right: 1px solid $border-color-base;
    // }
    // &.disabled-cursor>span:last-child{
    //     border-left: 1px solid $border-color-base;
    //     border-top-right-radius:  $border-radius;
    // }
    &.u-input-group>span{
        background: #fff;
    }
    &.u-input-group .u-input-group-addon:nth-of-type(1){
        border-right: 1px solid $border-color-base;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    &.u-input-group>span:hover{
        background: $hover-bg-color-base;
    }

    &.u-input-group.simple .u-input-group-btn {
        position: relative;
        top: 0px;
        z-index: 2;
        right: 0;
        width: 22px;
        .icon-group {
            // width: 22px;
            height: 32px;
            background: #fff;
            border-radius: 0 $border-radius $border-radius 0;
            -webkit-transition: opacity .24s linear .1s;
            transition: opacity .24s linear .1s;
            .plus {
                position: relative;
                display: block;
                width: 100%;
                text-align: center;
                line-height: 0;
                height: 50%;
                overflow: hidden;
                color: #505F79;
                -webkit-transition: all .1s linear;
                transition: all .1s linear;
                cursor: pointer;
                border-top-right-radius: $border-radius;

                &.disabled {
                    cursor: not-allowed;
                    background: #fff !important;
                    color: #C1C7D0;
                }
                &.disabled-cursor {
                    background: #f7f9fb;
                    cursor: not-allowed;
                    border-top-right-radius: $border-radius; 
                    &:hover {
                        background: #f7f9fb;
                    }
                }
                &:hover {
                    background: $hover-bg-color-base;
                }
            }
            .reduce {
                position: relative;
                top: -1px;
                display: block;
                width: 100%;
                text-align: center;
                border-top: 1px solid $border-color-base;
                border-bottom-right-radius: $border-radius;
                line-height: 0;
                height: 50%;
                box-sizing: initial;
                overflow: hidden;
                color: #505F79;
                -webkit-transition: all .1s linear;
                transition: all .1s linear;
                cursor: pointer;
                &.disabled {
                    cursor: not-allowed;
                    background: #fff !important;
                    color: #C1C7D0;
                }
                &.disabled-cursor {
                    cursor: not-allowed;
                    background: #f7f9fb;
                    border-bottom-right-radius: $border-radius;
                    border-top: 1px solid #DFE1E6;
                    &:hover {
                        background: #f7f9fb;
                    }
                } 
                &:hover {
                    background: $hover-bg-color-base;
                }
            }
            .disabled-cursor.disabled {
                background: none;
            }
            .disabled-cursor {
                .uf {
                    color: #C1C7D0;
                    &:hover {
                        color: #ccc;
                    }
                }
            }
            .uf {
                font-size: 12px;
                line-height: 16px;
            }
        }
    }
    &.u-input-group.simple .u-input-group-btn[disabled] {
        background: #f7f9fb;
    }
    &.u-input-group.simple .u-form-control {
        text-align: left;
        width: 100%;
        border-right: 0;
        border-bottom-right-radius: 0;
        border-top-right-radius: 0;
        padding-right: 12px;
    }
    &.u-input-group.simple .u-form-control[disabled] {
        border-color:$border-color-base;
    }
    &.u-input-group.simple .u-form-control[disabled]+.u-input-group-btn .icon-group {
        border-color:$border-color-base;
    }
    &.u-input-group .u-form-control {
        width: 100%;
        text-align: center;
        border: transparent;
    }
    &.u-input-group .u-form-control[disabled] {
        border-top-color: $border-color-base;
        border-bottom-color: $border-color-base;
    }
    &.u-input-group .u-form-control:focus {
        border-color: #66afe9;
    }
    .u-input-group-addon {
        position: relative;
        cursor: pointer;
        padding: 6px;
        user-select: none;
        -moz-user-select: none;
        background: transparent;
        border:none;
        &.disabled {
            cursor: not-allowed;
            color: #C1C7D0;
            background: #fff !important;
        }
        &.disabled-cursor {
            cursor: not-allowed;
            background: #f7f9fb !important;
            color: #ccc;
        }
    }

    .u-input-number-auto .u-form-control {
        width: 100%;
    }
    .u-form-control::-webkit-outer-spin-button,
    .u-form-control::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }
    input[type="number"]{
        -moz-appearance: textfield;
    }
}

.u-input-number-out .u-input-number.u-input-number-sm.u-input-group.simple .u-input-group-btn{
    top: 0px;
}

.u-input-number-out .u-input-number.u-input-number-lg.u-input-group.simple .u-input-group-btn{
    top: 0px;
}

.u-input-number-group {
    .u-input-number-out {
        width: calc( 50% - 10px );
        display: inline-block;
    }
    &-split{
        width: 20px;
        display: inline-block;
        text-align: center;
        position: relative;
        top: -10px;
    }
}

// u-table 编辑 hock
.u-table .u-table-tbody .u-table-row {
    .u-input-number {
        & .u-input-group-addon:first-of-type {
            position: relative;
            left: 2px;
        }
        & .u-input-group-addon:last-of-type {
            position: relative;
            right: 2px;
        }
    }
    .u-input-number.u-input-group.simple {
        .u-input-group-btn {
            right: 2px;
        }
    }
}

.disabled-con,
.disabled-con .disabled-cursor > span:first-child,
.disabled-con .disabled-cursor > span:last-child{
    border-color:$disable-border-color;
}
