You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_treegrid.scss 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @import "grid";
  2. /** Expander width and item indentation constants*/
  3. $v-treegrid-expander-width: 1.5em !default;
  4. $v-treegrid-indent: 1em !default;
  5. // Classname for depth styling
  6. $v-treegrid-class-depth: depth !default;
  7. /** Expander button visual - collapsed */
  8. @mixin valo-treegrid-collapsed-icon-style {
  9. content: "\f0da";
  10. font-family: ThemeIcons;
  11. }
  12. /** Expander button visual - expanded */
  13. @mixin valo-treegrid-expanded-icon-style {
  14. content: "\f0d7";
  15. font-family: ThemeIcons;
  16. }
  17. @mixin valo-treegrid ($primary-stylename: v-treegrid) {
  18. @include valo-grid($primary-stylename);
  19. .#{$primary-stylename}-expander {
  20. display: inline-block;
  21. vertical-align: top;
  22. &::before {
  23. display: inline-block;
  24. width: $v-treegrid-expander-width;
  25. text-align: center;
  26. content: "";
  27. // Expander for expanded item
  28. &.expanded {
  29. @include valo-treegrid-expanded-icon-style;
  30. }
  31. // Expander for collapsed item
  32. &.collapsed {
  33. @include valo-treegrid-collapsed-icon-style;
  34. }
  35. &.collapse-disabled {
  36. @include opacity($v-disabled-opacity);
  37. cursor: default;
  38. }
  39. }
  40. }
  41. // Hierarchy depth styling
  42. .#{$primary-stylename}-node {
  43. @for $i from 0 through 15 {
  44. &.#{$v-treegrid-class-depth}-#{$i} {
  45. padding-left: $v-treegrid-indent * $i;
  46. }
  47. }
  48. }
  49. // Expander and cell content in same line
  50. .#{$primary-stylename}-cell-content {
  51. display: inline-block;
  52. vertical-align: middle;
  53. }
  54. .#{$primary-stylename}-row-focused {
  55. &::before {
  56. content: "";
  57. position: absolute;
  58. top: 0;
  59. right: 0;
  60. bottom: 0;
  61. left: 0;
  62. border: $v-grid-cell-focused-border;
  63. display: none;
  64. pointer-events: none;
  65. }
  66. }
  67. // Needed for hiding the included style
  68. .#{$primary-stylename}-cell-focused {
  69. position: static;
  70. &::before {
  71. display: none;
  72. }
  73. }
  74. .#{$primary-stylename}:focus .#{$primary-stylename}-row-focused::before {
  75. display: block;
  76. }
  77. .#{$primary-stylename}.v-disabled:focus .#{$primary-stylename}-row-focused::before {
  78. // Disabled TreeGrid should not show row focus outline
  79. display: none;
  80. }
  81. .#{$primary-stylename}:focus .#{$primary-stylename}-cell-focused::before {
  82. display: none;
  83. }
  84. }