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.

_grid.scss 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. @import "table";
  2. $v-grid-row-background-color: valo-table-background-color() !default;
  3. $v-grid-row-stripe-background-color: scale-color($v-grid-row-background-color, $lightness: if(color-luminance($v-grid-row-background-color) < 10, 4%, -4%)) !default;
  4. $v-grid-border-color-source: $v-grid-row-background-color !default;
  5. $v-grid-border: flatten-list(valo-border($color: $v-grid-border-color-source, $strength: 0.8)) !default;
  6. $v-grid-cell-focused-border: max(2px, first-number($v-border)) solid $v-selection-color !default;
  7. $v-grid-row-height: $v-table-row-height !default;
  8. $v-grid-row-selected-background-color: $v-selection-color !default;
  9. $v-grid-header-font-size: $v-table-header-font-size !default;
  10. $v-grid-header-background-color: $v-background-color !default;
  11. $v-grid-cell-padding-horizontal: $v-table-cell-padding-horizontal !default;
  12. $v-grid-animations-enabled: $v-animations-enabled !default;
  13. $v-grid-details-marker-width: first-number($v-grid-border) * 2 !default;
  14. $v-grid-details-marker-color: $v-selection-color !default;
  15. $v-grid-details-border-top: valo-border($color: $v-grid-border-color-source, $strength: 0.3) !default;
  16. $v-grid-details-border-top-stripe: valo-border($color: $v-grid-row-stripe-background-color, $strength: 0.3) !default;
  17. $v-grid-details-border-bottom: $v-grid-cell-horizontal-border !default;
  18. $v-grid-details-border-bottom-stripe: $v-grid-cell-horizontal-border !default;
  19. @import "../../base/grid/grid";
  20. /**
  21. *
  22. *
  23. * @param {string} $primary-stylename (v-grid) -
  24. *
  25. * @group grid
  26. */
  27. @mixin valo-grid ($primary-stylename: v-grid) {
  28. @include base-grid($primary-stylename);
  29. .#{$primary-stylename} {
  30. @include user-select(text);
  31. background-color: $v-background-color;
  32. }
  33. .#{$primary-stylename}-header .#{$primary-stylename}-cell {
  34. @include valo-gradient($v-grid-header-background-color);
  35. text-shadow: valo-text-shadow($font-color: valo-font-color($v-grid-header-background-color), $background-color: $v-grid-header-background-color);
  36. }
  37. .#{$primary-stylename}-header .#{$primary-stylename}-cell.dragged {
  38. @include opacity(0.5, false);
  39. @include transition (opacity .3s ease-in-out);
  40. }
  41. .#{$primary-stylename}-header .#{$primary-stylename}-cell.dragged-column-header {
  42. margin-top: round($v-grid-row-height/-2);
  43. }
  44. .#{$primary-stylename}-footer .#{$primary-stylename}-cell {
  45. @include valo-gradient($v-grid-footer-background-color);
  46. text-shadow: valo-text-shadow($font-color: valo-font-color($v-grid-footer-background-color), $background-color: $v-grid-footer-background-color);
  47. }
  48. .#{$primary-stylename}-header-deco {
  49. @include valo-gradient($v-grid-header-background-color);
  50. }
  51. .#{$primary-stylename}-footer-deco,
  52. .#{$primary-stylename}-horizontal-scrollbar-deco {
  53. @include valo-gradient($v-grid-footer-background-color);
  54. }
  55. // Selected
  56. .#{$primary-stylename}-row-selected {
  57. $grid-sel-bg: $v-grid-row-selected-background-color;
  58. > .#{$primary-stylename}-cell {
  59. @include valo-gradient($grid-sel-bg);
  60. color: valo-font-color($grid-sel-bg);
  61. text-shadow: valo-text-shadow($font-color: valo-font-color($grid-sel-bg), $background-color: $grid-sel-bg);
  62. border-color: adjust-color($grid-sel-bg, $lightness: -8%, $saturation: -8%);
  63. }
  64. > .#{$primary-stylename}-cell-focused:before {
  65. border-color: adjust-color($grid-sel-bg, $lightness: 20%);
  66. }
  67. }
  68. .#{$primary-stylename}-editor {
  69. @include valo-focus-style;
  70. border-color: $v-focus-color;
  71. }
  72. .#{$primary-stylename}-editor-footer {
  73. font-size: $v-font-size--small;
  74. padding: 0 round($v-layout-spacing-horizontal / 2);
  75. background: $v-app-background-color;
  76. @if $v-grid-animations-enabled {
  77. @include animation(valo-grid-editor-footer-animate-in 200ms 120ms backwards);
  78. }
  79. }
  80. @if $v-grid-animations-enabled {
  81. .#{$primary-stylename}-editor-footer:first-child {
  82. @include animation(valo-grid-editor-footer-animate-in-alt 200ms 120ms backwards);
  83. }
  84. }
  85. .#{$primary-stylename}-editor-cells {
  86. z-index: 1;
  87. }
  88. .#{$primary-stylename}-editor-cells > div {
  89. // Vertical centering for widgets
  90. &:before {
  91. content: "";
  92. display: inline-block;
  93. height: 100%;
  94. vertical-align: middle;
  95. }
  96. .error::before {
  97. border-top: round($v-unit-size / 4) solid $v-error-indicator-color;
  98. border-right: round($v-unit-size / 4) solid transparent;
  99. }
  100. .error,
  101. .error > input {
  102. // taken from @mixin valo-textfield-error-style()
  103. background-color: scale-color($v-error-indicator-color, $lightness: 98%);
  104. }
  105. .v-textfield,
  106. .v-textfield-focus,
  107. .v-datefield,
  108. .v-datefield .v-textfield-focus,
  109. .v-filterselect-input,
  110. .v-filterselect-input:focus {
  111. border: none;
  112. border-radius: 0;
  113. background: transparent;
  114. @if $v-textfield-bevel {
  115. @include box-shadow(valo-bevel-and-shadow($bevel: $v-textfield-bevel));
  116. } @else {
  117. @include box-shadow(none);
  118. }
  119. }
  120. .v-datefield-button {
  121. .v-ie8 & {
  122. margin-left: 0px;
  123. }
  124. }
  125. .v-filterselect-button {
  126. .v-ie8 & {
  127. margin-left: 0px;
  128. }
  129. }
  130. .v-textfield-focus,
  131. .v-datefield .v-textfield-focus,
  132. .v-filterselect-input:focus {
  133. position: relative;
  134. }
  135. .v-select {
  136. padding-left: round($v-grid-cell-padding-horizontal / 2);
  137. padding-right: round($v-grid-cell-padding-horizontal / 2);
  138. }
  139. .v-checkbox {
  140. margin: 0 round($v-grid-cell-padding-horizontal / 2);
  141. label {
  142. white-space: nowrap;
  143. }
  144. }
  145. }
  146. .#{$primary-stylename}-editor-message > div:before {
  147. display: inline-block;
  148. @include valo-error-indicator-style($is-pseudo-element: true);
  149. }
  150. .#{$primary-stylename}-editor-save,
  151. .#{$primary-stylename}-editor-cancel {
  152. @include valo-link-style;
  153. font-weight: $v-font-weight + 100;
  154. text-decoration: none;
  155. border: none;
  156. background: transparent;
  157. padding: round($v-layout-spacing-vertical / 2) round($v-layout-spacing-horizontal / 2);
  158. margin: 0;
  159. outline: none;
  160. }
  161. .#{$primary-stylename}-spacer {
  162. margin-top: first-number($v-grid-border) * -1;
  163. }
  164. // Sidebar
  165. .#{$primary-stylename}-sidebar.v-contextmenu {
  166. &.open {
  167. .#{$primary-stylename}-sidebar-content {
  168. margin: 0 0 2px;
  169. padding: 4px 4px 2px;
  170. }
  171. }
  172. &.closed {
  173. @include valo-gradient($v-grid-header-background-color);
  174. }
  175. }
  176. // Customize scrollbars
  177. .#{$primary-stylename}-scroller {
  178. &::-webkit-scrollbar {
  179. border: none;
  180. }
  181. &::-webkit-scrollbar-thumb {
  182. border-radius: 10px;
  183. border: 4px solid transparent;
  184. background: if(is-dark-color($v-grid-header-background-color), rgba(255,255,255,.3), rgba(0,0,0,.3));
  185. -webkit-background-clip: content-box;
  186. background-clip: content-box;
  187. }
  188. }
  189. .#{$primary-stylename}-scroller-vertical::-webkit-scrollbar-thumb {
  190. min-height: 30px;
  191. }
  192. .#{$primary-stylename}-scroller-horizontal::-webkit-scrollbar-thumb {
  193. min-width: 30px;
  194. }
  195. }
  196. @include keyframes(valo-grid-editor-footer-animate-in) {
  197. 0% {
  198. margin-top: -$v-grid-row-height;
  199. }
  200. }
  201. @include keyframes(valo-grid-editor-footer-animate-in-alt) {
  202. 0% {
  203. margin-bottom: -$v-grid-row-height - first-number($v-grid-cell-horizontal-border);
  204. }
  205. 100% {
  206. margin-bottom: first-number($v-grid-cell-horizontal-border) * -1;
  207. }
  208. }