zent
Version:
一套前端设计语言和基于React的实现
181 lines (180 loc) • 5.68 kB
CSS
.zent-select {
cursor: pointer;
display: inline-block;
font-size: 0;
line-height: 1.5;
margin-right: 10px;
outline: none;
position: relative;
text-align: left;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 160px;
vertical-align: middle
}
.zent-select.disabled {
color: #cacaca;
cursor: not-allowed;
}
.zent-select.disabled .zent-select-input, .zent-select.disabled .zent-select-text, .zent-select.disabled .zent-select-tags {
border-color: #e5e5e5;
background-color: #f8f8f8
}
.zent-select.disabled .zent-select-input::after, .zent-select.disabled .zent-select-text::after, .zent-select.disabled .zent-select-tags::after {
opacity: 0.25;
}
.zent-select .zent-select-text, .zent-select .zent-select-popup, .zent-select .zent-select-input, .zent-select .zent-select-tags {
font-size: 12px;
}
.zent-select-input, .zent-select-text, .zent-select-tags {
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #bbb;
border-radius: 2px;
display: inline-block;
min-height: 30px;
max-height: 76px;
outline: none;
padding: 5px 10px;
-webkit-transition: border-color 0.25s;
transition: border-color 0.25s;
width: 100%;
background-color: #fff;
position: relative;
}
.zent-select-simple {
color: #38f
}
.zent-select-simple::after {
content: '';
border-left: 4px solid transparent;
border-top: 6px solid #38f;
border-right: 4px solid transparent;
display: inline-block;
margin-left: 5px;
height: 1px;
-webkit-transition: -webkit-transform 0.25s;
transition: -webkit-transform 0.25s;
transition: transform 0.25s;
transition: transform 0.25s, -webkit-transform 0.25s;
}
.zent-select-text {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding: 5px 20px 5px 10px
}
.zent-select-text::after {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAMAAAC38k/IAAAAM1BMVEUAAAAzMzMzMzMzMzMzMzMzMzM0NDQ0NDQ1NTU1NTU9PT1VVVU0NDQzMzMzMzM1NTUzMzOoQ7gOAAAAEHRSTlMA99vkxpd9STUhCgPOzGhlqqcGJgAAAEBJREFUCNdFy8kRwCAMwEDZ3JDD/VebCXhgf3qIR83pi9gmXCduyokCyVwCuvrfAarMuzLlPzLLiGZx4FoIDeADc4gEoYNfTDsAAAAASUVORK5CYII=) no-repeat;
background-size: 6px 5px;
content: '';
height: 5px;
margin-top: -3px;
position: absolute;
right: 10px;
top: 50%;
-webkit-transition: -webkit-transform 0.25s;
transition: -webkit-transform 0.25s;
transition: transform 0.25s;
transition: transform 0.25s, -webkit-transform 0.25s;
width: 6px;
}
.zent-select-tags {
padding: 2px 5px;
overflow-y: auto;
margin-bottom: -5px;
line-height: 24px
}
.zent-select-tags::-webkit-scrollbar {
display: none;
}
.zent-select-tags .zent-select-inner {
border: 0;
display: inline-block;
outline: none;
}
.zent-select-tags .zent-select-tag {
background-color: #f8f8f8;
border: 1px solid #bbb;
border-radius: 2px;
display: inline-block;
margin: 2px 0;
margin-right: 2px;
padding: 0 4px;
line-height: 18px;
}
.zent-select-tags .zent-select-delete {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAACampqbm5uZmZn/DnGVAAAAA3RSTlMAnUqokJgHAAAAPklEQVQI12PQYACivQwMdQz7HRj/MchfYP/CwP5F/gID4996BwaG+r8MDAzyXyAEmAuWACsBKwZrAxsANgoAoL4XU6vB5h4AAAAASUVORK5CYII=) no-repeat;
background-size: 8px;
display: inline-block;
height: 8px;
margin-left: 2px;
width: 8px;
}
.zent-select-popup {
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
left: 0;
outline: none;
overflow-y: auto;
position: absolute;
width: 100%;
z-index: 2000;
margin-top: 2px;
background-color: #fff;
max-height: 224px;
}
.zent-select-popup .zent-select-option, .zent-select-popup .zent-select-filter, .zent-select-popup .zent-select-empty {
background-color: #fff;
display: block;
outline: none;
padding: 5px 10px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.zent-select-popup .zent-select-search {
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box
}
.zent-select-popup .zent-select-search::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAM1BMVEUAAABmZmZmZmZnZ2dnZ2dmZmZnZ2dmZmZsbGxnZ2dmZmZoaGhnZ2dmZmZnZ2dmZmZmZmYOy3DdAAAAEHRSTlMAVttEnOWJNwzzpVHsz8ZQ9cP58AAAAItJREFUKM+FkdsSgCAIRFXEa7f//9okSsqRaZ8WjrOoGJYtLmdXrPmquuOWq+9+OF4KQ39C6lX6mFL0l33SKB+BPSDNYW/pEPWZUMV3K5QjAymt9KQoIPas3FwSkFqZNbBoUZs23GvXBeWBq/YlQT5xkP0nsqg1dCKrXTYPzQkZxGTXCJoZ0YDZEeEEs9MNoPE7LN4AAAAASUVORK5CYII=) no-repeat;
background-position: center;
background-size: 12px;
content: '';
height: 100%;
left: 10px;
position: absolute;
width: 12px;
}
.zent-select-popup .zent-select-filter {
border-color: #e5e5e5;
border-style: solid;
border-width: 0 0 1px;
padding-left: 30px;
width: 100%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
height: 30px;
}
.zent-select-popup .zent-select-option.current, .zent-select-popup .zent-select-option:hover {
background-color: #38f;
border-color: #38f;
color: #fff;
}
.zent-select-popup .zent-select-option.active {
color: #38f;
}
.zent-select-popup .zent-select-option.active:hover, .zent-select-popup .zent-select-option.active.current {
color: #fff;
}
.zent-select-popup .zent-select-empty {
color: #999;
}
.has-error :not(.no-error) > .zent-select-input, .has-error :not(.no-error) > .zent-select-text, .has-error :not(.no-error) > .zent-select-tags {
border: 1px solid #f44;
color: #f44;
}