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 14KB

Migrate 7.7.5 branch patches to v8. (#7969) * Prevent adding several scrollbar handlers (#19189). Change-Id: Ib0cc6c6835aab6d263f153362a328bcf2be7bc5c * Prevent adding several scrollbar handlers (#19189). * Keep expand ratio for last row/column when reducing grid layout size (#20297) Change-Id: Iff53a803596f4fc1eae8e4bfa307b9c1f4df961a * Fixed drag and drop failure when message dragged from email client (#20451) When dragging message form email client on Windows, item.webkitGetAsEntry() might return null creating NPE on the client side. Added additional checks for this situation. Change-Id: I569f7e6d0d7b137f24be53d1fbce384695ae8c73 * Change expected pre-release version number pattern in publish report Change-Id: Icdacecc490d2490ea9e262f5c5736c1dece2a89d * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeEvents.java * Fixed touch scrolling issue in Surface and WP devices (#18737) Fixed by using pointerevents instead of touchevents when the browser is IE11, or Edge. Also added touch-action: none; css rules into escalator.css to prevent default touch behaviour on IE11 and Edge. Does not affect IE8 to IE10 browsers, behaviour on those will stay the same as before the fix. No new unit tests since we do not have automatic touch testing possibilities yet. Please test manually with Surface: IE11 and Edge, use for example uitest: com.vaadin.tests.components.grid.basics.GridBasicsomponents.grid.basics.GridBasics Change-Id: Iddbf1852e6ffafc855f749d6f4ebb235ed0f5703 * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 # Conflicts: # client/src/main/java/com/vaadin/client/connectors/GridConnector.java # client/src/main/java/com/vaadin/client/widgets/Grid.java # server/src/main/java/com/vaadin/ui/Grid.java # shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java # themes/src/main/themes/VAADIN/themes/base/grid/grid.scss # uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java Change-Id: Ieca56121875198ed559a41c143b28926e2695433 * Fix NPE in case some items don't contain all properties of Grid. This could occur in when parent is a different entity than its children in hierarchical data. Change-Id: Icd53b5b5e5544a3680d0cd99702ab78224b2dc08 # Conflicts: # server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java # server/src/main/java/com/vaadin/ui/Grid.java * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 * Removed V8 VTextField unused import, forgotten @RunLocally. * Don't rely on selenium "sendKeys" behavior. * Revert "Change expected pre-release version number pattern in publish report" This reverts commit 8df27b952dddb691aead6a633c5b3724c98bf343. * Migrate TextField/TextArea patch from 7.7 to master (modern components) Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50
7 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. $v-grid-border-size: 1px !default;
  2. $v-grid-border: $v-grid-border-size solid #ddd !default;
  3. $v-grid-cell-vertical-border: $v-grid-border !default;
  4. $v-grid-cell-horizontal-border: $v-grid-cell-vertical-border !default;
  5. $v-grid-cell-focused-border: 1px solid !default;
  6. $v-grid-header-border: $v-grid-border !default;
  7. $v-grid-footer-border: $v-grid-header-border !default;
  8. $v-grid-row-height: round($v-font-size * 1.5) !default;
  9. $v-grid-row-background-color: #fff !default;
  10. $v-grid-row-stripe-background-color: darken($v-grid-row-background-color, 5%) !default;
  11. $v-grid-row-selected-background-color: darken($v-grid-row-background-color, 25%) !default;
  12. $v-grid-row-focused-background-color: null !default;
  13. $v-grid-header-row-height: null !default;
  14. $v-grid-header-font-size: $v-font-size !default;
  15. $v-grid-header-background-color: $v-grid-row-background-color !default;
  16. $v-grid-header-drag-marked-color: $v-grid-row-selected-background-color !default;
  17. $v-grid-footer-row-height: $v-grid-header-row-height !default;
  18. $v-grid-footer-font-size: $v-grid-header-font-size !default;
  19. $v-grid-footer-background-color: $v-grid-header-background-color !default;
  20. $v-grid-cell-padding-horizontal: 10px !default;
  21. $v-grid-editor-background-color: $v-grid-row-background-color !default;
  22. $v-grid-details-marker-width: 2px !default;
  23. $v-grid-details-marker-color: $v-grid-row-selected-background-color !default;
  24. $v-grid-details-border-top: $v-grid-cell-horizontal-border !default;
  25. $v-grid-details-border-top-stripe: $v-grid-cell-horizontal-border !default;
  26. $v-grid-details-border-bottom: 1px solid darken($v-grid-row-stripe-background-color, 10%) !default;
  27. $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-color, 10%) !default;
  28. @import "../escalator/escalator";
  29. @mixin base-grid($primaryStyleName: v-grid) {
  30. @include base-escalator($primaryStyleName: $primaryStyleName, $background-color: $v-grid-row-background-color);
  31. .#{$primaryStyleName} {
  32. outline: none;
  33. }
  34. .#{$primaryStyleName}-scroller-vertical,
  35. .#{$primaryStyleName}-scroller-horizontal {
  36. border: $v-grid-border;
  37. }
  38. .#{$primaryStyleName}-scroller-vertical {
  39. border-left: none;
  40. }
  41. .#{$primaryStyleName}-scroller-horizontal {
  42. border-top: none;
  43. }
  44. .#{$primaryStyleName}-tablewrapper {
  45. border: $v-grid-border;
  46. }
  47. // Column drag and drop elements
  48. .#{$primaryStyleName} .header-drag-table {
  49. border-spacing: 0;
  50. position: relative;
  51. table-layout: fixed;
  52. width: inherit; // a decent default fallback
  53. .#{$primaryStyleName}-header {
  54. position: absolute;
  55. > .#{$primaryStyleName}-cell {
  56. border: $v-grid-border;
  57. margin-top: -10px;
  58. opacity: 0.9;
  59. filter: alpha(opacity=90); // IE8
  60. z-index: 30000;
  61. }
  62. > .#{$primaryStyleName}-drop-marker {
  63. background-color: $v-grid-header-drag-marked-color;
  64. position: absolute;
  65. width: 3px;
  66. }
  67. }
  68. }
  69. // Sidebar
  70. .#{$primaryStyleName}-sidebar.v-contextmenu {
  71. @include box-shadow(none);
  72. border-radius: 0;
  73. position: absolute;
  74. top: 0;
  75. right: 0;
  76. background-color: $v-grid-header-background-color;
  77. border: $v-grid-header-border;
  78. padding: 0;
  79. z-index: 5;
  80. &.#{$primaryStyleName}-sidebar-popup {
  81. right: auto;
  82. }
  83. .#{$primaryStyleName}-sidebar-button {
  84. background: transparent;
  85. border: none;
  86. color: inherit;
  87. cursor: pointer;
  88. outline: none;
  89. padding: 0 4px;
  90. text-align: right;
  91. line-height: 1;
  92. &[disabled] {
  93. cursor: default;
  94. }
  95. &::-moz-focus-inner {
  96. border: 0;
  97. }
  98. &:after {
  99. content: "\f0c9";
  100. display: block;
  101. font-family: ThemeIcons, sans-serif;
  102. font-size: $v-grid-header-font-size;
  103. }
  104. }
  105. &.closed {
  106. border-radius: 0;
  107. }
  108. &.open {
  109. .#{$primaryStyleName}-sidebar-button {
  110. width: 100%;
  111. &:after {
  112. content: "\f0c9";
  113. font-size: $v-grid-header-font-size;
  114. line-height: 1;
  115. }
  116. }
  117. }
  118. .v-ie &.open .#{$primaryStyleName}-sidebar-button {
  119. vertical-align: middle;
  120. }
  121. .#{$primaryStyleName}-sidebar-content {
  122. padding: 4px 0;
  123. overflow-y: auto;
  124. overflow-x: hidden;
  125. .gwt-MenuBar {
  126. .gwt-MenuItem .column-hiding-toggle {
  127. text-shadow: none;
  128. }
  129. }
  130. }
  131. }
  132. // Common cell styles
  133. .#{$primaryStyleName}-cell {
  134. background-color: $v-grid-row-background-color;
  135. padding: 0 $v-grid-cell-padding-horizontal;
  136. line-height: $v-grid-row-height;
  137. text-overflow: ellipsis;
  138. > * {
  139. line-height: $v-line-height;
  140. vertical-align: middle;
  141. }
  142. // Force div elements to inline-blocks by default to enable vertical centering
  143. > div {
  144. display: inline-block;
  145. }
  146. &.frozen {
  147. @include box-shadow(1px 0 2px rgba(0,0,0,.1));
  148. border-right: $v-grid-cell-vertical-border;
  149. @if $v-grid-cell-vertical-border and $v-grid-cell-vertical-border != none {
  150. + th,
  151. + td {
  152. border-left: none;
  153. }
  154. }
  155. }
  156. }
  157. // Rows
  158. .#{$primaryStyleName}-row > td,
  159. .#{$primaryStyleName}-editor-cells > div {
  160. border-left: $v-grid-cell-vertical-border;
  161. border-bottom: $v-grid-cell-horizontal-border;
  162. &:first-child {
  163. border-left: none;
  164. }
  165. }
  166. .#{$primaryStyleName}-editor-cells.frozen > div {
  167. @include box-shadow(1px 0 2px rgba(0,0,0,.1));
  168. border-right: $v-grid-cell-vertical-border;
  169. border-left: none;
  170. }
  171. .#{$primaryStyleName}-row-stripe > td {
  172. background-color: $v-grid-row-stripe-background-color;
  173. }
  174. .#{$primaryStyleName}-row-selected > td {
  175. background: $v-grid-row-selected-background-color;
  176. }
  177. .#{$primaryStyleName}-row-focused > td {
  178. background-color: $v-grid-row-focused-background-color;
  179. }
  180. // Header
  181. .#{$primaryStyleName}-header {
  182. th {
  183. position: relative;
  184. background-color: $v-grid-header-background-color;
  185. font-size: $v-grid-header-font-size;
  186. font-weight: inherit;
  187. border-left: $v-grid-header-border;
  188. border-bottom: $v-grid-header-border;
  189. line-height: $v-grid-header-row-height;
  190. text-align: left;
  191. &:first-child {
  192. border-left: none;
  193. }
  194. }
  195. .sort-asc,
  196. .sort-desc {
  197. padding-right: round($v-grid-header-font-size * 1.2) + $v-grid-cell-padding-horizontal;
  198. &:after {
  199. font-family: ThemeIcons, sans-serif;
  200. content: "\f0de" " " attr(sort-order);
  201. position: absolute;
  202. right: $v-grid-cell-padding-horizontal;
  203. font-size: round($v-grid-header-font-size * 0.85);
  204. }
  205. }
  206. .sort-desc:after {
  207. content: "\f0dd" " " attr(sort-order);
  208. }
  209. }
  210. .#{$primaryStyleName}-column-resize-handle {
  211. position: absolute;
  212. width: 2 * $v-grid-cell-padding-horizontal;
  213. right: -$v-grid-cell-padding-horizontal;
  214. top: 0px;
  215. bottom: 0px;
  216. cursor: col-resize;
  217. z-index: 10;
  218. // TODO should refactor into a mixin
  219. -webkit-user-select: none;
  220. -khtml-user-select: none;
  221. -moz-user-select: none;
  222. -ms-user-select: none;
  223. user-select: none;
  224. }
  225. .#{$primaryStyleName}-column-resize-simple-indicator {
  226. position: absolute;
  227. width: 3px;
  228. top: 0px;
  229. left: $v-grid-cell-padding-horizontal;
  230. z-index: 9001;
  231. background: #fff;
  232. box-shadow: 0px 0px 5px #000;
  233. -webkit-user-select: none;
  234. -khtml-user-select: none;
  235. -moz-user-select: none;
  236. -ms-user-select: none;
  237. user-select: none;
  238. }
  239. // Footer
  240. .#{$primaryStyleName}-footer {
  241. td {
  242. background-color: $v-grid-footer-background-color;
  243. font-size: $v-grid-footer-font-size;
  244. font-weight: inherit;
  245. border-left: $v-grid-footer-border;
  246. border-top: $v-grid-footer-border;
  247. border-bottom: none;
  248. line-height: $v-grid-footer-row-height;
  249. &:first-child {
  250. border-left: none;
  251. }
  252. }
  253. }
  254. // Header and footer
  255. .#{$primaryStyleName}-header,
  256. .#{$primaryStyleName}-footer {
  257. .#{$primaryStyleName}-cell {
  258. overflow: visible;
  259. }
  260. }
  261. .#{$primaryStyleName}-column-header-content,
  262. .#{$primaryStyleName}-column-footer-content {
  263. width: 100%;
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. // Hackish, needed to override the "v-grid-cell > *" rule above
  267. line-height: $v-grid-row-height;
  268. vertical-align: baseline;
  269. }
  270. // Decorative elements
  271. .#{$primaryStyleName}-header-deco {
  272. border-top: $v-grid-header-border;
  273. border-right: $v-grid-header-border;
  274. background-color: $v-grid-header-background-color;
  275. }
  276. .#{$primaryStyleName}-footer-deco {
  277. border-bottom: $v-grid-footer-border;
  278. border-right: $v-grid-footer-border;
  279. background-color: $v-grid-footer-background-color;
  280. }
  281. .#{$primaryStyleName}-horizontal-scrollbar-deco {
  282. background-color: $v-grid-footer-background-color;
  283. border: $v-grid-footer-border;
  284. border-top: none;
  285. }
  286. // Focused cell style (common for all cells)
  287. .#{$primaryStyleName}-cell-focused {
  288. position: relative;
  289. &:before {
  290. content: "";
  291. position: absolute;
  292. top: 0;
  293. right: 0;
  294. bottom: 0;
  295. left: 0;
  296. border: $v-grid-cell-focused-border;
  297. display: none;
  298. pointer-events: none;
  299. }
  300. }
  301. .#{$primaryStyleName}:focus .#{$primaryStyleName}-cell-focused:before {
  302. display: block;
  303. }
  304. .#{$primaryStyleName}.v-disabled:focus .#{$primaryStyleName}-cell-focused:before {
  305. // Disabled Grid should not show cell focus outline
  306. display: none;
  307. }
  308. // Editor
  309. .#{$primaryStyleName}-editor {
  310. position: absolute;
  311. z-index: 20;
  312. overflow: hidden;
  313. left: 0;
  314. right: 0;
  315. border: $v-grid-border;
  316. box-sizing: border-box;
  317. -moz-box-sizing: border-box;
  318. margin-top: nth($v-grid-border, 1) * -1;
  319. @include box-shadow(0 0 9px rgba(0,0,0,.2));
  320. // Unbuffered footer needs to be 100% width to display correctly
  321. &.unbuffered {
  322. .#{$primaryStyleName}-editor-footer {
  323. width: 100%;
  324. }
  325. }
  326. }
  327. .#{$primaryStyleName}-editor-cells {
  328. position: relative;
  329. white-space: nowrap;
  330. &.frozen {
  331. z-index: 2;
  332. }
  333. > div {
  334. display: inline-block;
  335. @include box-sizing(border-box);
  336. vertical-align: middle;
  337. background: $v-grid-editor-background-color;
  338. &:first-child {
  339. border-left: none;
  340. }
  341. > * {
  342. vertical-align: middle;
  343. display: inline-block;
  344. }
  345. .v-filterselect {
  346. padding-left: 0;
  347. }
  348. input[type="text"],
  349. input[type="text"].v-filterselect-input,
  350. input[type="password"] {
  351. padding-left: $v-grid-cell-padding-horizontal;
  352. }
  353. input[type="text"]:not(.v-filterselect-input),
  354. input[type="password"] {
  355. padding-right: $v-grid-cell-padding-horizontal / 2;
  356. }
  357. input[type="checkbox"] {
  358. margin-left: $v-grid-cell-padding-horizontal;
  359. }
  360. .v-textfield,
  361. .v-datefield,
  362. .v-filterselect {
  363. min-width: 100%;
  364. max-width: 100%;
  365. min-height: 100%;
  366. max-height: 100%;
  367. }
  368. .v-select,
  369. .v-select-select {
  370. min-width: 100%;
  371. max-width: 100%;
  372. }
  373. &.not-editable.#{$primaryStyleName}-cell {
  374. float: none;
  375. }
  376. }
  377. .error::before {
  378. position: absolute;
  379. display: block;
  380. height: 0;
  381. width: 0;
  382. content: "";
  383. border-top: 5px solid red;
  384. border-right: 5px solid transparent;
  385. }
  386. .error,
  387. .error > input {
  388. background-color: #fee;
  389. }
  390. }
  391. .#{$primaryStyleName}-editor-footer {
  392. display: table;
  393. height: $v-grid-row-height;
  394. border-top: $v-grid-cell-horizontal-border;
  395. margin-top: nth($v-grid-cell-horizontal-border, 1) * -1;
  396. background: $v-grid-row-background-color;
  397. padding: 0 5px;
  398. + .#{$primaryStyleName}-editor-cells > div {
  399. border-bottom: none;
  400. border-top: $v-grid-cell-horizontal-border;
  401. }
  402. &:first-child {
  403. border-top: none;
  404. margin-top: 0;
  405. border-bottom: $v-grid-cell-horizontal-border;
  406. margin-bottom: nth($v-grid-cell-horizontal-border, 1) * -1;
  407. }
  408. }
  409. .#{$primaryStyleName}-editor-message,
  410. .#{$primaryStyleName}-editor-buttons {
  411. display: table-cell;
  412. white-space: nowrap;
  413. vertical-align: middle;
  414. }
  415. .#{$primaryStyleName}-editor-message {
  416. width: 100%;
  417. position: relative;
  418. > div {
  419. position: absolute;
  420. width: 100%;
  421. overflow: hidden;
  422. text-overflow: ellipsis;
  423. line-height: $v-grid-row-height;
  424. top: 0;
  425. }
  426. }
  427. .#{$primaryStyleName}-editor-save {
  428. margin-right: 4px;
  429. }
  430. .#{$primaryStyleName}-spacer {
  431. // using padding since left is used with some position functions in escalator
  432. padding-left: $v-grid-details-marker-width - $v-grid-border-size;
  433. }
  434. .#{$primaryStyleName}-spacer > td {
  435. display: block;
  436. padding: 0;
  437. background-color: $v-grid-row-background-color;
  438. border-top: $v-grid-details-border-top;
  439. border-bottom: $v-grid-details-border-bottom;
  440. }
  441. .#{$primaryStyleName}-spacer.stripe > td {
  442. background-color: $v-grid-row-stripe-background-color;
  443. border-top: $v-grid-details-border-top-stripe;
  444. border-bottom: $v-grid-details-border-bottom-stripe;
  445. }
  446. .#{$primaryStyleName}-spacer-deco-container {
  447. border-top: $v-grid-border-size solid transparent; // same size as table wrapper border
  448. position: relative;
  449. top: 0; // escalator will override top for scrolling and margin-top for header offset.
  450. z-index: 5;
  451. }
  452. .#{$primaryStyleName}-spacer-deco {
  453. top: 0; // this will be overridden by code, but it's a good default.
  454. left: 0;
  455. width: $v-grid-details-marker-width;
  456. background-color: $v-grid-details-marker-color;
  457. position: absolute;
  458. height: 100%; // this will be overridden by code, but it's a good default.
  459. pointer-events: none;
  460. }
  461. // Renderers
  462. .#{$primaryStyleName}-cell > .v-progressbar {
  463. width: 100%;
  464. }
  465. }