select.scss 3.7 KB

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