picker.scss 4.7 KB

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