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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. }
  137. .#{$primaryStyleName}-row-spacer {
  138. height: 10px;
  139. overflow: hidden; /* IE hack to allow < one line height divs */
  140. }
  141. .#{$primaryStyleName}-row,
  142. .#{$primaryStyleName}-row-odd {
  143. background: #fff;
  144. border: 0;
  145. margin: 0;
  146. padding: 0;
  147. cursor: pointer;
  148. }
  149. .#{$primaryStyleName}-generated-row {
  150. background: #efefef;
  151. }
  152. .#{$primaryStyleName}-body-noselection .#{$primaryStyleName}-row,
  153. .#{$primaryStyleName}-body-noselection .#{$primaryStyleName}-row-odd {
  154. cursor: default;
  155. }
  156. .#{$primaryStyleName} .v-selected {
  157. background: #999;
  158. color: #fff;
  159. }
  160. .#{$primaryStyleName}-cell-content {
  161. white-space: nowrap;
  162. overflow: hidden;
  163. padding: 0 6px;
  164. border-right: 1px solid #aaa;
  165. }
  166. .#{$primaryStyleName}-cell-wrapper {
  167. /* Do not specify any margins, paddings or borders here */
  168. white-space: nowrap;
  169. overflow: hidden;
  170. }
  171. .#{$primaryStyleName}-cell-wrapper-align-center {
  172. text-align: center;
  173. }
  174. .#{$primaryStyleName}-cell-wrapper-align-right {
  175. text-align: right;
  176. }
  177. .#{$primaryStyleName}-column-selector {
  178. float: right;
  179. background: transparent url(../common/img/sprites.png) no-repeat 4px -37px;
  180. margin: -1.2em 0 0 0;
  181. height: 1.2em;
  182. width: 14px;
  183. position: relative; /* hide this from IE, it works without it */
  184. cursor: pointer;
  185. }
  186. .#{$primaryStyleName}.v-disabled .#{$primaryStyleName}-column-selector {
  187. cursor: default;
  188. }
  189. .#{$primaryStyleName}-focus-slot-left {
  190. border-left: 2px solid #999;
  191. float: none;
  192. margin-bottom: -1.2em;
  193. width: auto;
  194. background: transparent;
  195. border-right: 1px solid #aaa;
  196. }
  197. .#{$primaryStyleName}-focus-slot-right {
  198. border-right: 2px solid #999;
  199. margin-left: -2px;
  200. }
  201. .#{$primaryStyleName}-header-drag {
  202. position: absolute;
  203. background: #efefef;
  204. border: 1px solid #eee;
  205. opacity: 0.9;
  206. filter: alpha(opacity=90);
  207. margin-top: 20px;
  208. z-index: 30000;
  209. }
  210. .#{$primaryStyleName}-header-drag .v-icon {
  211. vertical-align: middle;
  212. }
  213. .#{$primaryStyleName}-scrollposition {
  214. width: 160px;
  215. background: #eee;
  216. border: 1px solid #aaa;
  217. }
  218. .#{$primaryStyleName}-scrollposition span {
  219. display: block;
  220. text-align: center;
  221. }
  222. .#{$primaryStyleName}-body:focus,
  223. .#{$primaryStyleName}-body-wrapper:focus {
  224. outline: none;
  225. }
  226. .#{$primaryStyleName}-body.focused {
  227. border-color: #388ddd;
  228. }
  229. .#{$primaryStyleName}-focus .#{$primaryStyleName}-cell-content {
  230. border-top: 1px dotted #0066bd;
  231. border-bottom: 1px dotted #0066bd;
  232. }
  233. .#{$primaryStyleName}-focus .#{$primaryStyleName}-cell-wrapper {
  234. margin-top: -1px;
  235. margin-bottom: -1px;
  236. }
  237. /* row in column selector */
  238. .v-on {
  239. }
  240. .v-off {
  241. color: #ddd;
  242. }
  243. /* CheckBox and selection fix #9064 */
  244. .#{$primaryStyleName} .v-checkbox {
  245. display: inline-block;
  246. }
  247. /*************************************
  248. * Drag'n'drop styles
  249. *************************************/
  250. .#{$primaryStyleName}-drag .#{$primaryStyleName}-body {
  251. border-color: #1d9dff;
  252. }
  253. .#{$primaryStyleName}-row-drag-middle .#{$primaryStyleName}-cell-content {
  254. background-color: #bcdcff;
  255. }
  256. .#{$primaryStyleName}-row-drag-top .#{$primaryStyleName}-cell-content {
  257. border-top: 2px solid #1d9dff;
  258. }
  259. .#{$primaryStyleName}-row-drag-top .#{$primaryStyleName}-cell-wrapper {
  260. margin-top: -2px; /* compensate the space consumed by border hint */
  261. }
  262. .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content {
  263. border-bottom: 2px solid #1d9dff;
  264. }
  265. .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-wrapper {
  266. margin-bottom: -2px; /* compensate the space consumed by border hint */
  267. }
  268. .#{$primaryStyleName}-row-drag-top .#{$primaryStyleName}-cell-content:first-child:before,
  269. .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content:first-child:after {
  270. display: block;
  271. position: absolute;
  272. width: 6px;
  273. height: 6px;
  274. margin-top: -4px;
  275. margin-left: -6px;
  276. background: transparent url(../common/img/drag-slot-dot.png);
  277. }
  278. .v-ff & .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content:first-child:after,
  279. .v-ie & .#{$primaryStyleName}-row-drag-bottom .#{$primaryStyleName}-cell-content:first-child:after {
  280. margin-top: -2px;
  281. }
  282. }