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.

table.scss 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. @mixin base-table($primaryStyleName : v-table) {
  2. /* Table theme building instructions
  3. *
  4. * Vaadin scroll table is very complex widget with dozens of features. These
  5. * features set some limitations for theme builder. To keep things working, it
  6. * is safest to try to just override values used in default theme and comfort to
  7. * these instructions.
  8. *
  9. * Borders in table header and in table body need to be same width
  10. * - specify vertical borders on .#{$primaryStyleName}-header-wrap and .#{$primaryStyleName}-body
  11. *
  12. * Table cells in body:
  13. * - padding/border for cells is to be defined for td elements (class name: .#{$primaryStyleName}-cell-content)
  14. * - in default theme there are no borders, but they should work. Just set border-right or border-bottom
  15. * - no padding or border is allowed for div inside cells (class name: .#{$primaryStyleName}-cell-wrapper) element
  16. * - background is allowed for both elements
  17. *
  18. * Table headers:
  19. * - table cells in header contain .#{$primaryStyleName}-resizer and
  20. * .#{$primaryStyleName}-caption-container div elements, which are both floated to right
  21. * - to align header caption to body content resizer width + .#{$primaryStyleName}-caption-container
  22. * padding right should be equal to content cells padding-right and border-right.
  23. * - Possible cell border in header must be themed into column resizer.
  24. *
  25. */
  26. .#{$primaryStyleName} {
  27. overflow: hidden;
  28. text-align: left; /* Force default alignment */
  29. }
  30. .#{$primaryStyleName}-header-wrap {
  31. overflow: hidden;
  32. border: 1px solid #aaa;
  33. border-bottom: none;
  34. background: #efefef;
  35. }
  36. .#{$primaryStyleName}-header table,
  37. .#{$primaryStyleName}-table {
  38. border-spacing: 0;
  39. border-collapse: separate;
  40. margin: 0;
  41. padding: 0;
  42. border: 0;
  43. }
  44. .#{$primaryStyleName}-table {
  45. font-size: $font-size;
  46. }
  47. .#{$primaryStyleName}-header td {
  48. padding: 0;
  49. }
  50. .#{$primaryStyleName}-header-cell,
  51. .#{$primaryStyleName}-header-cell-asc,
  52. .#{$primaryStyleName}-header-cell-desc {
  53. cursor: pointer;
  54. }
  55. .#{$primaryStyleName}.v-disabled .#{$primaryStyleName}-header-cell,
  56. .#{$primaryStyleName}.v-disabled .#{$primaryStyleName}-header-cell-asc,
  57. .#{$primaryStyleName}.v-disabled .#{$primaryStyleName}-header-cell-desc {
  58. cursor: default;
  59. }
  60. .#{$primaryStyleName}-footer-wrap {
  61. overflow: hidden;
  62. border: 1px solid #aaa;
  63. border-top: none;
  64. background: #efefef;
  65. }
  66. .#{$primaryStyleName}-footer table {
  67. border-spacing: 0;
  68. border-collapse: collapse;
  69. margin: 0;
  70. padding: 0;
  71. border: 0;
  72. }
  73. .#{$primaryStyleName}-footer td {
  74. padding: 0;
  75. border-right: 1px solid #aaa;
  76. }
  77. .#{$primaryStyleName}-footer-cell {
  78. cursor: pointer;
  79. }
  80. .#{$primaryStyleName}-footer-container {
  81. float:right;
  82. padding-right:6px;
  83. overflow:hidden;
  84. white-space:nowrap;
  85. }
  86. .#{$primaryStyleName}-resizer {
  87. display: block;
  88. height: 1.2em;
  89. float: right;
  90. background: #aaa;
  91. cursor: e-resize; /* Opera does not support col-resize, so use e-resize instead */
  92. cursor: col-resize;
  93. width: 1px;
  94. overflow: hidden;
  95. }
  96. .#{$primaryStyleName}.v-disabled .#{$primaryStyleName}-resizer {
  97. cursor: default;
  98. }
  99. .#{$primaryStyleName}-caption-container {
  100. overflow: hidden;
  101. white-space: nowrap;
  102. margin-left: 6px;
  103. }
  104. .#{$primaryStyleName}-caption-container-align-right {
  105. float: right;
  106. }
  107. .#{$primaryStyleName}-sort-indicator {
  108. width: 0px;
  109. height: 1.2em;
  110. float: right;
  111. }
  112. .#{$primaryStyleName}-header-cell-asc .#{$primaryStyleName}-sort-indicator,
  113. .#{$primaryStyleName}-header-cell-desc .#{$primaryStyleName}-sort-indicator {
  114. width: 16px;
  115. height: 1.2em;
  116. float: right;
  117. }
  118. .#{$primaryStyleName}-header-cell-asc .#{$primaryStyleName}-sort-indicator {
  119. background: transparent url(../common/img/sprites.png) no-repeat right 6px;
  120. }
  121. .#{$primaryStyleName}-header-cell-desc .#{$primaryStyleName}-sort-indicator {
  122. background: transparent url(../common/img/sprites.png) no-repeat right -10px;
  123. }
  124. .#{$primaryStyleName}-caption-container-align-center {
  125. text-align: center;
  126. }
  127. .#{$primaryStyleName}-caption-container-align-right {
  128. text-align: right;
  129. }
  130. .#{$primaryStyleName}-caption-container .v-icon,
  131. .#{$primaryStyleName}-header-drag .v-icon {
  132. vertical-align: middle;
  133. }
  134. .#{$primaryStyleName}-body {
  135. border: 1px solid #aaa;
  136. overflow-anchor: none; /* In Chrome 56+ */
  137. }
  138. .#{$primaryStyleName}-row-spacer {
  139. height: 10px;
  140. overflow: hidden; /* IE hack to allow < one line height divs */
  141. }
  142. .#{$primaryStyleName}-row,
  143. .#{$primaryStyleName}-row-odd {
  144. background: #fff;
  145. border: 0;
  146. margin: 0;
  147. padding: 0;
  148. cursor: pointer;
  149. }
  150. .#{$primaryStyleName}-generated-row {
  151. background: #efefef;
  152. }
  153. .#{$primaryStyleName}-body-noselection .#{$primaryStyleName}-row,
  154. .#{$primaryStyleName}-body-noselection .#{$primaryStyleName}-row-odd {
  155. cursor: default;
  156. }
  157. .#{$primaryStyleName} .v-selected {
  158. background: #999;
  159. color: #fff;
  160. }
  161. .#{$primaryStyleName}-cell-content {
  162. white-space: nowrap;
  163. overflow: hidden;
  164. padding: 0 6px;
  165. border-right: 1px solid #aaa;
  166. }
  167. .#{$primaryStyleName}-cell-wrapper {
  168. /* Do not specify any margins, paddings or borders here */
  169. white-space: nowrap;
  170. overflow: hidden;
  171. }
  172. .#{$primaryStyleName}-cell-wrapper-align-center {
  173. text-align: center;
  174. }
  175. .#{$primaryStyleName}-cell-wrapper-align-right {
  176. text-align: right;
  177. }
  178. .#{$primaryStyleName}-column-selector {
  179. float: right;
  180. background: transparent url(../common/img/sprites.png) no-repeat 4px -37px;
  181. margin: -1.2em 0 0 0;
  182. height: 1.2em;
  183. width: 14px;
  184. position: relative; /* hide this from IE, it works without it */
  185. cursor: pointer;
  186. }
  187. .#{$primaryStyleName}.v-disabled .#{$primaryStyleName}-column-selector {
  188. cursor: default;
  189. }
  190. .#{$primaryStyleName}-focus-slot-left {
  191. border-left: 2px solid #999;
  192. float: none;
  193. margin-bottom: -1.2em;
  194. width: auto;
  195. background: transparent;
  196. border-right: 1px solid #aaa;
  197. }
  198. .#{$primaryStyleName}-focus-slot-right {
  199. border-right: 2px solid #999;
  200. margin-left: -2px;
  201. }
  202. .#{$primaryStyleName}-header-drag {
  203. position: absolute;
  204. background: #efefef;
  205. border: 1px solid #eee;
  206. opacity: 0.9;
  207. filter: alpha(opacity=90);
  208. margin-top: 20px;
  209. z-index: 30000;
  210. }
  211. .#{$primaryStyleName}-header-drag .v-icon {
  212. vertical-align: middle;
  213. }
  214. .#{$primaryStyleName}-scrollposition {
  215. width: 160px;
  216. background: #eee;
  217. border: 1px solid #aaa;
  218. }
  219. .#{$primaryStyleName}-scrollposition span {
  220. display: block;
  221. text-align: center;
  222. }
  223. .#{$primaryStyleName}-body:focus,
  224. .#{$primaryStyleName}-body-wrapper:focus {
  225. outline: none;
  226. }
  227. .#{$primaryStyleName}-body.focused {
  228. border-color: #388ddd;
  229. }
  230. .#{$primaryStyleName}-focus .#{$primaryStyleName}-cell-content {
  231. border-top: 1px dotted #0066bd;
  232. border-bottom: 1px dotted #0066bd;
  233. }
  234. .#{$primaryStyleName}-focus .#{$primaryStyleName}-cell-wrapper {
  235. margin-top: -1px;
  236. margin-bottom: -1px;
  237. }
  238. /* row in column selector */
  239. .v-on {
  240. }
  241. .v-off {
  242. color: #ddd;
  243. }
  244. /* CheckBox and selection fix #9064 */
  245. .#{$primaryStyleName} .v-checkbox {
  246. display: inline-block;
  247. }
  248. /*************************************
  249. * Drag'n'drop styles
  250. *************************************/
  251. .#{$primaryStyleName}-drag .#{$primaryStyleName}-body {
  252. border-color: #1d9dff;
  253. }
  254. .#{$primaryStyleName}-row-drag-middle .#{$primaryStyleName}-cell-content {
  255. background-color: #bcdcff;
  256. }
  257. .#{$primaryStyleName}-row-drag-top .#{$primaryStyleName}-cell-content {
  258. border-top: 2px solid #1d9dff;
  259. }
  260. .#{$primaryStyleName}-row-drag-top .#{$primaryStyleName}-cell-wrapper {
  261. margin-top: -2px; /* compensate the space consumed by border hint */
  262. }
  263. .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content {
  264. border-bottom: 2px solid #1d9dff;
  265. }
  266. .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-wrapper {
  267. margin-bottom: -2px; /* compensate the space consumed by border hint */
  268. }
  269. .#{$primaryStyleName}-row-drag-top .#{$primaryStyleName}-cell-content:first-child:before,
  270. .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content:first-child:after {
  271. display: block;
  272. position: absolute;
  273. width: 6px;
  274. height: 6px;
  275. margin-top: -4px;
  276. margin-left: -6px;
  277. background: transparent url(../common/img/drag-slot-dot.png);
  278. }
  279. .v-ff & .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content:first-child:after,
  280. .v-ie & .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content:first-child:after {
  281. margin-top: -2px;
  282. }
  283. }