254 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			SCSS
		
	
	
	
	
	
			
		
		
	
	
			254 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			SCSS
		
	
	
	
	
	
| @import './variables/definition.scss';
 | |
| @import './functions/func.scss';
 | |
| @import './functions/checkbox.scss';
 | |
| 
 | |
| $headerHeight: 26px;
 | |
| $caretWidth: 26px;
 | |
| $dropItemHeight: 30px;
 | |
| $borderRadius: 2px;
 | |
| $scrollBarSize: 4px;
 | |
| 
 | |
| $searchBarHeight: 40px;
 | |
| $searchInputHeight: 26px;
 | |
| $searchIconSize: 13px;
 | |
| $listMaxHeight: 210px;
 | |
| 
 | |
| .dropdown-wrapper {
 | |
|     display: inline-block;
 | |
|     border: none;
 | |
|     @include border-radius(unset);
 | |
|     @include user-select(none);
 | |
|     position: relative;
 | |
| 
 | |
|     >.dropdown-header {
 | |
|         border: 1px solid $borderColor;
 | |
|         @include border-radius($borderRadius);
 | |
|         background-color: $bgColor;
 | |
|         display: flex;
 | |
|         height: $headerHeight;
 | |
|         @include transition(all .3s);
 | |
| 
 | |
|         &:focus {
 | |
|             border-color: $focusColor;
 | |
|             // @include box-shadow(0 0 3px 1px rgba(0, 0, 0, .2));
 | |
|         }
 | |
| 
 | |
|         &:focus,
 | |
|         &:focus-visible {
 | |
|             outline: none;
 | |
|         }
 | |
| 
 | |
|         /*>.dropdown-select-container {
 | |
|             flex: 1 1 auto;
 | |
|             overflow-x: auto;
 | |
|             white-space: nowrap;
 | |
|             display: flex;
 | |
|             flex-direction: row;
 | |
|             @include scrollbar();
 | |
| 
 | |
|             &::-webkit-scrollbar {
 | |
|                 height: $scrollBarSize;
 | |
|             }
 | |
| 
 | |
|             &::-webkit-scrollbar-thumb {
 | |
|                 @include border-radius($borderRadius);
 | |
|             }
 | |
| 
 | |
|             >span {
 | |
|                 display: inline-block;
 | |
|                 margin: 2px;
 | |
|                 padding: 0 2px;
 | |
|                 border: 1px solid lightgray;
 | |
|                 height: 20px;
 | |
|                 line-height: 20px;
 | |
|                 background-color: white;
 | |
|                 font-size: .75rem;
 | |
|                 @include border-radius($borderRadius);
 | |
|                 cursor: pointer;
 | |
|                 position: relative;
 | |
| 
 | |
|                 >svg {
 | |
|                     display: none;
 | |
|                     width: 8px;
 | |
|                     height: 20px;
 | |
|                     fill: white;
 | |
|                     vertical-align: top;
 | |
|                 }
 | |
| 
 | |
|                 &:hover {
 | |
|                     border-color: #1890ff;
 | |
|                     border-top-right-radius: 0;
 | |
|                     border-bottom-right-radius: 0;
 | |
|                     background-color: #1890ff;
 | |
|                     color: white;
 | |
| 
 | |
|                     >svg {
 | |
|                         display: inline-block;
 | |
|                         margin-left: 3px;
 | |
|                         padding: 0 2px;
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
| 
 | |
|             >label {
 | |
|                 flex: 1 1 auto;
 | |
|                 min-width: 40px;
 | |
|                 cursor: pointer;
 | |
|                 outline: none;
 | |
|                 line-height: $headerHeight;
 | |
|                 padding: 0 4px;
 | |
|                 font-weight: 400;
 | |
|                 font-size: .8125rem;
 | |
|                 color: $foreColor;
 | |
|             }
 | |
|         }*/
 | |
| 
 | |
|         >.dropdown-text {
 | |
|             flex: 1 1 auto;
 | |
|             cursor: pointer;
 | |
|             font-size: .875rem;
 | |
|             line-height: $headerHeight;
 | |
|             padding: 0 6px;
 | |
|             overflow: hidden;
 | |
|             text-overflow: ellipsis;
 | |
|             border: none;
 | |
|             outline: none;
 | |
|         }
 | |
| 
 | |
|         >.dropdown-caret {
 | |
|             flex: 0 0 auto;
 | |
|             width: $caretWidth;
 | |
|             display: flex;
 | |
|             justify-content: center;
 | |
|             align-items: center;
 | |
|             cursor: pointer;
 | |
| 
 | |
|             &::after {
 | |
|                 display: block;
 | |
|                 content: '';
 | |
|                 border-top: 4px solid;
 | |
|                 border-left: 4px solid transparent;
 | |
|                 border-right: 4px solid transparent;
 | |
|                 height: 0;
 | |
|                 width: 0;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         &.disabled {
 | |
|             border-color: $disabledBgColor;
 | |
|             color: $disabledForeColor;
 | |
| 
 | |
|             &:focus {
 | |
|                 border-color: $disabledBgColor;
 | |
|                 // @include box-shadow(none);
 | |
|             }
 | |
| 
 | |
|             >.dropdown-text,
 | |
|             >.dropdown-caret {
 | |
|                 cursor: default;
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     >.dropdown-panel {
 | |
|         position: absolute;
 | |
|         visibility: hidden;
 | |
|         opacity: 0;
 | |
|         transform: scaleY(0);
 | |
|         transform-origin: top;
 | |
|         background-color: $bgColor;
 | |
|         top: calc($headerHeight + 2px);
 | |
|         z-index: 2;
 | |
|         @include transition3(transform 120ms ease, opacity 120ms ease, visibility 120ms ease);
 | |
|         width: calc(100% + 2px);
 | |
|         box-sizing: border-box;
 | |
|         /*border: 1px solid $borderColor;
 | |
|         border-top-width: 0;*/
 | |
|         @include box-shadow3(0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05));
 | |
|         left: -1px;
 | |
| 
 | |
|         &.slide-up {
 | |
|             top: auto;
 | |
|             /*border-top-width: 1px;
 | |
|             border-bottom-width: 0;*/
 | |
|             transform-origin: bottom;
 | |
|         }
 | |
| 
 | |
|         &.active {
 | |
|             visibility: visible;
 | |
|             opacity: 1;
 | |
|             transform: scaleY(1);
 | |
|         }
 | |
| 
 | |
|         >.dropdown-search {
 | |
|             box-sizing: border-box;
 | |
|             height: $searchBarHeight;
 | |
|             line-height: $searchBarHeight;
 | |
|             padding: 0 8px;
 | |
|             position: relative;
 | |
| 
 | |
|             >input[type="text"] {
 | |
|                 box-sizing: border-box;
 | |
|                 width: 100%;
 | |
|                 height: $searchInputHeight;
 | |
|                 outline: none;
 | |
|                 border: 1px solid $borderColor;
 | |
|                 @include border-radius($borderRadius);
 | |
|                 padding: 0 6px 0 22px;
 | |
|                 color: $foreColor;
 | |
|                 @include transition(all .3s);
 | |
| 
 | |
|                 &:hover,
 | |
|                 &:focus {
 | |
|                     border-color: $focusColor;
 | |
|                 }
 | |
| 
 | |
|                 // &:focus {
 | |
|                 //     @include box-shadow(0 0 3px 1px rgba(0, 0, 0, .2));
 | |
|                 // }
 | |
|             }
 | |
| 
 | |
|             >svg {
 | |
|                 position: absolute;
 | |
|                 left: 14px;
 | |
|                 width: $searchIconSize;
 | |
|                 height: 100%;
 | |
|                 cursor: text;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         >.dropdown-list {
 | |
|             margin: 0;
 | |
|             padding: 0;
 | |
|             padding-bottom: 6px;
 | |
|             list-style: none;
 | |
|             max-height: $listMaxHeight;
 | |
|             overflow-y: auto;
 | |
| 
 | |
|             &.filtered>li:first-child {
 | |
|                 background-color: $hoverColor;
 | |
|             }
 | |
| 
 | |
|             >li {
 | |
|                 // display: flex;
 | |
|                 // align-items: center;
 | |
|                 line-height: $dropItemHeight;
 | |
|                 height: $dropItemHeight;
 | |
|                 padding: 0 10px;
 | |
|                 cursor: pointer;
 | |
|                 white-space: nowrap;
 | |
|                 overflow: hidden;
 | |
|                 text-overflow: ellipsis;
 | |
| 
 | |
|                 &:hover,
 | |
|                 &.selected {
 | |
|                     background-color: $hoverColor;
 | |
|                 }
 | |
| 
 | |
|                 >.checkbox-wrapper {
 | |
|                     height: $dropItemHeight;
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| } |