@vaadin/grid 25.0.0-alpha8 → 25.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all-imports.js +1 -1
- package/package.json +12 -15
- package/src/array-data-provider.js +3 -2
- package/src/styles/vaadin-grid-base-styles.js +265 -97
- package/src/styles/vaadin-grid-sorter-base-styles.js +15 -2
- package/src/styles/vaadin-grid-tree-toggle-base-styles.js +3 -3
- package/src/vaadin-grid-a11y-mixin.js +26 -10
- package/src/vaadin-grid-column-auto-width-mixin.js +14 -13
- package/src/vaadin-grid-column-mixin.d.ts +1 -0
- package/src/vaadin-grid-column-mixin.js +1 -16
- package/src/vaadin-grid-column-reordering-mixin.js +2 -2
- package/src/vaadin-grid-data-provider-mixin.js +15 -10
- package/src/vaadin-grid-event-context-mixin.d.ts +2 -0
- package/src/vaadin-grid-event-context-mixin.js +1 -0
- package/src/vaadin-grid-filter.js +1 -1
- package/src/vaadin-grid-helpers.js +9 -0
- package/src/vaadin-grid-keyboard-navigation-mixin.js +1 -5
- package/src/vaadin-grid-mixin.d.ts +1 -0
- package/src/vaadin-grid-mixin.js +36 -38
- package/src/vaadin-grid-resize-mixin.d.ts +10 -0
- package/src/vaadin-grid-resize-mixin.js +73 -0
- package/src/vaadin-grid-row-details-mixin.js +1 -1
- package/src/vaadin-grid-scroll-mixin.js +5 -87
- package/src/vaadin-grid-selection-column-base-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-column-base-mixin.js +1 -1
- package/src/vaadin-grid-selection-column.d.ts +2 -0
- package/src/vaadin-grid-selection-column.js +2 -1
- package/src/vaadin-grid-sort-column.d.ts +2 -0
- package/src/vaadin-grid-sorter.d.ts +3 -3
- package/src/vaadin-grid-sorter.js +4 -4
- package/src/vaadin-grid-tree-column-mixin.js +2 -7
- package/src/vaadin-grid-tree-toggle.d.ts +4 -4
- package/src/vaadin-grid-tree-toggle.js +5 -5
- package/src/vaadin-grid.d.ts +1 -0
- package/src/vaadin-grid.js +3 -1
- package/vaadin-grid-column-group.js +1 -1
- package/vaadin-grid-column.js +1 -1
- package/vaadin-grid-filter-column.js +1 -1
- package/vaadin-grid-filter.js +1 -1
- package/vaadin-grid-selection-column.js +1 -1
- package/vaadin-grid-sort-column.js +1 -1
- package/vaadin-grid-sorter.js +1 -1
- package/vaadin-grid-tree-column.js +1 -1
- package/vaadin-grid-tree-toggle.js +1 -1
- package/vaadin-grid.js +1 -1
- package/web-types.json +13 -13
- package/web-types.lit.json +12 -12
- package/src/styles/vaadin-grid-core-styles.d.ts +0 -8
- package/src/styles/vaadin-grid-core-styles.js +0 -388
- package/src/styles/vaadin-grid-filter-core-styles.d.ts +0 -8
- package/src/styles/vaadin-grid-filter-core-styles.js +0 -18
- package/src/styles/vaadin-grid-sorter-core-styles.d.ts +0 -8
- package/src/styles/vaadin-grid-sorter-core-styles.js +0 -61
- package/src/styles/vaadin-grid-tree-toggle-core-styles.d.ts +0 -8
- package/src/styles/vaadin-grid-tree-toggle-core-styles.js +0 -78
- package/theme/lumo/all-imports.d.ts +0 -11
- package/theme/lumo/all-imports.js +0 -11
- package/theme/lumo/vaadin-grid-column-group.d.ts +0 -1
- package/theme/lumo/vaadin-grid-column-group.js +0 -1
- package/theme/lumo/vaadin-grid-column.d.ts +0 -1
- package/theme/lumo/vaadin-grid-column.js +0 -1
- package/theme/lumo/vaadin-grid-filter-column.d.ts +0 -2
- package/theme/lumo/vaadin-grid-filter-column.js +0 -2
- package/theme/lumo/vaadin-grid-filter.d.ts +0 -2
- package/theme/lumo/vaadin-grid-filter.js +0 -2
- package/theme/lumo/vaadin-grid-selection-column.d.ts +0 -2
- package/theme/lumo/vaadin-grid-selection-column.js +0 -2
- package/theme/lumo/vaadin-grid-sort-column.d.ts +0 -2
- package/theme/lumo/vaadin-grid-sort-column.js +0 -2
- package/theme/lumo/vaadin-grid-sorter-styles.d.ts +0 -3
- package/theme/lumo/vaadin-grid-sorter-styles.js +0 -52
- package/theme/lumo/vaadin-grid-sorter.d.ts +0 -2
- package/theme/lumo/vaadin-grid-sorter.js +0 -2
- package/theme/lumo/vaadin-grid-styles.d.ts +0 -6
- package/theme/lumo/vaadin-grid-styles.js +0 -405
- package/theme/lumo/vaadin-grid-tree-column.d.ts +0 -2
- package/theme/lumo/vaadin-grid-tree-column.js +0 -2
- package/theme/lumo/vaadin-grid-tree-toggle-styles.d.ts +0 -3
- package/theme/lumo/vaadin-grid-tree-toggle-styles.js +0 -81
- package/theme/lumo/vaadin-grid-tree-toggle.d.ts +0 -2
- package/theme/lumo/vaadin-grid-tree-toggle.js +0 -2
- package/theme/lumo/vaadin-grid.d.ts +0 -2
- package/theme/lumo/vaadin-grid.js +0 -2
package/all-imports.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,9 +25,6 @@
|
|
|
25
25
|
"lit.d.ts",
|
|
26
26
|
"lit.js",
|
|
27
27
|
"src",
|
|
28
|
-
"!src/styles/*-base-styles.d.ts",
|
|
29
|
-
"!src/styles/*-base-styles.js",
|
|
30
|
-
"theme",
|
|
31
28
|
"vaadin-*.d.ts",
|
|
32
29
|
"vaadin-*.js",
|
|
33
30
|
"web-types.json",
|
|
@@ -47,24 +44,24 @@
|
|
|
47
44
|
],
|
|
48
45
|
"dependencies": {
|
|
49
46
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
50
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
51
|
-
"@vaadin/checkbox": "25.0.0-
|
|
52
|
-
"@vaadin/component-base": "25.0.0-
|
|
53
|
-
"@vaadin/lit-renderer": "25.0.0-
|
|
54
|
-
"@vaadin/text-field": "25.0.0-
|
|
55
|
-
"@vaadin/vaadin-
|
|
56
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha8",
|
|
47
|
+
"@vaadin/a11y-base": "25.0.0-beta1",
|
|
48
|
+
"@vaadin/checkbox": "25.0.0-beta1",
|
|
49
|
+
"@vaadin/component-base": "25.0.0-beta1",
|
|
50
|
+
"@vaadin/lit-renderer": "25.0.0-beta1",
|
|
51
|
+
"@vaadin/text-field": "25.0.0-beta1",
|
|
52
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-beta1",
|
|
57
53
|
"lit": "^3.0.0"
|
|
58
54
|
},
|
|
59
55
|
"devDependencies": {
|
|
60
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
61
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
56
|
+
"@vaadin/chai-plugins": "25.0.0-beta1",
|
|
57
|
+
"@vaadin/test-runner-commands": "25.0.0-beta1",
|
|
62
58
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
63
|
-
"
|
|
59
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-beta1",
|
|
60
|
+
"sinon": "^21.0.0"
|
|
64
61
|
},
|
|
65
62
|
"web-types": [
|
|
66
63
|
"web-types.json",
|
|
67
64
|
"web-types.lit.json"
|
|
68
65
|
],
|
|
69
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
|
|
70
67
|
}
|
|
@@ -79,7 +79,7 @@ function compare(a, b) {
|
|
|
79
79
|
* Sorts the given array of items based on the sorting rules and returns the result.
|
|
80
80
|
*
|
|
81
81
|
* @param {Array<any>} items
|
|
82
|
-
* @param {Array<GridSorterDefinition>}
|
|
82
|
+
* @param {Array<GridSorterDefinition>} sortOrders
|
|
83
83
|
* @return {Array<any>}
|
|
84
84
|
*/
|
|
85
85
|
function multiSort(items, sortOrders) {
|
|
@@ -101,6 +101,7 @@ function multiSort(items, sortOrders) {
|
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* @param {!Array<!GridItem>} items
|
|
104
|
+
* @param {Array<GridFilterDefinition>} filters
|
|
104
105
|
* @return {!Array<!GridItem>}
|
|
105
106
|
*/
|
|
106
107
|
function filter(items, filters) {
|
|
@@ -120,7 +121,7 @@ function filter(items, filters) {
|
|
|
120
121
|
* Creates a new grid compatible data provider that serves the items
|
|
121
122
|
* from the given array as data when requested by the grid.
|
|
122
123
|
*
|
|
123
|
-
* @param {Array<any>}
|
|
124
|
+
* @param {Array<any>} allItems
|
|
124
125
|
* @return {GridDataProvider<any>}
|
|
125
126
|
*/
|
|
126
127
|
export const createArrayDataProvider = (allItems) => {
|
|
@@ -3,19 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const gridStyles = css`
|
|
10
|
-
@keyframes vaadin-grid-appear {
|
|
11
|
-
to {
|
|
12
|
-
opacity: 1;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
:host {
|
|
17
11
|
display: flex;
|
|
18
|
-
animation: 1ms vaadin-grid-appear;
|
|
19
12
|
max-width: 100%;
|
|
20
13
|
height: 400px;
|
|
21
14
|
min-height: var(--_grid-min-height, 0);
|
|
@@ -25,14 +18,12 @@ export const gridStyles = css`
|
|
|
25
18
|
box-sizing: border-box;
|
|
26
19
|
-webkit-tap-highlight-color: transparent;
|
|
27
20
|
background: var(--vaadin-grid-background, var(--vaadin-background-color));
|
|
28
|
-
border: var(--_border-width) solid var(--
|
|
21
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
29
22
|
cursor: default;
|
|
23
|
+
--_border-color: var(--vaadin-grid-border-color, var(--vaadin-border-color-secondary));
|
|
30
24
|
--_border-width: 0;
|
|
31
|
-
--_row-border-width: var(--vaadin-grid-
|
|
32
|
-
--_column-border-width: var(--vaadin-grid-
|
|
33
|
-
--_cell-padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
|
|
34
|
-
--_reorder-background-image: none;
|
|
35
|
-
--_selection-background-image: none;
|
|
25
|
+
--_row-border-width: var(--vaadin-grid-row-border-width, 1px);
|
|
26
|
+
--_column-border-width: var(--vaadin-grid-column-border-width, 0px);
|
|
36
27
|
border-radius: var(--_border-radius);
|
|
37
28
|
--_border-radius: 0;
|
|
38
29
|
}
|
|
@@ -50,7 +41,7 @@ export const gridStyles = css`
|
|
|
50
41
|
/* Variant: No outer border */
|
|
51
42
|
:host(:not([theme~='no-border'])) {
|
|
52
43
|
--_border-width: var(--vaadin-grid-border-width, 1px);
|
|
53
|
-
--_border-radius: var(--vaadin-grid-border-radius, var(--vaadin-radius-
|
|
44
|
+
--_border-radius: var(--vaadin-grid-border-radius, var(--vaadin-radius-m));
|
|
54
45
|
}
|
|
55
46
|
|
|
56
47
|
:host([all-rows-visible]) {
|
|
@@ -80,6 +71,7 @@ export const gridStyles = css`
|
|
|
80
71
|
width: 100%;
|
|
81
72
|
left: 0;
|
|
82
73
|
min-height: 1px;
|
|
74
|
+
z-index: 1;
|
|
83
75
|
}
|
|
84
76
|
|
|
85
77
|
#table {
|
|
@@ -103,7 +95,14 @@ export const gridStyles = css`
|
|
|
103
95
|
position: sticky;
|
|
104
96
|
left: 0;
|
|
105
97
|
width: 100%;
|
|
106
|
-
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host([overflow~='top']) #header,
|
|
101
|
+
:host([overflow~='bottom']) #footer,
|
|
102
|
+
:host([navigating]) #header:has(tr:last-child:focus-within),
|
|
103
|
+
:host([navigating]) #footer:has(tr:first-child:focus-within),
|
|
104
|
+
[empty-state] #header {
|
|
105
|
+
z-index: 2;
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
:host([dir='rtl']) #items,
|
|
@@ -128,7 +127,7 @@ export const gridStyles = css`
|
|
|
128
127
|
[part~='reorder-ghost'] {
|
|
129
128
|
font-size: var(--vaadin-grid-header-font-size, 1em);
|
|
130
129
|
font-weight: var(--vaadin-grid-header-font-weight, 500);
|
|
131
|
-
color: var(--vaadin-grid-header-color, var(--vaadin-color));
|
|
130
|
+
color: var(--vaadin-grid-header-text-color, var(--vaadin-text-color));
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
[part~='row'] {
|
|
@@ -152,114 +151,189 @@ export const gridStyles = css`
|
|
|
152
151
|
}
|
|
153
152
|
|
|
154
153
|
[part~='cell'] {
|
|
155
|
-
box-sizing: border-box;
|
|
156
|
-
background:
|
|
157
|
-
var(--_reorder-background-image), var(--_selection-background-image),
|
|
158
|
-
var(--vaadin-grid-cell-background, var(--vaadin-background-color));
|
|
159
154
|
padding: 0;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
background: var(--vaadin-grid-cell-background, var(--vaadin-background-color));
|
|
157
|
+
border-block: var(--_row-border-width) solid var(--_border-color);
|
|
158
|
+
margin-top: calc(var(--_row-border-width) * -1);
|
|
159
|
+
|
|
160
|
+
/*
|
|
161
|
+
Box-shadows are used to create a "fake" border at the end of the cell/row, which is visible when a row/cell ends
|
|
162
|
+
before the edge of the grid viewport, as well as frozen columns and rows (header and footer).
|
|
163
|
+
If there are frozen columns, we'll make the "fake box-shadow border" on the header and footer opaque by rendering
|
|
164
|
+
both the border color and cell background color, so that a semi-transparent border color doesn't "stack" when
|
|
165
|
+
scrolling horizontally.
|
|
166
|
+
*/
|
|
167
|
+
--_fake-border:
|
|
168
|
+
0 calc(var(--_top, 0) * var(--_row-border-width) * -1) 0 0 var(--_border-color),
|
|
169
|
+
0 calc(var(--_top-opaque, 0) * var(--_row-border-width) * -1) 0 0
|
|
170
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color)),
|
|
171
|
+
0 calc(var(--_bottom, 0) * var(--_row-border-width)) 0 0 var(--_border-color),
|
|
172
|
+
0 calc(var(--_bottom-opaque, 0) * var(--_row-border-width)) 0 0
|
|
173
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color)),
|
|
174
|
+
calc(var(--_start, 0) * var(--_column-border-width) * -1) 0 0 0 var(--_border-color),
|
|
175
|
+
calc(var(--_end, 0) * var(--_column-border-width)) 0 0 0 var(--_border-color),
|
|
176
|
+
calc(var(--_end-opaque, 0) * var(--_column-border-width)) 0 0 0
|
|
177
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color));
|
|
178
|
+
box-shadow: var(--_fake-border);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
[part~='cell']:where(:not([part~='details-cell'])) {
|
|
163
182
|
flex-shrink: 0;
|
|
164
183
|
flex-grow: 1;
|
|
165
|
-
box-sizing: border-box;
|
|
166
184
|
display: flex;
|
|
167
185
|
width: 100%;
|
|
168
186
|
position: relative;
|
|
169
187
|
align-items: center;
|
|
170
188
|
white-space: nowrap;
|
|
189
|
+
border-inline-start: var(--_column-border-width) solid var(--_border-color);
|
|
171
190
|
}
|
|
172
191
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
176
|
-
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
192
|
+
[part~='first-column-cell'] {
|
|
193
|
+
border-inline-start: 0;
|
|
177
194
|
}
|
|
178
195
|
|
|
179
|
-
[part~='row']
|
|
180
|
-
|
|
196
|
+
[part~='first-header-row-cell'],
|
|
197
|
+
[part~='first-footer-row-cell'],
|
|
198
|
+
[part~='first-row-cell'] {
|
|
199
|
+
margin-top: 0;
|
|
200
|
+
border-top: 0;
|
|
181
201
|
}
|
|
182
202
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
content: '';
|
|
186
|
-
position: absolute;
|
|
187
|
-
inset: calc(var(--_row-border-width) * -1) 0;
|
|
188
|
-
z-index: 3;
|
|
189
|
-
transform: translateX(var(--_grid-horizontal-scroll-position));
|
|
190
|
-
pointer-events: none;
|
|
191
|
-
visibility: hidden;
|
|
203
|
+
table:has(#header > tr:not([hidden])) [part~='first-row-cell'] {
|
|
204
|
+
border-top: var(--_row-border-width) solid var(--_border-color);
|
|
192
205
|
}
|
|
193
206
|
|
|
194
|
-
[part~='
|
|
195
|
-
|
|
207
|
+
[part~='last-column-cell'] {
|
|
208
|
+
--_end: 1;
|
|
196
209
|
}
|
|
197
210
|
|
|
198
|
-
|
|
211
|
+
[part~='last-column-cell']:is([part~='header-cell'], [part~='footer-cell']) {
|
|
212
|
+
--_end-opaque: 1;
|
|
213
|
+
}
|
|
199
214
|
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
[part~='last-row-cell']:where(:not([part~='details-opened-row-cell'])),
|
|
216
|
+
[part~='last-footer-row-cell'] {
|
|
217
|
+
border-bottom: 0;
|
|
218
|
+
--_bottom: 1;
|
|
202
219
|
}
|
|
203
220
|
|
|
204
|
-
|
|
221
|
+
[part~='last-frozen-cell'] {
|
|
222
|
+
--_end: 1;
|
|
223
|
+
}
|
|
205
224
|
|
|
206
|
-
|
|
207
|
-
|
|
225
|
+
[part~='last-frozen-cell'] + [part~='cell'] {
|
|
226
|
+
border-inline-start-color: transparent;
|
|
208
227
|
}
|
|
209
228
|
|
|
210
|
-
|
|
211
|
-
|
|
229
|
+
[part~='first-frozen-to-end-cell'] {
|
|
230
|
+
border-inline-start: 0;
|
|
231
|
+
--_start: 1;
|
|
212
232
|
}
|
|
213
233
|
|
|
214
|
-
[part~='
|
|
215
|
-
border-
|
|
216
|
-
var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
|
|
234
|
+
[part~='last-header-row-cell'] {
|
|
235
|
+
border-bottom: 0;
|
|
217
236
|
}
|
|
218
237
|
|
|
219
|
-
|
|
220
|
-
|
|
238
|
+
:host([overflow~='top']) [part~='last-header-row-cell'],
|
|
239
|
+
[empty-state] [part~='last-header-row-cell'] {
|
|
240
|
+
--_bottom: 1;
|
|
221
241
|
}
|
|
222
242
|
|
|
223
|
-
[part~='
|
|
224
|
-
|
|
243
|
+
#header:has(:is([frozen], [frozen-to-end])) [part~='last-header-row-cell'] {
|
|
244
|
+
--_bottom-opaque: 1;
|
|
225
245
|
}
|
|
226
246
|
|
|
227
|
-
[part~='
|
|
228
|
-
|
|
247
|
+
:host([overflow~='bottom']) [part~='first-footer-row-cell'],
|
|
248
|
+
[empty-state] [part~='first-footer-row-cell'] {
|
|
249
|
+
--_top: 1;
|
|
229
250
|
}
|
|
230
251
|
|
|
231
|
-
[part~='first-footer-row-cell'] {
|
|
232
|
-
|
|
252
|
+
#footer:has(:is([frozen], [frozen-to-end])) [part~='first-footer-row-cell'] {
|
|
253
|
+
--_top-opaque: 1;
|
|
233
254
|
}
|
|
234
255
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
256
|
+
table:has(#footer > tr:not([hidden])) [part~='last-row-cell']:not([part~='details-opened-row-cell']) {
|
|
257
|
+
border-bottom: var(--_row-border-width) solid var(--_border-color);
|
|
258
|
+
--_bottom: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
[part~='body-cell']:where(:not([part~='details-cell'])) {
|
|
262
|
+
--_highlight-background-color: var(--vaadin-grid-row-highlight-background-color, transparent);
|
|
263
|
+
--_highlight-background-image: linear-gradient(
|
|
264
|
+
var(--_highlight-background-color),
|
|
265
|
+
var(--_highlight-background-color)
|
|
266
|
+
);
|
|
239
267
|
background:
|
|
240
|
-
var(--
|
|
241
|
-
var(--vaadin-grid-
|
|
268
|
+
var(--_hover-background-image, none), var(--_selected-background-image, none), var(--_highlight-background-image),
|
|
269
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color));
|
|
242
270
|
}
|
|
243
271
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
272
|
+
/* Variant: wrap cell contents */
|
|
273
|
+
|
|
274
|
+
:host([theme~='wrap-cell-content']) [part~='cell']:not([part~='details-cell']) {
|
|
275
|
+
white-space: normal;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* Variant: row stripes */
|
|
279
|
+
[part~='odd-row'] {
|
|
280
|
+
--vaadin-grid-cell-background-color: var(--vaadin-grid-row-odd-background-color, var(--vaadin-background-color));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
:host([theme~='row-stripes']) [part~='odd-row'] {
|
|
284
|
+
--vaadin-grid-cell-background-color: var(
|
|
285
|
+
--vaadin-grid-row-odd-background-color,
|
|
286
|
+
color-mix(in srgb, var(--vaadin-text-color) 4%, var(--vaadin-background-color))
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* Raise highlighted rows above others */
|
|
291
|
+
|
|
292
|
+
[part~='row']:focus,
|
|
293
|
+
[part~='row']:focus-within,
|
|
294
|
+
[part~='body-row']:where([selected]) {
|
|
295
|
+
z-index: 3;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@container style(--vaadin-grid-row-odd-background-color) {
|
|
299
|
+
[part~='odd-row'] {
|
|
300
|
+
z-index: 1;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* Row hover */
|
|
305
|
+
@media (any-hover: hover) {
|
|
306
|
+
@container style(--vaadin-grid-row-hover-background-color) {
|
|
307
|
+
[part~='body-row']:hover {
|
|
308
|
+
z-index: 2;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
[part~='body-row']:hover [part~='cell']:where(:not([part~='details-cell'])) {
|
|
313
|
+
--_hover-background-color: var(--vaadin-grid-row-hover-background-color, transparent);
|
|
314
|
+
--_hover-background-image: linear-gradient(var(--_hover-background-color), var(--_hover-background-color));
|
|
315
|
+
}
|
|
248
316
|
}
|
|
249
317
|
|
|
250
318
|
[part~='details-cell'] {
|
|
251
319
|
position: absolute;
|
|
252
320
|
bottom: 0;
|
|
253
321
|
width: 100%;
|
|
322
|
+
margin-top: 0;
|
|
323
|
+
border-top: 0;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
[part~='last-row-cell'] + [part~='details-cell'] {
|
|
327
|
+
border-bottom: 0;
|
|
254
328
|
}
|
|
255
329
|
|
|
256
330
|
[part~='cell'] ::slotted(vaadin-grid-cell-content) {
|
|
257
331
|
display: block;
|
|
258
|
-
width: 100%;
|
|
259
|
-
box-sizing: border-box;
|
|
260
332
|
overflow: hidden;
|
|
261
333
|
text-overflow: ellipsis;
|
|
262
|
-
padding: var(--
|
|
334
|
+
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
|
|
335
|
+
flex: 1;
|
|
336
|
+
min-width: 0;
|
|
263
337
|
}
|
|
264
338
|
|
|
265
339
|
[frozen],
|
|
@@ -269,11 +343,12 @@ export const gridStyles = css`
|
|
|
269
343
|
}
|
|
270
344
|
|
|
271
345
|
/* Selected row */
|
|
272
|
-
[part~='row'][selected]
|
|
273
|
-
--
|
|
274
|
-
--vaadin-grid-row-selected-background-
|
|
275
|
-
|
|
346
|
+
[part~='body-row'][selected] {
|
|
347
|
+
--_selected-background-color: var(
|
|
348
|
+
--vaadin-grid-row-selected-background-color,
|
|
349
|
+
color-mix(in srgb, currentColor 8%, transparent)
|
|
276
350
|
);
|
|
351
|
+
--_selected-background-image: linear-gradient(var(--_selected-background-color), var(--_selected-background-color));
|
|
277
352
|
}
|
|
278
353
|
|
|
279
354
|
/* Empty state */
|
|
@@ -288,6 +363,7 @@ export const gridStyles = css`
|
|
|
288
363
|
inset: 0;
|
|
289
364
|
flex: 1;
|
|
290
365
|
overflow: hidden;
|
|
366
|
+
margin-top: calc(var(--_row-border-width) * -1);
|
|
291
367
|
}
|
|
292
368
|
|
|
293
369
|
#emptystaterow {
|
|
@@ -299,7 +375,14 @@ export const gridStyles = css`
|
|
|
299
375
|
display: block;
|
|
300
376
|
flex: 1;
|
|
301
377
|
overflow: auto;
|
|
302
|
-
padding: var(--
|
|
378
|
+
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
|
|
379
|
+
border-top: var(--_row-border-width) solid transparent;
|
|
380
|
+
outline: none;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
#emptystatecell:focus-visible {
|
|
384
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
385
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
303
386
|
}
|
|
304
387
|
|
|
305
388
|
/* Reordering styles */
|
|
@@ -316,7 +399,7 @@ export const gridStyles = css`
|
|
|
316
399
|
box-shadow:
|
|
317
400
|
0 0 0 1px hsla(0deg, 0%, 0%, 0.2),
|
|
318
401
|
0 8px 24px -2px hsla(0deg, 0%, 0%, 0.2);
|
|
319
|
-
padding: var(--
|
|
402
|
+
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container)) !important;
|
|
320
403
|
border-radius: 3px;
|
|
321
404
|
|
|
322
405
|
/* Prevent overflowing the grid in Firefox */
|
|
@@ -331,16 +414,26 @@ export const gridStyles = css`
|
|
|
331
414
|
|
|
332
415
|
:host([reordering]) [part~='cell'] {
|
|
333
416
|
/* TODO expose a custom property to control this */
|
|
334
|
-
--_reorder-
|
|
417
|
+
--_reorder-curtain-filter: brightness(0.9) contrast(1.1);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
:host([reordering]) [part~='cell']::after {
|
|
421
|
+
content: '';
|
|
422
|
+
position: absolute;
|
|
423
|
+
inset: 0;
|
|
424
|
+
z-index: 1;
|
|
425
|
+
-webkit-backdrop-filter: var(--_reorder-curtain-filter);
|
|
426
|
+
backdrop-filter: var(--_reorder-curtain-filter);
|
|
427
|
+
outline: 0;
|
|
335
428
|
}
|
|
336
429
|
|
|
337
430
|
:host([reordering]) [part~='cell'][reorder-status='allowed'] {
|
|
338
431
|
/* TODO expose a custom property to control this */
|
|
339
|
-
--_reorder-
|
|
432
|
+
--_reorder-curtain-filter: brightness(0.94) contrast(1.07);
|
|
340
433
|
}
|
|
341
434
|
|
|
342
435
|
:host([reordering]) [part~='cell'][reorder-status='dragging'] {
|
|
343
|
-
--_reorder-
|
|
436
|
+
--_reorder-curtain-filter: none;
|
|
344
437
|
}
|
|
345
438
|
|
|
346
439
|
/* Resizing styles */
|
|
@@ -394,13 +487,12 @@ export const gridStyles = css`
|
|
|
394
487
|
inset-inline: 0 auto;
|
|
395
488
|
}
|
|
396
489
|
|
|
397
|
-
[
|
|
398
|
-
|
|
490
|
+
[frozen-to-end] [part~='resize-handle'] {
|
|
491
|
+
translate: calc(var(--_column-border-width) * -1);
|
|
399
492
|
}
|
|
400
493
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
display: none;
|
|
494
|
+
[first-frozen-to-end] {
|
|
495
|
+
margin-inline-start: auto;
|
|
404
496
|
}
|
|
405
497
|
|
|
406
498
|
#scroller:is([column-resizing], [range-selecting]) {
|
|
@@ -408,6 +500,69 @@ export const gridStyles = css`
|
|
|
408
500
|
user-select: none;
|
|
409
501
|
}
|
|
410
502
|
|
|
503
|
+
/* Focus outline element, also used for d'n'd indication */
|
|
504
|
+
:is([part~='row'], [part~='cell'])::after {
|
|
505
|
+
position: absolute;
|
|
506
|
+
inset: calc(var(--_row-border-width) * -1) calc(var(--_column-border-width) * -1);
|
|
507
|
+
z-index: 3;
|
|
508
|
+
pointer-events: none;
|
|
509
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
510
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
[part~='first-column-cell']::after {
|
|
514
|
+
inset-inline-start: 0;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
[part~='last-column-cell']::after {
|
|
518
|
+
inset-inline-end: 0;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
#header [part~='row']:first-child::after,
|
|
522
|
+
[part~='first-header-row-cell']::after,
|
|
523
|
+
[part*='first-row']::after {
|
|
524
|
+
top: 0;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
table:has(#header > tr:not([hidden])) [part~='first-row-cell']::after {
|
|
528
|
+
top: calc(var(--_row-border-width) * -1);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
#footer [part~='row']:last-child::after,
|
|
532
|
+
[part~='last-footer-row-cell']::after,
|
|
533
|
+
[part~='last-row']::after,
|
|
534
|
+
[part~='last-row-cell']::after {
|
|
535
|
+
bottom: 0;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
#header [part~='row']:last-child::after,
|
|
539
|
+
table:has(#footer > tr:not([hidden])) [part*='last-row']::after {
|
|
540
|
+
bottom: calc(var(--_row-border-width) * -1);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
:host([navigating]) [part~='row']:focus,
|
|
544
|
+
:host([navigating]) [part~='cell']:focus {
|
|
545
|
+
outline: 0;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
[part~='row']::after {
|
|
549
|
+
transform: translateX(var(--_grid-horizontal-scroll-position));
|
|
550
|
+
inset-inline: 0;
|
|
551
|
+
bottom: 0;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
[part~='row']:focus-visible,
|
|
555
|
+
[part~='cell']:focus-visible {
|
|
556
|
+
outline: 0;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
[part~='row']:focus-visible::after,
|
|
560
|
+
[part~='cell']:focus-visible::after,
|
|
561
|
+
:host([navigating]) [part~='row']:focus::after,
|
|
562
|
+
:host([navigating]) [part~='cell']:focus::after {
|
|
563
|
+
content: '';
|
|
564
|
+
}
|
|
565
|
+
|
|
411
566
|
/* Drag'n'drop styles */
|
|
412
567
|
:host([dragover]) {
|
|
413
568
|
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
@@ -419,31 +574,32 @@ export const gridStyles = css`
|
|
|
419
574
|
}
|
|
420
575
|
|
|
421
576
|
[part~='row'][dragover]::after {
|
|
422
|
-
|
|
577
|
+
content: '';
|
|
423
578
|
}
|
|
424
579
|
|
|
425
580
|
[part~='row'][dragover='above']::after {
|
|
426
581
|
outline: 0;
|
|
427
582
|
border-top: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
[part~='row']:not([part*='first-row'])[dragover='above']::after,
|
|
586
|
+
table:has(#header > tr:not([hidden])) [part*='first-row'][dragover='above']::after {
|
|
428
587
|
top: calc(var(--vaadin-focus-ring-width) / -2);
|
|
429
588
|
}
|
|
430
589
|
|
|
431
590
|
[part~='row'][dragover='below']::after {
|
|
432
591
|
outline: 0;
|
|
433
592
|
border-bottom: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
434
|
-
bottom: calc(var(--vaadin-focus-ring-width) / -2);
|
|
435
593
|
}
|
|
436
594
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
:is([part~='row']:last-child, [part~='last-row'])::after {
|
|
442
|
-
bottom: 0;
|
|
595
|
+
[part~='row']:not([part*='last-row'])[dragover='below']::after,
|
|
596
|
+
table:has(#footer > tr:not([hidden])) [part*='last-row'][dragover='below']::after {
|
|
597
|
+
bottom: calc(var(--vaadin-focus-ring-width) / -2);
|
|
443
598
|
}
|
|
444
599
|
|
|
445
600
|
[part~='row'][dragstart] [part~='cell'] {
|
|
446
|
-
border-
|
|
601
|
+
border-block-color: transparent !important;
|
|
602
|
+
box-shadow: none;
|
|
447
603
|
}
|
|
448
604
|
|
|
449
605
|
[part~='row'][dragstart] [part~='cell'][last-column] {
|
|
@@ -499,4 +655,16 @@ export const gridStyles = css`
|
|
|
499
655
|
#sizer [part~='cell']::before {
|
|
500
656
|
content: '-';
|
|
501
657
|
}
|
|
658
|
+
|
|
659
|
+
@media (forced-colors: active) {
|
|
660
|
+
:host([overflow~='top']) [part~='last-header-row-cell'] {
|
|
661
|
+
border-bottom: var(--_row-border-width) solid;
|
|
662
|
+
margin-bottom: calc(var(--_row-border-width) * -1);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
:host([overflow~='bottom']) [part~='first-footer-row-cell'] {
|
|
666
|
+
border-top: var(--_row-border-width) solid;
|
|
667
|
+
margin-top: calc(var(--_row-border-width) * -1);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
502
670
|
`;
|