slider.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. /**
  2. * IBM Confidential
  3. * OCO Source Materials
  4. * IBM Business Platform: Dashboard
  5. * (C) Copyright IBM Corp. 2018, 2020
  6. * The source code for this program is not published or otherwise divested of its trade secrets,
  7. * irrespective of what has been deposited with the U.S. Copyright Office
  8. **/
  9. .slider-container {
  10. position: relative;
  11. padding: 38px 25px 45px 25px;
  12. >div.padding {
  13. display: block;
  14. position: relative;
  15. padding: 0px 0 10px 0;
  16. }
  17. .tooltipHandle {
  18. margin-top: 0px;
  19. padding: 0;
  20. z-index: 5;
  21. .tooltip-inner {
  22. display: inline-flex;
  23. flex-direction: row;
  24. align-items: center;
  25. padding: 0;
  26. margin-bottom: 10px;
  27. border-radius: 5px;
  28. width: 100%;
  29. >span {
  30. font-weight: $fw-light;
  31. padding-left: 5px;
  32. padding-right: 0;
  33. &[dir="rtl"] {
  34. padding-right: 5px;
  35. padding-left: 0;
  36. }
  37. }
  38. input {
  39. flex: 1 100%;
  40. outline: none;
  41. border: 0;
  42. padding: 3px;
  43. text-align: center;
  44. min-width: 10px; // FF34 sets a 'large' minimum width on inputs. Making it small so it doesn't bleed outside containers.
  45. }
  46. }
  47. .tooltip-arrow {
  48. left: 0;
  49. right: 0;
  50. margin-left: auto;
  51. margin-right: auto;
  52. width: 0;
  53. height: 0;
  54. margin-top: -10px;
  55. border-bottom-width: 0;
  56. border-top-width: 5px;
  57. border-top-style: solid;
  58. border-left: 7px solid transparent;
  59. border-right: 7px solid transparent;
  60. }
  61. }
  62. .tooltipHandle.bottom {
  63. margin-top: 31px;
  64. .tooltip-inner {
  65. margin-top: 8px;
  66. }
  67. .tooltip-arrow {
  68. top: 0;
  69. margin-top: 3px;
  70. border-top-width: 0;
  71. border-bottom-width: 5px;
  72. border-bottom-style: solid;
  73. border-left: 7px solid transparent;
  74. border-right: 7px solid transparent;
  75. }
  76. }
  77. .slider {
  78. display: block;
  79. position: absolute;
  80. margin: 0;
  81. padding: 0;
  82. }
  83. .slider.slider-horizontal {
  84. width: 100%;
  85. margin: 0;
  86. padding: 0;
  87. }
  88. .slider.slider-horizontal .slider-track {
  89. height: 2px;
  90. width: 100%;
  91. left: -1px;
  92. &[dir="rtl"] {
  93. left: auto;
  94. right: -1px;
  95. }
  96. }
  97. .slider.slider-horizontal .slider-selection {
  98. height: 100%;
  99. top: 0;
  100. bottom: 0;
  101. }
  102. .slider.slider-horizontal .slider-handle {
  103. margin-left: -10px;
  104. margin-top: -13px;
  105. &[dir="rtl"] {
  106. margin-left: 0px;
  107. margin-right: -10px;
  108. }
  109. }
  110. .slider.slider-disabled .slider-handle {
  111. background: none;
  112. border: 0;
  113. }
  114. .slider.slider-disabled .slider-track {}
  115. .slider .tooltip-inner {
  116. white-space: nowrap;
  117. }
  118. .slider-track {
  119. position: absolute;
  120. cursor: pointer;
  121. }
  122. .slider-selection {
  123. cursor: pointer;
  124. position: absolute;
  125. -webkit-box-sizing: border-box;
  126. -moz-box-sizing: border-box;
  127. box-sizing: border-box;
  128. }
  129. .slider-handle {
  130. position: absolute;
  131. width: 20px;
  132. height: 20px;
  133. filter: none;
  134. -webkit-box-shadow: inset 0 1px 0 $colorWhitealpha20, 0 1px 2px $colorBlackalpha15;
  135. box-shadow: inset 0 1px 0 $colorWhitealpha20, 0 1px 2px $colorBlackalpha15;
  136. outline: 1px dotted;
  137. @include theming(outline, interactive-01);
  138. @include user-select(none);
  139. }
  140. .slider.slider-disabled .slider-handle {
  141. filter: none;
  142. -webkit-box-shadow: none;
  143. box-shadow: none;
  144. }
  145. .slider-handle.round {
  146. border-radius: 50%;
  147. }
  148. .slider-handle.triangle {
  149. background: transparent none;
  150. }
  151. .hint {
  152. display: block;
  153. position: relative;
  154. padding: 0;
  155. margin-top: 10px;
  156. margin-bottom: 10px;
  157. .minvalue,
  158. .maxvalue {
  159. width: 50%;
  160. float: left;
  161. display: inline-block;
  162. font-style: normal;
  163. font-weight: $fw-light;
  164. font-size: $body-size-s;
  165. &[dir="rtl"] {
  166. float: right;
  167. }
  168. }
  169. .minvalue {
  170. text-align: left;
  171. &[dir="rtl"] {
  172. text-align: right;
  173. }
  174. }
  175. .maxvalue {
  176. text-align: right;
  177. &[dir="rtl"] {
  178. text-align: left;
  179. }
  180. }
  181. .minvalue span,
  182. .maxvalue span {
  183. @include theming(color, ui-04);
  184. }
  185. .minvalue span {
  186. text-align: left;
  187. &[dir="rtl"] {
  188. text-align: right;
  189. }
  190. }
  191. .maxvalue span {
  192. text-align: right;
  193. &[dir="rtl"] {
  194. text-align: left;
  195. }
  196. }
  197. }
  198. }
  199. .slider-container.disabled {
  200. opacity: 1;
  201. cursor: default;
  202. .slider.slider-disabled .slider-handle {
  203. @include theming(background-color, disabled-03);
  204. outline: none;
  205. }
  206. }
  207. .slider-container.minimized {
  208. padding: 0;
  209. >div.padding {
  210. border: 0;
  211. padding: 0;
  212. }
  213. .slider.slider-horizontal .slider-track {
  214. height: 4px;
  215. }
  216. }
  217. // Style: dual
  218. .slider-container.dual {
  219. padding: 38px 25px 45px 25px;
  220. >div.padding {
  221. border: 0;
  222. }
  223. .slider {
  224. margin-top: 12px;
  225. }
  226. .tooltipHandle {
  227. margin-top: -25px;
  228. padding: 0;
  229. min-width: 25px;
  230. .tooltip-inner {
  231. border-radius: 3px; //border: 1px solid $swatchBlueDark;
  232. //border-bottom: 2px solid $swatchBlueDark;
  233. background: $blue40;
  234. margin-bottom: 0;
  235. font-size: $caption-size;
  236. input {
  237. background-color: transparent;
  238. }
  239. &.focus {
  240. @include theming(background, ui-01);
  241. border: 1px solid;
  242. @include theming(border-color, focus);
  243. @include theming(color, ui-05);
  244. }
  245. &.focus span {
  246. @include theming(color, focus);
  247. }
  248. }
  249. .tooltip-arrow {
  250. display: none;
  251. width: 0;
  252. min-width: 0;
  253. height: 0;
  254. min-height: 0;
  255. border: 0;
  256. }
  257. }
  258. .slider.slider-horizontal .slider-track {
  259. height: 4px;
  260. }
  261. .slider-track {
  262. @include theming(background-color, ui-03);
  263. }
  264. .slider-selection {
  265. @include theming(background-color, interactive-01);
  266. }
  267. .slider.slider-disabled .slider-selection {
  268. @include theming(background-color, disabled-03);
  269. }
  270. .slider-handle {
  271. top: 17px;
  272. width: 26px;
  273. height: 32px;
  274. filter: none;
  275. -webkit-box-shadow: none;
  276. box-shadow: none;
  277. outline: none;
  278. z-index: 10;
  279. background-color: transparent;
  280. overflow: visible;
  281. &:active .angle {
  282. @include theming(border-right-color, interactive-01);
  283. }
  284. &:active .box {
  285. @include theming(background-color, focus);
  286. }
  287. }
  288. .slider-handle .angle {
  289. position: absolute;
  290. left: -3px;
  291. width: 13px;
  292. border: 0;
  293. border-top: 10px solid transparent;
  294. border-right: 13px solid;
  295. @include theming(border-right-color, ui-03);
  296. &[dir="rtl"] {
  297. left: auto;
  298. right: -3px;
  299. border-right: none;
  300. border-left: 13px solid;
  301. @include theming(border-left-color, ui-03);
  302. }
  303. }
  304. .slider-handle .box {
  305. position: absolute;
  306. left: -3px;
  307. top: 10px;
  308. width: 13px;
  309. height: 22px;
  310. border-bottom-left-radius: 2px;
  311. border-bottom-right-radius: 2px;
  312. @include theming(background-color, ui-03);
  313. &[dir="rtl"] {
  314. left: auto;
  315. right: -3px;
  316. }
  317. }
  318. .slider-handle:last-of-type {
  319. &:active .angle {
  320. @include theming(border-left-color, interactive-01);
  321. }
  322. &:active .box {
  323. @include theming(background-color, interactive-01);
  324. }
  325. .angle {
  326. left: auto;
  327. right: 3px;
  328. border-right: 0;
  329. border-left: 13px solid;
  330. @include theming(border-left-color, ui-03);
  331. &[dir="rtl"] {
  332. right: auto;
  333. left: 3px;
  334. border-left: 0;
  335. border-right: 13px solid;
  336. @include theming(border-right-color, ui-03);
  337. }
  338. }
  339. .box {
  340. left: auto;
  341. right: 3px;
  342. &[dir="rtl"] {
  343. right: auto;
  344. left: 3px;
  345. }
  346. }
  347. }
  348. .slider.slider-disabled .slider-handle {
  349. filter: none;
  350. -webkit-box-shadow: none;
  351. box-shadow: none;
  352. }
  353. .slider-handle.round {
  354. border-radius: 0;
  355. }
  356. .linePanel {
  357. display: block;
  358. height: 12px;
  359. min-height: 12px;
  360. z-index: 100;
  361. .lineSegment {
  362. display: block;
  363. position: absolute;
  364. height: 5px;
  365. padding: 0;
  366. margin: 0 0 0 0;
  367. .linkLine {
  368. display: inline-block;
  369. position: absolute;
  370. top: 0;
  371. width: 0;
  372. height: 7px;
  373. min-height: 7px;
  374. border-width: 0;
  375. border-bottom-width: 1px;
  376. border-style: solid;
  377. @include theming(border-color, link-01);
  378. padding: 0;
  379. margin: 0;
  380. vertical-align: top;
  381. }
  382. .linkLine.left {
  383. border-left-width: 1px;
  384. margin-left: -1px;
  385. }
  386. .linkLine.right {
  387. border-right-width: 1px;
  388. margin-left: -1px;
  389. }
  390. .linkLine.bottom {
  391. top: 6px;
  392. height: 10px;
  393. min-height: 10px;
  394. }
  395. }
  396. .lineSegment.bottom {
  397. height: 5px;
  398. }
  399. }
  400. }
  401. .dataColumnHeader .slider-handle {
  402. visibility: hidden;
  403. }
  404. .slider-container.dual.invert {
  405. .slider {
  406. .slider-track {
  407. @include theming(background-color, interactive-01);
  408. }
  409. .slider-selection {
  410. @include theming(background-color, ui-background);
  411. }
  412. }
  413. }
  414. // Style: modelling
  415. .slider-container.modelling {
  416. .slider-track {
  417. background-color: transparent;
  418. cursor: default;
  419. }
  420. .slider-selection {
  421. @include theming(background-color, interactive-01);
  422. cursor: default;
  423. }
  424. }
  425. .slider-container.modelling.invert .slider {
  426. .slider-track {
  427. @include theming(background-color, ui-background);
  428. }
  429. .slider-selection {
  430. @include theming(background-color, ui-01);
  431. }
  432. }
  433. .slider-container.modelling.indeterminate {
  434. .slider {
  435. .slider-selection {
  436. border-top: 4px dashed;
  437. @include theming(border-color, interactive-01);
  438. background-color: transparent;
  439. }
  440. }
  441. }
  442. // Style: datastrip
  443. .slider-container.datastrip {
  444. .slider-track {
  445. @include theming(background-color, ui-03);
  446. cursor: default;
  447. }
  448. .slider-selection {
  449. @include theming(background-color, interactive-01);
  450. cursor: default;
  451. }
  452. }
  453. .slider-container.datastrip.invert .slider {
  454. .slider-track {
  455. @include theming(background-color, interactive-01);
  456. }
  457. .slider-selection {
  458. @include theming(background-color, ui-background);
  459. }
  460. }
  461. .slider-container.datastrip.indeterminate {
  462. .slider {
  463. .slider-selection {
  464. border-top: 4px dashed;
  465. @include theming(background-color, ui-background);
  466. @include theming(border-color, interactive-01);
  467. }
  468. }
  469. }
  470. // Style: simple
  471. .slider-container.simple {
  472. padding-top: 49px;
  473. >div.padding {
  474. border-left: 2px solid;
  475. @include theming(border-left-color, interactive-02);
  476. @include theming(border-right-color, interactive-02);
  477. }
  478. .tooltipHandle {
  479. top: 11px;
  480. margin-top: -47px;
  481. .tooltip-inner {
  482. @include theming(background-color, ui-background);
  483. }
  484. .tooltip-inner {
  485. >span {
  486. @include theming(color, interactive-01);
  487. }
  488. input {
  489. @include theming(border-color, interactive-02);
  490. @include theming(color, text-01);
  491. background-color: transparent;
  492. padding: 3px;
  493. }
  494. }
  495. .tooltip-arrow {
  496. @include theming(border-top-color, ui-03);
  497. }
  498. }
  499. .tooltipHandle.bottom {
  500. .tooltip-arrow {
  501. @include theming(border-bottom-color, ui-03);
  502. }
  503. }
  504. .slider {
  505. .slider-handle {
  506. @include theming(background-color, interactive-02);
  507. }
  508. .slider-track {
  509. left: 0px;
  510. height: 10px;
  511. &[dir="rtl"] {
  512. left: auto;
  513. right: 0px;
  514. }
  515. .dummy {
  516. left: 0px;
  517. width: 100%;
  518. height: 2px;
  519. @include theming(background-color, ui-background);
  520. margin-top: 4px;
  521. &[dir="rtl"] {
  522. left: auto;
  523. right: 0px;
  524. }
  525. }
  526. }
  527. .slider-horizontal {
  528. margin-top: 4px;
  529. .slider-handle {
  530. margin-top: -9px;
  531. }
  532. }
  533. .slider-handle {
  534. top: 4px;
  535. }
  536. }
  537. }