UNPKG

kui-vue

Version:

A high quality UI Toolkit built on Vue.js 2.0

590 lines (493 loc) 10 kB
@import '../../styles/var.less'; .k-select { display: inline-flex; min-width: 0; min-width: 80px; box-sizing: border-box; vertical-align: middle; color: var(--kui-color-font); font-size: 14px; position: relative; outline: none; box-sizing: border-box; // flex-shrink: 0; align-items: center; background-color: var(--kui-color-back); border-radius: var(--kui-border-radius); border: 1px solid var(--kui-color-border); padding-left: 8px; transition: border .3s ease-in-out; line-height: 1.571; // max-width: 100%; &:hover { border-color: var(--kui-color-main); box-shadow: 0 0 0 2px var(--kui-color-main-90); } &-selection { box-sizing: border-box; outline: 0; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; position: relative; min-height: 30px; position: relative; display: inline-flex; align-items: center; width: 100%; max-width: 100%; overflow: hidden; height: 100%; box-sizing: border-box; } .k-select-icon { font-size: 16px; color: var(--kui-color-icon); margin-right: 5px; } &-search-wrap { position: absolute; z-index: 1; background: none; overflow: hidden; max-width: 100%; .k-select-search { border: none; width: 7px; min-width: 7px; height: 22px; padding: 0; background: none; outline: none; font-size: 14px; color: var(--kui-color-font); } } &-labels { transition: font-size .25s ease-in-out; overflow: hidden; display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0; .k-select-tag { padding: 2px 22px 2px 5px; border: 1px solid var(--kui-color-border); background-color: var(--kui-color-border); border-radius: var(--kui-border-radius); display: inline-flex; align-items: center; font-size: 12px; position: relative; line-height: 18px; transition: all .25s ease-in-out; .k-icon { position: absolute; right: 3px; font-size: 16px; text-align: center; display: block; top: 50%; transform: translateY(-50%); &:hover { color: var(--kui-color-danger); } } } .k-select-search-wrap { display: inline-block; position: relative; transform: none; left: 0; top: 0; margin: 0; vertical-align: middle; } } &-search-mirror { opacity: 0; white-space: pre; pointer-events: none; position: absolute; left: 0; top: 0; z-index: 1; font-size: 12px; } &-placeholder { font-size: 14px; z-index: 0; line-height: 1.571; overflow: hidden; text-overflow: ellipsis; color: var(--kui-color-disable-color); white-space: nowrap; max-width: 100%; box-sizing: border-box; transition: font-size .25s ease-in-out; line-height: 1; } &-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: none; background: transparent; box-sizing: border-box; width: 100%; line-height: 1.571; cursor: pointer; font-size: 14px; transition: font-size .25s ease-in-out; } &-arrow { font-size: 14px; box-sizing: border-box; transform: rotate(0deg); transform-origin: center; transition: transform .3s ease-in-out; transition: all .25s ease-in-out; color: var(--kui-color-icon); margin: 0 8px; #chevron-up { transform: rotate(180deg); } } &-clearable { display: none; font-size: 14px; color: var(--kui-color-icon); margin: 0 8px; &:hover { color: var(--kui-color-font); } } .k-select-search-mirror, .k-select-search { font-size: 14px; color: var(--kui-color-font); } &.k-select-circle { border-radius: 30px; } } .k-select-show-tags { padding-left: 4px; .k-select-icon { margin-left: 4px; } } .k-select-show-search { .k-select-placeholder { position: absolute; } } .k-select-multiple { .k-select-placeholder { position: absolute; } } .k-select-light { &.k-select { border-color: transparent; background: var(--kui-color-gray-80); transition: none; box-shadow: none; &:focus, &:hover { box-shadow: none; border-color: transparent; } .k-select-tag { background-color: var(--kui-color-gray-80); border-color: transparent; } } &:focus .k-select { box-shadow: none; border-color: transparent; } } .k-select-dropdown { user-select: none; border-radius: var(--kui-border-radius); width: inherit; max-height: 200px; overflow: auto; background-color: var(--kui-color-control-10); box-sizing: border-box; box-shadow: 0 1px 6px rgba(0, 0, 0, .2); position: absolute; z-index: 1003; padding: 5px; box-sizing: border-box; border: 1px solid var(--kui-color-gray-80); ul { padding: 0; margin: 0; list-style: none; left: 0; } .k-select-loading { padding: 10px; font-size: 14px; color: var(--kui-color-font); display: flex; align-items: center; .k-icon { font-size: 14px; } span { margin-left: 8px; } } .k-select-item { margin: 0; line-height: 1; padding: 8px 8px; clear: both; color: var(--kui-color-font); font-size: 14px; white-space: nowrap; list-style: none; width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; cursor: pointer; position: relative; border-radius: @radius; &:hover { background: var(--kui-color-hover); } &:active { background: var(--kui-color-actived); } .k-icon { position: absolute; top: 0; right: 9px; font-size: 15px; top: 50%; transform: translateY(-50%); display: none; color: var(--kui-color-icon); } &:hover .k-icon, .k-icon { display: block; } } .k-select-item-selected { background: var(--kui-color-selected); font-weight: 500; &:hover { background: var(--kui-color-selected); } .k-icon { color: var(--kui-color-main); display: block; } } .k-select-item-disabled { background: var(--kui-color-disable-back); color: var(--kui-color-disable-color); cursor: not-allowed; } } .k-select-dropdown-multiple { .k-select-item { padding-right: 31px; } } .k-select-dropdown-sm { .k-select-item { font-size: 12px; } } .k-select-sm { padding-left: 4px; .k-select-icon { font-size: 14px; margin-right: 3px; } .k-select-selection { min-height: 22px; } &.k-select-show-tags { padding-left: 2px; .k-select-icon { margin-left: 2px; } } .k-select-arrow { font-size: 12px; margin: 0 4px; } .k-select-clearable { margin: 0 4px; font-size: 12px; } .k-select-label { line-height: 22px; height: 22px; padding-right: 23px; font-size: 12px; } .k-select-placeholder { font-size: 12px; } .k-select-search-wrap { .k-select-search { height: 12px; font-size: 12px; } } .k-select-labels { gap: 2px; margin: 2px 0; .k-select-tag { padding: 2px 20px 2px 5px; line-height: 1; .k-icon { font-size: 14px; } } .k-select-search-wrap { padding: 2px 0; .k-select-search { font-size: 12px; height: 12px; line-height: 12px; left: 0; float: left; } } } .k-select-search-mirror, .k-select-search { font-size: 12px; color: var(--kui-color-font); } } .k-select-lg { .k-select-placeholder { font-size: 16px; } .k-select-selection { font-size: 16px; min-height: 38px; } .k-select-icon { font-size: 18px; } .k-select-arrow { font-size: 18px; } .k-select-clearable { font-size: 18px; } .k-select-label { line-height: 38px; height: 38px; font-size: 16px; } .k-select-search-wrap { .k-select-search { height: 28px; } } .k-select-labels { .k-select-tag { padding: 7px 20px 7px 5px; font-size: 14px; line-height: 1; .k-icon { font-size: 16px; } } .k-select-search-wrap { .k-select-search { height: 28px; line-height: 28px; left: 0; float: left; font-size: 16px; } } } } .k-select-open { border-color: var(--kui-color-main); box-shadow: 0 0 0 2px var(--kui-color-main-90); .k-select-label { opacity: .5; } &.k-select-light .k-select-selection { box-shadow: none; border-color: transparent; } } .k-select-disabled { color: var(--kui-color-disable-color); background: var(--kui-color-disable-back); .k-select-label { cursor: not-allowed; } * { cursor: not-allowed; } .k-select-arrow { color: var(--kui-color-disable-border); } &:hover, &:focus { border-color: var(--kui-color-disable-border); box-shadow: none; } } .k-select-has-clear { &:hover { .k-select-clearable { display: block; } .k-select-arrow { display: none; } } } .k-select-borderless { border-color: transparent; box-shadow: none; &:hover, &:focus { border-color: transparent; box-shadow: none; } .k-select-selection { box-shadow: none; border-color: transparent; background-color: transparent; } } @keyframes drop-down { 0% { opacity: 0; transform: scaleY(0) } to { opacity: 1; transform: scaleY(1) } } .k-select-enter-active { transform-origin: 0 0; animation: drop-down .3s; } .k-select-leave-active { transform-origin: 0 0; animation: drop-down .3s reverse }