bs-datepicker.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. @import 'utils/scss/variables';
  2. @import 'utils/scss/mixins';
  3. /* .bs-datepicker */
  4. .bs-datepicker {
  5. display: flex;
  6. align-items: stretch;
  7. flex-flow: row wrap;
  8. background: $main-bg;
  9. box-shadow: 0 0 10px 0 $main-box-shadow;
  10. position: relative;
  11. z-index: 1;
  12. &:after {
  13. clear: both;
  14. content: '';
  15. display: block;
  16. }
  17. bs-day-picker {
  18. float: left;
  19. }
  20. /* button */
  21. button:hover,
  22. button:focus,
  23. button:active,
  24. input:hover,
  25. input:focus,
  26. input:active,
  27. &-btns button:hover,
  28. &-btns button:focus,
  29. &-btns button:active,
  30. &-predefined-btns button:active,
  31. &-predefined-btns button:focus {
  32. outline: none;
  33. }
  34. /* .bs-datepicker-head */
  35. &-head {
  36. min-width: 270px;
  37. height: 50px;
  38. padding: 10px;
  39. border-radius: 3px 3px 0 0;
  40. text-align: justify;
  41. &:after {
  42. content: "";
  43. display: inline-block;
  44. vertical-align: top;
  45. width: 100%;
  46. }
  47. /* .bs-datepicker-head button */
  48. button {
  49. display: inline-block;
  50. vertical-align: top;
  51. padding: 0;
  52. height: 30px;
  53. line-height: 30px;
  54. border: 0;
  55. background: transparent;
  56. text-align: center;
  57. cursor: pointer;
  58. color: $font-color-01;
  59. transition: 0.3s;
  60. &[disabled],
  61. &[disabled]:hover,
  62. &[disabled]:active {
  63. background: $disabled-background;
  64. color: $disabled-color;
  65. cursor: not-allowed;
  66. }
  67. &.next,
  68. &.previous {
  69. border-radius: 50%;
  70. width: 30px;
  71. height: 30px;
  72. span {
  73. font-size: 28px;
  74. line-height: 1;
  75. display: inline-block;
  76. position: relative;
  77. height: 100%;
  78. width: 100%;
  79. border-radius: 50%;
  80. }
  81. }
  82. &.current {
  83. border-radius: 15px;
  84. max-width: 155px;
  85. padding: 0 13px;
  86. }
  87. }
  88. }
  89. &-head {
  90. button {
  91. &:hover {
  92. background-color: rgba(0, 0, 0, 0.1);
  93. }
  94. &:active {
  95. background-color: rgba(0, 0, 0, 0.2);
  96. }
  97. }
  98. }
  99. /* .bs-datepicker-body */
  100. &-body {
  101. padding: 10px;
  102. border-radius: 0 0 3px 3px;
  103. min-height: 232px;
  104. min-width: 278px;
  105. border: 1px solid $border-color;
  106. .days.weeks {
  107. position: relative;
  108. z-index: 1;
  109. }
  110. /* .bs-datepicker-body table */
  111. table {
  112. width: 100%;
  113. border-collapse: separate;
  114. border-spacing: 0;
  115. th {
  116. font-size: 13px;
  117. color: $font-color-02;
  118. font-weight: 400;
  119. text-align: center;
  120. }
  121. td {
  122. color: $font-color-03;
  123. text-align: center;
  124. position: relative;
  125. padding: 0;
  126. span {
  127. display: block;
  128. margin: 0 auto;
  129. font-size: 13px;
  130. border-radius: 50%;
  131. position: relative;
  132. /*z-index: 1;*/
  133. -moz-user-select: none;
  134. -webkit-user-select: none;
  135. -ms-user-select: none;
  136. }
  137. // todo: check first :not(.disabled) usage
  138. &:not(.disabled):not(.week) span:not(.disabled):not(.is-other-month) {
  139. cursor: pointer;
  140. }
  141. &.is-highlighted:not(.disabled):not(.selected) span,
  142. span.is-highlighted:not(.disabled):not(.selected) {
  143. background-color: $highlighted;
  144. transition: 0s;
  145. }
  146. &.is-active-other-month:not(.disabled):not(.selected) span,
  147. span.is-active-other-month:not(.disabled):not(.selected) {
  148. background-color: $highlighted;
  149. transition: 0s;
  150. cursor: pointer;
  151. }
  152. span.disabled,
  153. &.disabled span {
  154. color: $font-color-02;
  155. }
  156. span.selected,
  157. &.selected span {
  158. color: $font-color-01;
  159. }
  160. span.is-other-month,
  161. &.is-other-month span {
  162. color: rgba(0, 0, 0, 0.25);
  163. }
  164. &.active {
  165. position: relative;
  166. &.select-start:before {
  167. left: 35%;
  168. }
  169. &.select-end:before {
  170. left: -85%;
  171. }
  172. }
  173. span.active.select-start:after,
  174. span.active.select-end:after,
  175. &.active.select-start span:after,
  176. &.active.select-end span:after {
  177. content: "";
  178. display: block;
  179. position: absolute;
  180. z-index: -1;
  181. width: 100%;
  182. height: 100%;
  183. transition: 0.3s;
  184. top: 0;
  185. border-radius: 50%;
  186. }
  187. &:before,
  188. span:before {
  189. content: "";
  190. display: block;
  191. position: absolute;
  192. z-index: -1;
  193. top: 6px;
  194. bottom: 6px;
  195. left: -2px;
  196. right: -2px;
  197. box-sizing: content-box;
  198. background: transparent;
  199. }
  200. &.active.select-start + td.active:before {
  201. left: -20%;
  202. }
  203. &:last-child.active:before {
  204. border-radius: 0 3px 3px 0;
  205. width: 125%;
  206. left: -25%;
  207. }
  208. span[class*="select-"],
  209. &[class*="select-"] span {
  210. border-radius: 50%;
  211. color: $font-color-01;
  212. }
  213. }
  214. /* .bs-datepicker-body table.days */
  215. &.days {
  216. td,
  217. span {
  218. &.active:not(.select-start):before,
  219. &.in-range:not(.select-start):before {
  220. background: $highlighted;
  221. }
  222. }
  223. span {
  224. width: 32px;
  225. height: 32px;
  226. line-height: 32px;
  227. &.select-start {
  228. z-index: 2;
  229. }
  230. &.is-highlighted.in-range:before,
  231. &.in-range.select-end:before {
  232. background: none;
  233. right: 0;
  234. left: 0;
  235. }
  236. }
  237. td {
  238. &.select-start + td.select-end:before,
  239. &.select-start + td.is-highlighted:before,
  240. &.active + td.is-highlighted:before,
  241. &.active + td.select-end:before,
  242. &.in-range + td.is-highlighted:before,
  243. &.in-range + td.select-end:before {
  244. background: $highlighted;
  245. width: 100%;
  246. }
  247. }
  248. }
  249. /* .bs-datepicker-body table.weeks */
  250. &.weeks {
  251. tr {
  252. td {
  253. &:nth-child(2).active:before {
  254. border-radius: 3px 0 0 3px;
  255. left: 0;
  256. width: 100%;
  257. }
  258. }
  259. }
  260. }
  261. &:not(.weeks) {
  262. tr {
  263. td{
  264. &:first-child:before {
  265. border-radius: 3px 0 0 3px;
  266. }
  267. }
  268. }
  269. }
  270. &.years {
  271. td {
  272. span {
  273. width: 46px;
  274. height: 46px;
  275. line-height: 45px;
  276. margin: 0 auto;
  277. }
  278. }
  279. tr:not(:last-child) {
  280. td {
  281. span {
  282. margin-bottom: 8px;
  283. }
  284. }
  285. }
  286. }
  287. &.months {
  288. td {
  289. height: 52px;
  290. span {
  291. padding: 6px;
  292. border-radius: 15px;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. /* .current-timedate */
  299. .current-timedate {
  300. color: $font-color-03;
  301. font-size: 15px;
  302. text-align: center;
  303. height: 30px;
  304. line-height: 30px;
  305. border-radius: 20px;
  306. border: 1px solid $border-color;
  307. margin-bottom: 10px;
  308. cursor: pointer;
  309. text-transform: uppercase;
  310. -moz-user-select: none;
  311. -webkit-user-select: none;
  312. -ms-user-select: none;
  313. span:not(:empty):before {
  314. content: "";
  315. width: 15px;
  316. height: 16px;
  317. display: inline-block;
  318. margin-right: 4px;
  319. vertical-align: text-bottom;
  320. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAABMklEQVQoU9VTwW3CQBCcOUgBtEBKSAukAnBKME+wFCAlYIhk8sQlxFABtJAScAsuAPBEewYcxCP8ouxrPDsza61uiVN1o6RNHD4htSCmq49RfO71BvMJqBBkITRf1kmUW49nQRC9h1I5AZlBClaL8aP1fKgOOxCx8aSLs+Q19eZuNO8QmPqJRtDFguy7OAcDbJPs+/BKVPDIPrvD2ZJgWAmVe7O0rI0Vqs1seyWUXpuJoppYCa5L+U++NpNPkr5OE2oMdARsb3gykJT5ydZcL8Z9Ww60nxg2LhjON9li9OwXZzo+xLbp3nC2s9CL2RrueGyVrgwNm8HpsCzZ9EEW6kqXlo1GQe03FzP/7W8Hl0dBtu7Bf7zt6mIwvX1RvzDCm7+q3mAW0Dl/GPdUCeXrZLT9BrDrGkm4qlPvAAAAAElFTkSuQmCC);
  321. }
  322. }
  323. /* .bs-datepicker-multiple */
  324. &-multiple {
  325. border-radius: 4px 0 0 4px;
  326. & + & {
  327. margin-left: 10px;
  328. }
  329. .bs-datepicker {
  330. box-shadow: none;
  331. position: relative;
  332. &:not(:last-child) {
  333. padding-right: 10px;
  334. }
  335. & + .bs-datepicker:after {
  336. content: "";
  337. display: block;
  338. width: 14px;
  339. height: 10px;
  340. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAKCAYAAABrGwT5AAAA1ElEQVQoU42RsQrCUAxF77VuDu7O4oMWW//BURBBpZvgKk4uIrjoqKOTf+DopIO4uYggtFTfw3+pkQqCW1/G5J7kJiFy4m5MxUlxAzgIPHX+lzMPzupRYlYgxiR7vqsOP8YKzsTx0yxFMCUZ+q7aZzlr+OvgoWcAFyAHgat2jLWu48252DdqAihDJGSSJNUUxYmQjs3+hPQBlAh2rG2LCOPnaw3IiGDX99TRCs7ASJsNhUOA7d/LcuHvRG22FIZvsNXw1MX6VZExCilOQKEfeLXr/10+aC9Ho7arh7oAAAAASUVORK5CYII=);
  341. position: absolute;
  342. top: 25px;
  343. left: -8px;
  344. }
  345. .left {
  346. float: left;
  347. }
  348. .right {
  349. float: right;
  350. }
  351. }
  352. }
  353. /* .bs-datepicker-btns */
  354. &-container {
  355. padding: 15px;
  356. }
  357. .bs-media-container {
  358. display: flex;
  359. @media(max-width: 768px) {
  360. flex-direction: column;
  361. }
  362. }
  363. /*.bs-datepicker-custom-range */
  364. &-custom-range {
  365. padding: 15px;
  366. background: $custom-range-bg;
  367. }
  368. /* .bs-datepicker-predefined-btns */
  369. &-predefined-btns {
  370. button {
  371. width: 100%;
  372. display: block;
  373. height: 30px;
  374. background-color: $btn-bg2;
  375. border-radius: 4px;
  376. color: $font-color-01;
  377. border: 0;
  378. margin-bottom: 10px;
  379. padding: 0 18px;
  380. text-align: left;
  381. transition: 0.3s;
  382. &:active,
  383. &:hover {
  384. background-color: $btn-bg2-hover;
  385. }
  386. }
  387. }
  388. /* .bs-datepicker-buttons */
  389. &-buttons {
  390. display: flex;
  391. flex-flow: row wrap;
  392. justify-content: flex-end;
  393. padding-top: 10px;
  394. border-top: 1px solid $border-color;
  395. .btn-default {
  396. margin-left: 10px;
  397. }
  398. }
  399. }
  400. /* .bs-timepicker */
  401. .bs-timepicker {
  402. &-container {
  403. padding: 10px 0;
  404. }
  405. &-label {
  406. color: $font-color-03;
  407. margin-bottom: 10px;
  408. }
  409. &-controls {
  410. display: inline-block;
  411. vertical-align: top;
  412. margin-right: 10px;
  413. button {
  414. width: 20px;
  415. height: 20px;
  416. border-radius: 50%;
  417. border: 0;
  418. background-color: $btn-bg;
  419. color: $font-color-03;
  420. font-size: 16px;
  421. font-weight: 700;
  422. vertical-align: middle;
  423. line-height: 0;
  424. padding: 0;
  425. transition: 0.3s;
  426. &:hover {
  427. background-color: $btn-bg-hover;
  428. }
  429. }
  430. input {
  431. width: 35px;
  432. height: 25px;
  433. border-radius: 13px;
  434. text-align: center;
  435. border: 1px solid $border-color;
  436. }
  437. }
  438. .switch-time-format {
  439. text-transform: uppercase;
  440. min-width: 54px;
  441. height: 25px;
  442. border-radius: 20px;
  443. border: 1px solid $border-color;
  444. background: $main-bg;
  445. color: $font-color-03;
  446. font-size: 13px;
  447. img {
  448. vertical-align: initial;
  449. margin-left: 4px;
  450. }
  451. }
  452. }
  453. bs-datepicker-container,
  454. bs-daterangepicker-container {
  455. z-index: 1080;
  456. }
  457. /* screen size < 1024px */
  458. @media (max-width: 768px) {
  459. .bs-datepicker {
  460. &-multiple {
  461. display: flex;
  462. & + & {
  463. margin-top: 10px;
  464. margin-left: 0;
  465. }
  466. }
  467. }
  468. }
  469. /* theming */
  470. @each $name, $color in $theme-list {
  471. @include theming($name, $color);
  472. }