select.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. @use '../helpers/baseMixin.scss';
  2. @use '../helpers/placement.scss';
  3. .vxe-select {
  4. position: relative;
  5. display: inline-block;
  6. width: 180px;
  7. color: var(--vxe-ui-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 > i {
  31. display: inline-block;
  32. @include baseMixin.createAnimationTransition(transform, .2s);
  33. }
  34. }
  35. &.is--active {
  36. &:not(.is--filter) {
  37. & > .vxe-input {
  38. border-color: var(--vxe-ui-font-primary-color);
  39. }
  40. }
  41. }
  42. }
  43. .vxe-select--readonly {
  44. color: var(--vxe-ui-font-color);
  45. display: inline-flex;
  46. }
  47. .vxe-select-slots {
  48. display: none;
  49. }
  50. .vxe-select--panel {
  51. @include placement.createPlacementPanel();
  52. }
  53. .vxe-select--panel-search {
  54. display: block;
  55. padding: var(--vxe-ui-layout-padding-default);
  56. .vxe-select-search--input {
  57. width: 100%;
  58. }
  59. }
  60. .vxe-select--panel-wrapper {
  61. position: relative;
  62. border-radius: var(--vxe-ui-base-border-radius);
  63. border: 1px solid var(--vxe-ui-base-popup-border-color);
  64. box-shadow: var(--vxe-ui-base-popup-box-shadow);
  65. background-color: var(--vxe-ui-layout-background-color);
  66. }
  67. .vxe-select--header-button {
  68. display: flex;
  69. flex-direction: row;
  70. }
  71. .vxe-select--header-total {
  72. display: flex;
  73. flex-direction: row;
  74. align-items: center;
  75. justify-content: center;
  76. flex-shrink: 0;
  77. padding-left: 0.8em;
  78. }
  79. .vxe-select--header-btns {
  80. display: flex;
  81. flex-direction: row;
  82. flex-grow: 1;
  83. justify-content: right;
  84. }
  85. .vxe-select--panel-header {
  86. border-bottom: 1px solid var(--vxe-ui-base-popup-border-color);
  87. }
  88. .vxe-select--panel-footer {
  89. border-top: 1px solid var(--vxe-ui-base-popup-border-color);
  90. }
  91. .vxe-select--panel-header,
  92. .vxe-select--panel-footer {
  93. padding: 4px 0;
  94. }
  95. .vxe-select-option--wrapper {
  96. position: relative;
  97. overflow-x: hidden;
  98. overflow-y: auto;
  99. }
  100. .vxe-select--y-space {
  101. width: 0;
  102. float: left;
  103. }
  104. .vxe-select-option--wrapper,
  105. .vxe-select--body {
  106. padding: 0;
  107. margin: 0;
  108. border: 0;
  109. outline: 0;
  110. }
  111. .vxe-select-option--wrapper {
  112. max-height: 18em;
  113. }
  114. .vxe-select-option {
  115. position: relative;
  116. padding: 0 0.6em;
  117. white-space: nowrap;
  118. overflow: hidden;
  119. text-overflow: ellipsis;
  120. white-space: nowrap;
  121. user-select: none;
  122. cursor: pointer;
  123. &.is--add {
  124. padding-right: 2em;
  125. &:hover {
  126. .vxe-select-option--add-icon {
  127. color: var(--vxe-ui-font-primary-color);
  128. }
  129. }
  130. .vxe-select-option--add-icon {
  131. display: block;
  132. }
  133. }
  134. &.is--selected {
  135. color: var(--vxe-ui-font-primary-color);
  136. }
  137. &:not(.is--disabled) {
  138. &.is--hover {
  139. background-color: var(--vxe-ui-base-hover-background-color);
  140. }
  141. }
  142. &.is--disabled {
  143. color: var(--vxe-ui-font-disabled-color);
  144. cursor: no-drop;
  145. }
  146. }
  147. .vxe-select-optgroup {
  148. color: var(--vxe-ui-select-title-color);
  149. font-size: 12px;
  150. cursor: default;
  151. }
  152. .vxe-select-option--add-icon {
  153. display: none;
  154. position: absolute;
  155. top: 0;
  156. right: 0.6em;
  157. }
  158. .vxe-select--search-icon {
  159. margin-right: 0.5em;
  160. }
  161. .vxe-select--search-loading,
  162. .vxe-select--empty-placeholder {
  163. padding: 0 0.6em;
  164. text-align: center;
  165. color: var(--vxe-ui-select-empty-color);
  166. }
  167. .vxe-select,
  168. .vxe-select--panel {
  169. font-size: var(--vxe-ui-font-size-default);
  170. &.size--medium {
  171. font-size: var(--vxe-ui-font-size-medium);
  172. }
  173. &.size--small {
  174. font-size: var(--vxe-ui-font-size-small);
  175. }
  176. &.size--mini {
  177. font-size: var(--vxe-ui-font-size-mini);
  178. }
  179. }
  180. .vxe-select--panel {
  181. .vxe-select-option {
  182. height: var(--vxe-ui-select-option-height-default);
  183. }
  184. .vxe-select-option,
  185. .vxe-select--search-loading,
  186. .vxe-select--empty-placeholder {
  187. line-height: var(--vxe-ui-select-option-height-default);
  188. }
  189. &.size--medium {
  190. .vxe-select-option {
  191. height: var(--vxe-ui-select-option-height-medium);
  192. }
  193. .vxe-select-option,
  194. .vxe-select--search-loading,
  195. .vxe-select--empty-placeholder {
  196. line-height: var(--vxe-ui-select-option-height-medium);
  197. }
  198. }
  199. &.size--small {
  200. .vxe-select-option {
  201. height: var(--vxe-ui-select-option-height-small);
  202. }
  203. .vxe-select-option,
  204. .vxe-select--search-loading,
  205. .vxe-select--empty-placeholder {
  206. line-height: var(--vxe-ui-select-option-height-small);
  207. }
  208. }
  209. &.size--mini {
  210. .vxe-select-option {
  211. height: var(--vxe-ui-select-option-height-mini);
  212. }
  213. .vxe-select-option,
  214. .vxe-select--search-loading,
  215. .vxe-select--empty-placeholder {
  216. line-height: var(--vxe-ui-select-option-height-mini);
  217. }
  218. }
  219. }