select.scss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /**Variable**/
  2. @import './helpers/mixin.scss';
  3. @import './base/loading.scss';
  4. .vxe-select {
  5. position: relative;
  6. display: inline-block;
  7. width: 180px;
  8. color: $vxe-font-color;
  9. text-align: left;
  10. &:not(.is--disabled) {
  11. & > .vxe-input {
  12. .vxe-input--inner {
  13. cursor: pointer;
  14. }
  15. }
  16. }
  17. & > .vxe-input {
  18. width: 100%;
  19. .vxe-input--suffix-icon {
  20. @include animatTransition(transform, .2s);
  21. }
  22. }
  23. &.is--active {
  24. & > .vxe-input {
  25. .vxe-input--inner {
  26. border: 1px solid $vxe-primary-color;
  27. }
  28. }
  29. }
  30. }
  31. .vxe-select-slots {
  32. display: none;
  33. }
  34. .vxe-select--panel {
  35. display: none;
  36. position: absolute;
  37. left: 0;
  38. padding: 4px 0;
  39. color: $vxe-font-color;
  40. text-align: left;
  41. background-color: $vxe-select-panel-background-color;
  42. &:not(.is--transfer) {
  43. min-width: 100%;
  44. }
  45. &.is--transfer {
  46. position: fixed;
  47. }
  48. &.animat--leave {
  49. display: block;
  50. opacity: 0;
  51. transform: scaleY(0.5);
  52. transition: transform .3s cubic-bezier(.23,1,.32,1), opacity .3s cubic-bezier(.23,1,.32,1);
  53. transform-origin: center top;
  54. backface-visibility: hidden;
  55. transform-style: preserve-3d;
  56. &[placement="top"] {
  57. transform-origin: center bottom;
  58. }
  59. }
  60. &.animat--enter {
  61. opacity: 1;
  62. transform: scaleY(1);
  63. }
  64. }
  65. .vxe-select-option--wrapper {
  66. overflow-x: hidden;
  67. overflow-y: auto;
  68. padding: 4px 0;
  69. max-height: 200px;
  70. border-radius: $vxe-border-radius;
  71. border: 1px solid $vxe-table-popup-border-color;
  72. box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
  73. }
  74. .vxe-optgroup {
  75. .vxe-optgroup--title {
  76. padding: 0 6px;
  77. color: $vxe-optgroup-title-color;
  78. font-size: 12px;
  79. }
  80. }
  81. .vxe-optgroup--wrapper {
  82. .vxe-select-option {
  83. padding: 0 20px;
  84. }
  85. }
  86. .vxe-select-option {
  87. padding: 0 10px;
  88. max-width: 400px;
  89. white-space: nowrap;
  90. overflow: hidden;
  91. text-overflow: ellipsis;
  92. white-space: nowrap;
  93. &.is--selected {
  94. font-weight: 700;
  95. color: $vxe-primary-color;
  96. }
  97. &:not(.is--disabled) {
  98. cursor: pointer;
  99. &.is--hover {
  100. background-color: $vxe-select-option-hover-background-color;
  101. }
  102. }
  103. &.is--disabled {
  104. color: $vxe-disabled-color;
  105. cursor: no-drop;
  106. }
  107. }
  108. .vxe-select--empty-placeholder {
  109. padding: 0 10px;
  110. text-align: center;
  111. }
  112. .vxe-select,
  113. .vxe-select--panel {
  114. font-size: $vxe-font-size;
  115. &.size--medium {
  116. font-size: $vxe-font-size-medium;
  117. }
  118. &.size--small {
  119. font-size: $vxe-font-size-small;
  120. }
  121. &.size--mini {
  122. font-size: $vxe-font-size-mini;
  123. }
  124. }
  125. .vxe-select--panel {
  126. .vxe-optgroup--title,
  127. .vxe-select-option {
  128. height: $vxe-select-option-height-default;
  129. }
  130. .vxe-optgroup--title,
  131. .vxe-select-option,
  132. .vxe-select--empty-placeholder {
  133. line-height: $vxe-select-option-height-default;
  134. }
  135. &.size--medium {
  136. .vxe-optgroup--title,
  137. .vxe-select-option {
  138. height: $vxe-select-option-height-medium;
  139. }
  140. .vxe-optgroup--title,
  141. .vxe-select-option,
  142. .vxe-select--empty-placeholder {
  143. line-height: $vxe-select-option-height-medium;
  144. }
  145. }
  146. &.size--small {
  147. .vxe-optgroup--title,
  148. .vxe-select-option {
  149. height: $vxe-select-option-height-small;
  150. }
  151. .vxe-optgroup--title,
  152. .vxe-select-option,
  153. .vxe-select--empty-placeholder {
  154. line-height: $vxe-select-option-height-small;
  155. }
  156. }
  157. &.size--mini {
  158. .vxe-optgroup--title,
  159. .vxe-select-option {
  160. height: $vxe-select-option-height-mini;
  161. }
  162. .vxe-optgroup--title,
  163. .vxe-select-option,
  164. .vxe-select--empty-placeholder {
  165. line-height: $vxe-select-option-height-mini;
  166. }
  167. }
  168. }