select.scss 4.1 KB

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