From b5ffc981254def06cca8bd63ac44bece9b76badd Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Wed, 21 Dec 2016 16:32:36 +0200 Subject: [PATCH] Cleanup --- demo/styling.html | 57 +++++++++++++-------------- docs/vaadin-grid-styling.adoc | 4 +- test/sorting.html | 2 - vaadin-grid-active-item-behavior.html | 4 +- vaadin-grid-data-source-behavior.html | 7 +++- vaadin-grid-sort-behavior.html | 6 +-- vaadin-grid-table.html | 7 +++- 7 files changed, 46 insertions(+), 41 deletions(-) diff --git a/demo/styling.html b/demo/styling.html index 74986919a..e5e168c06 100644 --- a/demo/styling.html +++ b/demo/styling.html @@ -44,27 +44,27 @@

Material Design

--vaadin-grid-cell: { padding: 0; - } + }; --vaadin-grid-header-cell: { height: 64px; color: rgba(0, 0, 0, var(--dark-secondary-opacity)); font-size: 12px; - } + }; --vaadin-grid-body-cell: { height: 48px; color: rgba(0, 0, 0, var(--dark-primary-opacity)); font-size: 13px; - } + }; --vaadin-grid-body-row-hover-cell: { background-color: var(--paper-grey-200); - } + }; --vaadin-grid-body-row-selected-cell: { background-color: var(--paper-grey-100); - } + }; } @@ -88,7 +88,6 @@

Material Design

} vaadin-grid#material vaadin-grid-sorter { - --vaadin-grid-sorter-arrow: { display: none !important; }; @@ -195,43 +194,43 @@

Valo

height: 38px; border-right: 1px solid #d4d4d4; box-sizing: border-box; - } + }; --vaadin-grid-header-cell: { border-bottom: 1px solid #d4d4d4; background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); - } + }; --vaadin-grid-footer-cell: { background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); - } + }; --vaadin-grid-cell-last-frozen: { box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1); - } + }; --vaadin-grid-body-row-active-cell: { background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); color: #c8dbed; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); border-right-color: #1d69b4; - } + }; --vaadin-grid-body-row-odd-cell: { background-color: #f5f5f5; - } + }; --vaadin-grid-loading-spinner: { display: none; - } + }; --vaadin-grid-body-cell: { transition: opacity 0.2s; - } + }; --vaadin-grid-loading-body-cell: { opacity: 0.2; - } + }; } @@ -243,11 +242,11 @@

Valo

padding: 0; border: 6px solid transparent; border-bottom-color: #000; - } + }; --vaadin-grid-sorter-order: { display: none; - } + }; } vaadin-grid#valo-grid vaadin-grid-filter { @@ -278,7 +277,7 @@

Valo

} } - vaadin-grid#valo-grid:before { + vaadin-grid#valo-grid::before { content: ""; width: 100%; position: absolute; @@ -291,7 +290,7 @@

Valo

transition: opacity 0.2s; } - vaadin-grid#valo-grid[loading]:before { + vaadin-grid#valo-grid[loading]::before { opacity: 1; animation: loading-expand 1s linear; } @@ -402,11 +401,11 @@

Transparent Header

--vaadin-grid-cell: { padding: 0 13px; - } + }; --vaadin-grid-body-cell: { height: 65px; - } + }; --vaadin-grid-header-cell: { background: rgba(235, 238, 246, 0.9); @@ -418,25 +417,25 @@

Transparent Header

background-size: 1px 100%; background-position: 100% 0%; background-repeat: no-repeat; - } + }; --vaadin-grid-body-row-selected-cell: { background-color: rgb(131, 183, 236); color: #fff; border-bottom-color: rgb(108, 160, 218); - } + }; --vaadin-grid-body-row-odd-cell: { background-color: rgb(251, 252, 254); - } + }; --vaadin-grid-body-row-hover-cell: { background-color: rgb(235, 238, 246); - } + }; --vaadin-grid-body-row-details-cell: { text-align: center; - } + }; } @@ -548,16 +547,16 @@

Rounded Rows

--vaadin-grid-cell: { background: rgb(80, 91, 102); - } + }; --vaadin-grid-body-cell: { padding: 0 0 10px; - } + }; --vaadin-grid-header-cell: { text-transform: uppercase; padding: 16px; - } + }; } diff --git a/docs/vaadin-grid-styling.adoc b/docs/vaadin-grid-styling.adoc index f161a85d2..264904f02 100644 --- a/docs/vaadin-grid-styling.adoc +++ b/docs/vaadin-grid-styling.adoc @@ -18,7 +18,7 @@ This section explains how to customize the [vaadinelement]#vaadin-grid#'s appear See the link:https://cdn.vaadin.com/vaadin-core-elements/preview/vaadin-grid/demo/styling.html[live demos] for more thorough examples on how the grid can be modified to comply link:https://material.io/guidelines/components/data-tables.html[Material Design] specification, how to define data rows with rounded borders and more. [[vaadin-grid.styling.mixins]] -== Theming With Style Mixins +== Styling With Style Mixins The vaadin-grid bundles a set of pre-defined style mixins intended for easy styling of the grid's cells in various different states and contexts. @@ -104,7 +104,7 @@ image::img/vaadin-grid-styling-sorter.png[width="450"] [[vaadin-grid.styling.templates]] -== Custom Theming With Column Templates +== Custom Styling With Column Templates In addition to the style mixins, column templates provide a handy means for making specific style adjustments to [vaadinelement]#vaadin-grid# cells. Since the cell content doesn't get hidden inside the [vaadinelement]#vaadin-grid#'s shadow root, it can be targeted with standard CSS selectors. diff --git a/test/sorting.html b/test/sorting.html index 18721843e..964058aba 100644 --- a/test/sorting.html +++ b/test/sorting.html @@ -185,14 +185,12 @@ }); it('should not sort the items if sorters is empty', function() { - debugger; sorterFirst.direction = null; sorterLast.direction = null; grid.items = buildDataSet(1000); var bodyRows = getRows(grid.$.scroller.$.items); var cells = getRowCells(bodyRows[0]); expect(cells[0].item).to.equal(grid.items[0]); - debugger; }); }); diff --git a/vaadin-grid-active-item-behavior.html b/vaadin-grid-active-item-behavior.html index 8fd11a554..a8a39e31b 100644 --- a/vaadin-grid-active-item-behavior.html +++ b/vaadin-grid-active-item-behavior.html @@ -45,10 +45,10 @@ _activeItemChanged: function() { if (this.$.scroller._physicalItems) { - this.$.scroller._physicalItems.forEach(function(row) { + this.$.scroller._physicalItems.forEach(function(row) { this._updateItem(row, row.item); }.bind(this)); } } }; - + diff --git a/vaadin-grid-data-source-behavior.html b/vaadin-grid-data-source-behavior.html index 8f68dc981..9a9a0a265 100644 --- a/vaadin-grid-data-source-behavior.html +++ b/vaadin-grid-data-source-behavior.html @@ -2,8 +2,11 @@