picker.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. @use 'sass:map';
  2. @use '../mixins/mixins' as *;
  3. @use '../mixins/var' as *;
  4. @use '../common/var' as *;
  5. @use '../common/transition' as *;
  6. @include b(picker) {
  7. @include e(popper) {
  8. @include set-css-var-type('datepicker', 'border-color', $datepicker);
  9. @include picker-popper(
  10. getCssVar('bg-color', 'overlay'),
  11. 1px solid getCssVar('datepicker', 'border-color'),
  12. getCssVar('box-shadow', 'light')
  13. );
  14. }
  15. }
  16. @include b(date-editor) {
  17. @include set-component-css-var('date-editor', $date-editor);
  18. @include set-component-css-var('input', $input);
  19. position: relative;
  20. text-align: left;
  21. &.#{$namespace}-input__wrapper {
  22. @include inset-input-border(
  23. var(
  24. #{getCssVarName('input-border-color')},
  25. map.get($input, 'border-color')
  26. )
  27. );
  28. &:hover {
  29. @include inset-input-border(#{getCssVar('input', 'hover-border-color')});
  30. }
  31. }
  32. &.#{$namespace}-input,
  33. &.#{$namespace}-input__wrapper {
  34. width: getCssVar('date-editor-width');
  35. height: var(#{getCssVarName('input-height')}, getCssVar('component-size'));
  36. }
  37. @include m((monthrange)) {
  38. @include css-var-from-global(
  39. 'date-editor-width',
  40. 'date-editor-monthrange-width'
  41. );
  42. }
  43. @include m((daterange, timerange)) {
  44. @include css-var-from-global(
  45. 'date-editor-width',
  46. 'date-editor-daterange-width'
  47. );
  48. }
  49. @include m(datetimerange) {
  50. @include css-var-from-global(
  51. 'date-editor-width',
  52. 'date-editor-datetimerange-width'
  53. );
  54. }
  55. @include m(dates) {
  56. .#{$namespace}-input__wrapper {
  57. text-overflow: ellipsis;
  58. white-space: nowrap;
  59. }
  60. }
  61. .close-icon {
  62. cursor: pointer;
  63. }
  64. .clear-icon {
  65. cursor: pointer;
  66. &:hover {
  67. color: getCssVar('text-color', 'secondary');
  68. }
  69. }
  70. .#{$namespace}-range__icon {
  71. height: inherit;
  72. font-size: 14px;
  73. color: getCssVar('text-color', 'placeholder');
  74. float: left;
  75. svg {
  76. vertical-align: middle;
  77. }
  78. }
  79. .#{$namespace}-range-input {
  80. appearance: none;
  81. border: none;
  82. outline: none;
  83. display: inline-block;
  84. height: #{map.get($input-height, 'default') - 2};
  85. line-height: #{map.get($input-height, 'default') - 2};
  86. margin: 0;
  87. padding: 0;
  88. width: 39%;
  89. text-align: center;
  90. font-size: getCssVar('font-size', 'base');
  91. color: getCssVar('text-color', 'regular');
  92. background-color: transparent;
  93. &::placeholder {
  94. color: getCssVar('text-color', 'placeholder');
  95. }
  96. }
  97. .#{$namespace}-range-separator {
  98. flex: 1;
  99. display: inline-flex;
  100. justify-content: center;
  101. align-items: center;
  102. height: 100%;
  103. padding: 0 5px;
  104. margin: 0;
  105. font-size: 14px;
  106. word-break: keep-all;
  107. color: getCssVar('text-color', 'primary');
  108. }
  109. .#{$namespace}-range__close-icon {
  110. font-size: 14px;
  111. color: getCssVar('text-color', 'placeholder');
  112. height: inherit;
  113. width: unset;
  114. cursor: pointer;
  115. &:hover {
  116. color: getCssVar('text-color', 'secondary');
  117. }
  118. svg {
  119. vertical-align: middle;
  120. }
  121. &--hidden {
  122. opacity: 0;
  123. visibility: hidden;
  124. }
  125. }
  126. }
  127. @include b(range-editor) {
  128. &.#{$namespace}-input__wrapper {
  129. display: inline-flex;
  130. align-items: center;
  131. padding: 0 10px;
  132. }
  133. @include when(active) {
  134. @include inset-input-border(#{getCssVar('input', 'focus-border-color')});
  135. &:hover {
  136. @include inset-input-border(#{getCssVar('input', 'focus-border-color')});
  137. }
  138. }
  139. @each $size in (large, small) {
  140. @include m($size) {
  141. line-height: getCssVar('component-size', $size);
  142. &.#{$namespace}-input__wrapper {
  143. height: getCssVar('component-size', $size);
  144. }
  145. .#{$namespace}-range-separator {
  146. line-height: map.get($input-line-height, $size);
  147. font-size: map.get($input-font-size, $size);
  148. }
  149. .#{$namespace}-range-input {
  150. height: #{map.get($input-height, $size) - 2};
  151. line-height: #{map.get($input-height, $size) - 2};
  152. font-size: map.get($input-font-size, $size);
  153. }
  154. }
  155. }
  156. @include when(disabled) {
  157. background-color: map.get($input-disabled, 'fill');
  158. border-color: map.get($input-disabled, 'border');
  159. color: map.get($input-disabled, 'text-color');
  160. cursor: not-allowed;
  161. &:hover,
  162. &:focus {
  163. border-color: map.get($input-disabled, 'border');
  164. }
  165. input {
  166. background-color: map.get($input-disabled, 'fill');
  167. color: map.get($input-disabled, 'text-color');
  168. cursor: not-allowed;
  169. &::placeholder {
  170. color: map.get($input-disabled, 'placeholder-color');
  171. }
  172. }
  173. .#{$namespace}-range-separator {
  174. color: map.get($input-disabled, 'text-color');
  175. }
  176. }
  177. }