@import "mixins/mixins";
@import "common/var";

@include b(inline-form-item) {
    width: 100%;
    border-radius: 4px;
    .el-input {
        display: flex;
        flex-direction: row-reverse;
        border-radius: 4px;
        .el-input__prefix {
            display: flex;
            align-items: center;
            position: unset;
            height: auto;
            line-height: normal;
            margin-right: -1px;
            padding-left: 12px;
            border-radius: 4px;
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
            border: $--input-border;
            border-right: none;
            border-collapse: collapse;
            font-size: 14px;
            color: $--input-font-color;
            box-sizing: border-box;
        }
        .el-input__inner {
            flex: 1;
            padding-left: 0;
            border-left: none;
            border-collapse: collapse;
            border-radius: 4px;
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
            &:focus {
                outline: none;
                border-color: $--input-focus-border;
                box-shadow: none;
            }
        }
        .el-input__inner:hover + .el-input__prefix {
            border-color: $--input-hover-border;
        }
        .el-input__inner:focus + .el-input__prefix {
            outline: none;
            border-color: $--input-focus-border;
        }
    }
    .el-select {
        width: 100%;
        border-radius: 4px;
        &:hover {
            .el-input__prefix {
                border-color: $--input-hover-border;
            }
        }
    }
    .el-input.is-focus {
        .el-input__prefix {
            border-color: $--input-focus-border;
        }
        .el-input__inner:hover + .el-input__prefix {
            border-color: $--input-focus-border;
        }
    }
    .el-select-is-disabled:hover {
        .el-input__prefix {
            border-color: $--input-disabled-border;
        }
    }
    .is-disabled {
        background: $--input-disabled-fill;
        .el-input__prefix {
            border-color: $--input-disabled-border;
            color: $--input-disabled-color;
            cursor: not-allowed;
        }
        .el-input__inner {
            border-color: $--input-disabled-border;
        }
        .el-input__inner:hover + .el-input__prefix {
            border-color:  $--input-disabled-border;
        }
    }
}

.el-form-item.is-error {
    @include b(inline-form-item) {
        .el-input__prefix {
            border-color: $--color-danger;
        }
        .el-input__inner:hover, .el-input__inner:focus {
            border-color: $--color-danger;
        }
        .el-input__inner:hover + .el-input__prefix {
            border-color: $--color-danger;
        }
        .el-input__inner:focus + .el-input__prefix {
            outline: none;
            border-color: $--color-danger;
            box-shadow: none;
        }

        .el-input.is-focus {
            .el-input__inner {
                border-color: $--color-danger;
                box-shadow: none;
            }
        }
        .el-input,.el-select {
            box-shadow: none !important;
        }
        .is-disabled {
            .el-input__inner {
                border-color: $--color-danger;
            }
        }   
    }
}