@vaadin/grid 25.0.0-alpha7 → 25.0.0-alpha9

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.
@@ -7,499 +7,504 @@ import '@vaadin/component-base/src/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const gridStyles = css`
10
- @layer base {
11
- @keyframes vaadin-grid-appear {
12
- to {
13
- opacity: 1;
14
- }
10
+ @keyframes vaadin-grid-appear {
11
+ to {
12
+ opacity: 1;
15
13
  }
14
+ }
16
15
 
17
- :host {
18
- display: flex;
19
- animation: 1ms vaadin-grid-appear;
20
- max-width: 100%;
21
- height: 400px;
22
- min-height: var(--_grid-min-height, 0);
23
- flex: 1 1 auto;
24
- align-self: stretch;
25
- position: relative;
26
- box-sizing: border-box;
27
- -webkit-tap-highlight-color: transparent;
28
- background: var(--vaadin-grid-background, var(--vaadin-background-color));
29
- border: var(--_border-width) solid var(--vaadin-grid-border-color, var(--vaadin-border-color));
30
- cursor: default;
31
- --_border-width: 0;
32
- --_row-border-width: var(--vaadin-grid-cell-border-width, 1px);
33
- --_column-border-width: var(--vaadin-grid-cell-border-width, 0);
34
- --_cell-padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
35
- --_reorder-background-image: none;
36
- --_selection-background-image: none;
37
- border-radius: var(--_border-radius);
38
- --_border-radius: 0;
39
- }
16
+ :host {
17
+ display: flex;
18
+ animation: 1ms vaadin-grid-appear;
19
+ max-width: 100%;
20
+ height: 400px;
21
+ min-height: var(--_grid-min-height, 0);
22
+ flex: 1 1 auto;
23
+ align-self: stretch;
24
+ position: relative;
25
+ box-sizing: border-box;
26
+ -webkit-tap-highlight-color: transparent;
27
+ background: var(--vaadin-grid-background, var(--vaadin-background-color));
28
+ border: var(--_border-width) solid var(--vaadin-grid-border-color, var(--vaadin-border-color));
29
+ cursor: default;
30
+ --_border-width: 0;
31
+ --_row-border-width: var(--vaadin-grid-cell-border-width, 1px);
32
+ --_column-border-width: var(--vaadin-grid-cell-border-width, 0);
33
+ --_cell-padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
34
+ --_selection-background-image: none;
35
+ border-radius: var(--_border-radius);
36
+ --_border-radius: 0;
37
+ }
40
38
 
41
- :host([hidden]),
42
- [hidden] {
43
- display: none !important;
44
- }
39
+ :host([hidden]),
40
+ [hidden] {
41
+ display: none !important;
42
+ }
45
43
 
46
- :host([disabled]) {
47
- pointer-events: none;
48
- opacity: 0.7;
49
- }
44
+ :host([disabled]) {
45
+ pointer-events: none;
46
+ opacity: 0.7;
47
+ }
50
48
 
51
- /* Variant: No outer border */
52
- :host(:not([theme~='no-border'])) {
53
- --_border-width: var(--vaadin-grid-border-width, 1px);
54
- --_border-radius: var(--vaadin-grid-border-radius, var(--vaadin-radius-l));
55
- }
49
+ /* Variant: No outer border */
50
+ :host(:not([theme~='no-border'])) {
51
+ --_border-width: var(--vaadin-grid-border-width, 1px);
52
+ --_border-radius: var(--vaadin-grid-border-radius, var(--vaadin-radius-l));
53
+ }
56
54
 
57
- :host([all-rows-visible]) {
58
- height: auto;
59
- align-self: flex-start;
60
- min-height: auto;
61
- flex-grow: 0;
62
- }
55
+ :host([all-rows-visible]) {
56
+ height: auto;
57
+ align-self: flex-start;
58
+ min-height: auto;
59
+ flex-grow: 0;
60
+ }
63
61
 
64
- #scroller {
65
- contain: layout;
66
- border-radius: calc(var(--_border-radius) - var(--_border-width));
67
- position: relative;
68
- display: flex;
69
- width: 100%;
70
- min-width: 0;
71
- min-height: 0;
72
- align-self: stretch;
73
- overflow: hidden;
74
- }
62
+ #scroller {
63
+ contain: layout;
64
+ border-radius: calc(var(--_border-radius) - var(--_border-width));
65
+ position: relative;
66
+ display: flex;
67
+ width: 100%;
68
+ min-width: 0;
69
+ min-height: 0;
70
+ align-self: stretch;
71
+ overflow: hidden;
72
+ }
75
73
 
76
- #items {
77
- flex-grow: 1;
78
- flex-shrink: 0;
79
- display: block;
80
- position: sticky;
81
- width: 100%;
82
- left: 0;
83
- min-height: 1px;
84
- }
74
+ #items {
75
+ flex-grow: 1;
76
+ flex-shrink: 0;
77
+ display: block;
78
+ position: sticky;
79
+ width: 100%;
80
+ left: 0;
81
+ min-height: 1px;
82
+ }
85
83
 
86
- #table {
87
- display: flex;
88
- flex-direction: column;
89
- width: 100%;
90
- overflow: auto;
91
- position: relative;
92
- border-radius: inherit;
93
- /* Workaround for a Chrome bug: new stacking context here prevents the scrollbar from getting hidden */
94
- z-index: 0;
95
- }
84
+ #table {
85
+ display: flex;
86
+ flex-direction: column;
87
+ width: 100%;
88
+ overflow: auto;
89
+ position: relative;
90
+ border-radius: inherit;
91
+ /* Workaround for a Chrome bug: new stacking context here prevents the scrollbar from getting hidden */
92
+ z-index: 0;
93
+ }
96
94
 
97
- [no-scrollbars]:is([safari], [firefox]) #table {
98
- overflow: hidden;
99
- }
95
+ [no-scrollbars]:is([safari], [firefox]) #table {
96
+ overflow: hidden;
97
+ }
100
98
 
101
- #header,
102
- #footer {
103
- display: block;
104
- position: sticky;
105
- left: 0;
106
- width: 100%;
107
- z-index: 1;
108
- }
99
+ #header,
100
+ #footer {
101
+ display: block;
102
+ position: sticky;
103
+ left: 0;
104
+ width: 100%;
105
+ z-index: 1;
106
+ }
109
107
 
110
- :host([dir='rtl']) #items,
111
- :host([dir='rtl']) #header,
112
- :host([dir='rtl']) #footer {
113
- left: auto;
114
- }
108
+ :host([dir='rtl']) #items,
109
+ :host([dir='rtl']) #header,
110
+ :host([dir='rtl']) #footer {
111
+ left: auto;
112
+ }
115
113
 
116
- #header {
117
- top: 0;
118
- }
114
+ #header {
115
+ top: 0;
116
+ }
119
117
 
120
- #footer {
121
- bottom: 0;
122
- }
118
+ #footer {
119
+ bottom: 0;
120
+ }
123
121
 
124
- th {
125
- text-align: inherit;
126
- }
122
+ th {
123
+ text-align: inherit;
124
+ }
127
125
 
128
- #header th,
129
- [part~='reorder-ghost'] {
130
- font-size: var(--vaadin-grid-header-font-size, 1em);
131
- font-weight: var(--vaadin-grid-header-font-weight, 500);
132
- color: var(--vaadin-grid-header-color, var(--vaadin-color));
133
- }
126
+ #header th,
127
+ [part~='reorder-ghost'] {
128
+ font-size: var(--vaadin-grid-header-font-size, 1em);
129
+ font-weight: var(--vaadin-grid-header-font-weight, 500);
130
+ color: var(--vaadin-grid-header-color, var(--vaadin-color));
131
+ }
134
132
 
135
- [part~='row'] {
136
- display: flex;
137
- width: 100%;
138
- box-sizing: border-box;
139
- margin: 0;
140
- position: relative;
141
- }
133
+ [part~='row'] {
134
+ display: flex;
135
+ width: 100%;
136
+ box-sizing: border-box;
137
+ margin: 0;
138
+ position: relative;
139
+ }
142
140
 
143
- [part~='row'][loading] [part~='body-cell'] ::slotted(vaadin-grid-cell-content) {
144
- visibility: hidden;
145
- }
141
+ [part~='row'][loading] [part~='body-cell'] ::slotted(vaadin-grid-cell-content) {
142
+ visibility: hidden;
143
+ }
146
144
 
147
- [column-rendering='lazy'] [part~='body-cell']:not([frozen]):not([frozen-to-end]) {
148
- transform: translateX(var(--_grid-lazy-columns-start));
149
- }
145
+ [column-rendering='lazy'] [part~='body-cell']:not([frozen]):not([frozen-to-end]) {
146
+ transform: translateX(var(--_grid-lazy-columns-start));
147
+ }
150
148
 
151
- #items [part~='row']:empty {
152
- height: 100%;
153
- }
149
+ #items [part~='row']:empty {
150
+ height: 100%;
151
+ }
154
152
 
155
- [part~='cell'] {
156
- box-sizing: border-box;
157
- background:
158
- var(--_reorder-background-image), var(--_selection-background-image),
159
- var(--vaadin-grid-cell-background, var(--vaadin-background-color));
160
- padding: 0;
161
- }
153
+ [part~='cell'] {
154
+ padding: 0;
155
+ box-sizing: border-box;
156
+ }
162
157
 
163
- [part~='cell']:not([part~='details-cell']) {
164
- flex-shrink: 0;
165
- flex-grow: 1;
166
- box-sizing: border-box;
167
- display: flex;
168
- width: 100%;
169
- position: relative;
170
- align-items: center;
171
- white-space: nowrap;
172
- }
158
+ [part~='row'],
159
+ [part~='cell'] {
160
+ --_hover-background-image: var(--vaadin-grid-cell-background-hover, none);
161
+ background:
162
+ var(--_hover-background-image), var(--_selection-background-image),
163
+ var(--vaadin-grid-cell-background, var(--vaadin-background-color));
164
+ }
173
165
 
174
- :focus-visible,
175
- [part~='row']::after {
176
- outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
177
- outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
178
- }
166
+ [part~='cell']:not([part~='details-cell']) {
167
+ flex-shrink: 0;
168
+ flex-grow: 1;
169
+ box-sizing: border-box;
170
+ display: flex;
171
+ width: 100%;
172
+ position: relative;
173
+ align-items: center;
174
+ white-space: nowrap;
175
+ }
179
176
 
180
- [part~='row']:focus-visible {
181
- z-index: 1;
182
- }
177
+ :focus-visible,
178
+ [part~='row']::after {
179
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
180
+ outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
181
+ }
183
182
 
184
- /* Used for focus outline and drag'n'drop target indication */
185
- [part~='row']::after {
186
- content: '';
187
- position: absolute;
188
- inset: calc(var(--_row-border-width) * -1) 0;
189
- z-index: 3;
190
- transform: translateX(var(--_grid-horizontal-scroll-position));
191
- pointer-events: none;
192
- visibility: hidden;
193
- }
183
+ [part~='row']:focus-visible {
184
+ z-index: 1;
185
+ }
194
186
 
195
- [part~='row']:focus-visible::after {
196
- visibility: visible;
197
- }
187
+ /* Used for focus outline and drag'n'drop target indication */
188
+ [part~='row']::after {
189
+ content: '';
190
+ position: absolute;
191
+ inset: calc(var(--_row-border-width) * -1) 0;
192
+ z-index: 3;
193
+ transform: translateX(var(--_grid-horizontal-scroll-position));
194
+ pointer-events: none;
195
+ visibility: hidden;
196
+ }
198
197
 
199
- /* Variant: wrap cell contents */
198
+ [part~='row']:focus-visible::after {
199
+ visibility: visible;
200
+ }
200
201
 
201
- :host([theme~='wrap-cell-content']) [part~='cell']:not([part~='details-cell']) {
202
- white-space: normal;
203
- }
202
+ /* Variant: wrap cell contents */
204
203
 
205
- /* Variant: row & column borders */
204
+ :host([theme~='wrap-cell-content']) [part~='cell']:not([part~='details-cell']) {
205
+ white-space: normal;
206
+ }
206
207
 
207
- :host([theme~='no-row-borders']) {
208
- --_row-border-width: 0;
209
- }
208
+ /* Variant: row & column borders */
210
209
 
211
- :host([theme~='column-borders']) {
212
- --_column-border-width: var(--vaadin-grid-cell-border-width, 1px);
213
- }
210
+ :host([theme~='no-row-borders']) {
211
+ --_row-border-width: 0;
212
+ }
214
213
 
215
- [part~='cell']:not([part~='last-column-cell'], [part~='details-cell']) {
216
- border-inline-end: var(--_column-border-width, 0) solid
217
- var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
218
- }
214
+ :host([theme~='column-borders']) {
215
+ --_column-border-width: var(--vaadin-grid-cell-border-width, 1px);
216
+ }
219
217
 
220
- [part~='cell']:where(:not([part~='details-cell'], [part~='first-row-cell'])) {
221
- border-top: var(--_row-border-width) solid var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
222
- }
218
+ [part~='cell']:not([part~='last-column-cell'], [part~='details-cell']) {
219
+ border-inline-end: var(--_column-border-width, 0) solid
220
+ var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
221
+ }
223
222
 
224
- [part~='first-header-row-cell'] {
225
- border-top: 0;
226
- }
223
+ [part~='cell']:where(:not([part~='details-cell'], [part~='first-row-cell'])) {
224
+ border-top: var(--_row-border-width) solid var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
225
+ }
227
226
 
228
- [part~='last-header-row-cell'] {
229
- border-bottom: var(--_row-border-width, 1px) solid
230
- var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
231
- }
227
+ [part~='first-header-row-cell'] {
228
+ border-top: 0;
229
+ }
232
230
 
233
- [part~='first-footer-row-cell'] {
234
- border-top: var(--_row-border-width, 1px) solid var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
235
- }
231
+ [part~='last-header-row-cell'] {
232
+ border-bottom: var(--_row-border-width, 1px) solid var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
233
+ }
236
234
 
237
- /* Variant: row stripes */
238
- :host([theme~='row-stripes']) [part~='odd-row'],
239
- :host([theme~='row-stripes']) [part~='odd-row'] [part~='body-cell'],
240
- :host([theme~='row-stripes']) [part~='odd-row'] [part~='details-cell'] {
241
- background:
242
- var(--_reorder-background-image), var(--_selection-background-image),
243
- var(--vaadin-grid-alternate-cell-background, var(--vaadin-background-container));
244
- }
235
+ [part~='first-footer-row-cell'] {
236
+ border-top: var(--_row-border-width, 1px) solid var(--vaadin-grid-cell-border-color, var(--vaadin-border-color));
237
+ }
245
238
 
246
- [part~='cell'] > [tabindex] {
247
- display: flex;
248
- align-items: inherit;
249
- width: 100%;
250
- }
239
+ /* Variant: row stripes */
240
+ :host([theme~='row-stripes']) [part~='odd-row'],
241
+ :host([theme~='row-stripes']) [part~='odd-row'] [part~='cell'] {
242
+ --vaadin-grid-cell-background: var(
243
+ --vaadin-grid-odd-row-cell-background,
244
+ linear-gradient(var(--vaadin-background-container), var(--vaadin-background-container))
245
+ );
246
+ }
251
247
 
252
- [part~='details-cell'] {
253
- position: absolute;
254
- bottom: 0;
255
- width: 100%;
256
- }
248
+ [part~='details-cell'] {
249
+ position: absolute;
250
+ bottom: 0;
251
+ width: 100%;
252
+ }
257
253
 
258
- [part~='cell'] ::slotted(vaadin-grid-cell-content) {
259
- display: block;
260
- width: 100%;
261
- box-sizing: border-box;
262
- overflow: hidden;
263
- text-overflow: ellipsis;
264
- padding: var(--_cell-padding);
265
- }
254
+ [part~='cell'] ::slotted(vaadin-grid-cell-content) {
255
+ display: block;
256
+ overflow: hidden;
257
+ text-overflow: ellipsis;
258
+ padding: var(--_cell-padding);
259
+ flex: 1;
260
+ min-width: 0;
261
+ }
266
262
 
267
- [frozen],
268
- [frozen-to-end] {
269
- z-index: 2;
270
- will-change: transform;
271
- }
263
+ [frozen],
264
+ [frozen-to-end] {
265
+ z-index: 2;
266
+ will-change: transform;
267
+ }
272
268
 
273
- /* Selected row */
274
- [part~='row'][selected] [part~='body-cell']:not([part~='details-cell']) {
275
- --_selection-background-image: var(
276
- --vaadin-grid-row-selected-background-image,
277
- linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08))
278
- );
279
- }
269
+ /* Selected row */
270
+ [part~='row'][selected] [part~='body-cell']:not([part~='details-cell']) {
271
+ --_color: color-mix(in srgb, currentColor 8%, transparent);
272
+ --_selection-background-image: var(
273
+ --vaadin-grid-row-selected-background,
274
+ linear-gradient(var(--_color), var(--_color))
275
+ );
276
+ }
280
277
 
281
- /* Empty state */
282
- #scroller:not([empty-state]) #emptystatebody,
283
- #scroller[empty-state] #items {
284
- display: none;
285
- }
278
+ /* Empty state */
279
+ #scroller:not([empty-state]) #emptystatebody,
280
+ #scroller[empty-state] #items {
281
+ display: none;
282
+ }
286
283
 
287
- #emptystatebody {
288
- display: flex;
289
- position: sticky;
290
- inset: 0;
291
- flex: 1;
292
- overflow: hidden;
293
- }
284
+ #emptystatebody {
285
+ display: flex;
286
+ position: sticky;
287
+ inset: 0;
288
+ flex: 1;
289
+ overflow: hidden;
290
+ }
294
291
 
295
- #emptystaterow {
296
- display: flex;
297
- flex: 1;
298
- }
292
+ #emptystaterow {
293
+ display: flex;
294
+ flex: 1;
295
+ }
299
296
 
300
- #emptystatecell {
301
- display: block;
302
- flex: 1;
303
- overflow: auto;
304
- padding: var(--_cell-padding);
305
- }
297
+ #emptystatecell {
298
+ display: block;
299
+ flex: 1;
300
+ overflow: auto;
301
+ padding: var(--_cell-padding);
302
+ }
306
303
 
307
- /* Reordering styles */
308
- :host([reordering]) [part~='cell'] ::slotted(vaadin-grid-cell-content),
309
- :host([reordering]) [part~='resize-handle'],
310
- #scroller[no-content-pointer-events] [part~='cell'] ::slotted(vaadin-grid-cell-content) {
311
- pointer-events: none;
312
- }
304
+ /* Reordering styles */
305
+ :host([reordering]) [part~='cell'] ::slotted(vaadin-grid-cell-content),
306
+ :host([reordering]) [part~='resize-handle'],
307
+ #scroller[no-content-pointer-events] [part~='cell'] ::slotted(vaadin-grid-cell-content) {
308
+ pointer-events: none;
309
+ }
313
310
 
314
- [part~='reorder-ghost'] {
315
- visibility: hidden;
316
- position: fixed;
317
- pointer-events: none;
318
- box-shadow:
319
- 0 0 0 1px hsla(0deg, 0%, 0%, 0.2),
320
- 0 8px 24px -2px hsla(0deg, 0%, 0%, 0.2);
321
- padding: var(--_cell-padding) !important;
322
- border-radius: 3px;
323
-
324
- /* Prevent overflowing the grid in Firefox */
325
- top: 0;
326
- inset-inline-start: 0;
327
- }
311
+ [part~='reorder-ghost'] {
312
+ visibility: hidden;
313
+ position: fixed;
314
+ pointer-events: none;
315
+ box-shadow:
316
+ 0 0 0 1px hsla(0deg, 0%, 0%, 0.2),
317
+ 0 8px 24px -2px hsla(0deg, 0%, 0%, 0.2);
318
+ padding: var(--_cell-padding) !important;
319
+ border-radius: 3px;
320
+
321
+ /* Prevent overflowing the grid in Firefox */
322
+ top: 0;
323
+ inset-inline-start: 0;
324
+ }
328
325
 
329
- :host([reordering]) {
330
- -webkit-user-select: none;
331
- user-select: none;
332
- }
326
+ :host([reordering]) {
327
+ -webkit-user-select: none;
328
+ user-select: none;
329
+ }
333
330
 
334
- :host([reordering]) [part~='cell'] {
335
- /* TODO expose a custom property to control this */
336
- --_reorder-background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1));
337
- }
331
+ :host([reordering]) [part~='cell'] {
332
+ /* TODO expose a custom property to control this */
333
+ --_reorder-curtain-filter: brightness(0.9) contrast(1.1);
334
+ }
338
335
 
339
- :host([reordering]) [part~='cell'][reorder-status='allowed'] {
340
- /* TODO expose a custom property to control this */
341
- --_reorder-background-image: linear-gradient(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.04));
342
- }
336
+ :host([reordering]) [part~='cell']::after {
337
+ content: '';
338
+ position: absolute;
339
+ inset: 0;
340
+ z-index: 1;
341
+ -webkit-backdrop-filter: var(--_reorder-curtain-filter);
342
+ backdrop-filter: var(--_reorder-curtain-filter);
343
+ }
343
344
 
344
- :host([reordering]) [part~='cell'][reorder-status='dragging'] {
345
- --_reorder-background-image: none;
346
- }
345
+ :host([reordering]) [part~='cell'][reorder-status='allowed'] {
346
+ /* TODO expose a custom property to control this */
347
+ --_reorder-curtain-filter: brightness(0.94) contrast(1.07);
348
+ }
347
349
 
348
- /* Resizing styles */
349
- [part~='resize-handle'] {
350
- position: absolute;
351
- top: 0;
352
- inset-inline-end: 0;
353
- height: 100%;
354
- cursor: col-resize;
355
- z-index: 1;
356
- opacity: 0;
357
- width: var(--vaadin-focus-ring-width);
358
- background: var(--vaadin-grid-column-resize-handle-color, var(--vaadin-focus-ring-color));
359
- transition: opacity 0.2s;
360
- translate: var(--_column-border-width);
361
- }
350
+ :host([reordering]) [part~='cell'][reorder-status='dragging'] {
351
+ --_reorder-curtain-filter: none;
352
+ }
362
353
 
363
- [part~='last-column-cell'] [part~='resize-handle'] {
364
- translate: 0;
365
- }
354
+ /* Resizing styles */
355
+ [part~='resize-handle'] {
356
+ position: absolute;
357
+ top: 0;
358
+ inset-inline-end: 0;
359
+ height: 100%;
360
+ cursor: col-resize;
361
+ z-index: 1;
362
+ opacity: 0;
363
+ width: var(--vaadin-focus-ring-width);
364
+ background: var(--vaadin-grid-column-resize-handle-color, var(--vaadin-focus-ring-color));
365
+ transition: opacity 0.2s;
366
+ translate: var(--_column-border-width);
367
+ }
366
368
 
367
- :host(:not([reordering])) *:not([column-resizing]) [part='resize-handle']:hover,
368
- [part='resize-handle']:active {
369
- opacity: 1;
370
- transition-delay: 0.15s;
371
- }
369
+ [part~='last-column-cell'] [part~='resize-handle'] {
370
+ translate: 0;
371
+ }
372
372
 
373
- [part~='resize-handle']::before {
374
- position: absolute;
375
- content: '';
376
- height: 100%;
377
- width: 16px;
378
- translate: calc(-50% + var(--vaadin-focus-ring-width) / 2);
379
- }
373
+ :host(:not([reordering])) *:not([column-resizing]) [part='resize-handle']:hover,
374
+ [part='resize-handle']:active {
375
+ opacity: 1;
376
+ transition-delay: 0.15s;
377
+ }
380
378
 
381
- :host([dir='rtl']) [part~='resize-handle']::before {
382
- translate: calc(50% - var(--vaadin-focus-ring-width) / 2);
383
- }
379
+ [part~='resize-handle']::before {
380
+ position: absolute;
381
+ content: '';
382
+ height: 100%;
383
+ width: 16px;
384
+ translate: calc(-50% + var(--vaadin-focus-ring-width) / 2);
385
+ }
384
386
 
385
- [first-frozen-to-end] [part~='resize-handle']::before,
386
- :is([last-column], [last-frozen]) [part~='resize-handle']::before {
387
- width: 8px;
388
- translate: 0;
389
- }
387
+ :host([dir='rtl']) [part~='resize-handle']::before {
388
+ translate: calc(50% - var(--vaadin-focus-ring-width) / 2);
389
+ }
390
390
 
391
- :is([last-column], [last-frozen]) [part~='resize-handle']::before {
392
- inset-inline-end: 0;
393
- }
391
+ [first-frozen-to-end] [part~='resize-handle']::before,
392
+ :is([last-column], [last-frozen]) [part~='resize-handle']::before {
393
+ width: 8px;
394
+ translate: 0;
395
+ }
394
396
 
395
- [frozen-to-end] :is([part~='resize-handle'], [part~='resize-handle']::before) {
396
- inset-inline: 0 auto;
397
- }
397
+ :is([last-column], [last-frozen]) [part~='resize-handle']::before {
398
+ inset-inline-end: 0;
399
+ }
398
400
 
399
- [first-frozen-to-end] {
400
- margin-inline-start: auto;
401
- }
401
+ [frozen-to-end] :is([part~='resize-handle'], [part~='resize-handle']::before) {
402
+ inset-inline: 0 auto;
403
+ }
402
404
 
403
- /* Hide resize handle if scrolled to end */
404
- :host(:not([overflow~='end'])) [first-frozen-to-end] [part~='resize-handle'] {
405
- display: none;
406
- }
405
+ [first-frozen-to-end] {
406
+ margin-inline-start: auto;
407
+ }
407
408
 
408
- #scroller:is([column-resizing], [range-selecting]) {
409
- -webkit-user-select: none;
410
- user-select: none;
411
- }
409
+ /* Hide resize handle if scrolled to end */
410
+ :host(:not([overflow~='end'])) [first-frozen-to-end] [part~='resize-handle'] {
411
+ display: none;
412
+ }
412
413
 
413
- /* Drag'n'drop styles */
414
- :host([dragover]) {
415
- outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
416
- outline-offset: calc(var(--_border-width) * -1);
417
- }
414
+ #scroller:is([column-resizing], [range-selecting]) {
415
+ -webkit-user-select: none;
416
+ user-select: none;
417
+ }
418
418
 
419
- [part~='row'][dragover] {
420
- z-index: 100 !important;
421
- }
419
+ /* Drag'n'drop styles */
420
+ :host([dragover]) {
421
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
422
+ outline-offset: calc(var(--_border-width) * -1);
423
+ }
422
424
 
423
- [part~='row'][dragover]::after {
424
- visibility: visible;
425
- }
425
+ [part~='row'][dragover] {
426
+ z-index: 100 !important;
427
+ }
426
428
 
427
- [part~='row'][dragover='above']::after {
428
- outline: 0;
429
- border-top: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
430
- top: calc(var(--vaadin-focus-ring-width) / -2);
431
- }
429
+ [part~='row'][dragover]::after {
430
+ visibility: visible;
431
+ }
432
432
 
433
- [part~='row'][dragover='below']::after {
434
- outline: 0;
435
- border-bottom: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
436
- bottom: calc(var(--vaadin-focus-ring-width) / -2);
437
- }
433
+ [part~='row'][dragover='above']::after {
434
+ outline: 0;
435
+ border-top: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
436
+ top: calc(var(--vaadin-focus-ring-width) / -2);
437
+ }
438
438
 
439
- :is([part~='row']:first-child, [part~='first-row'])::after {
440
- top: 0;
441
- }
439
+ [part~='row'][dragover='below']::after {
440
+ outline: 0;
441
+ border-bottom: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
442
+ bottom: calc(var(--vaadin-focus-ring-width) / -2);
443
+ }
442
444
 
443
- :is([part~='row']:last-child, [part~='last-row'])::after {
444
- bottom: 0;
445
- }
445
+ :is([part~='row']:first-child, [part~='first-row'])::after {
446
+ top: 0;
447
+ }
446
448
 
447
- [part~='row'][dragstart] [part~='cell'] {
448
- border-top: 0 !important;
449
- }
449
+ :is([part~='row']:last-child, [part~='last-row'])::after {
450
+ bottom: 0;
451
+ }
450
452
 
451
- [part~='row'][dragstart] [part~='cell'][last-column] {
452
- border-radius: 0 3px 3px 0;
453
- }
453
+ [part~='row'][dragstart] [part~='cell'] {
454
+ border-top: 0 !important;
455
+ }
454
456
 
455
- [part~='row'][dragstart] [part~='cell'][first-column] {
456
- border-radius: 3px 0 0 3px;
457
- }
457
+ [part~='row'][dragstart] [part~='cell'][last-column] {
458
+ border-radius: 0 3px 3px 0;
459
+ }
458
460
 
459
- /* Indicates the number of dragged rows */
460
- /* TODO export custom properties to control styles */
461
- #scroller [part~='row'][dragstart]:not([dragstart=''])::before {
462
- position: absolute;
463
- left: var(--_grid-drag-start-x);
464
- top: var(--_grid-drag-start-y);
465
- z-index: 100;
466
- content: attr(dragstart);
467
- box-sizing: border-box;
468
- padding: 0.3em;
469
- color: white;
470
- background-color: red;
471
- border-radius: 1em;
472
- font-size: 0.75rem;
473
- line-height: 1;
474
- font-weight: 500;
475
- min-width: 1.6em;
476
- text-align: center;
477
- }
461
+ [part~='row'][dragstart] [part~='cell'][first-column] {
462
+ border-radius: 3px 0 0 3px;
463
+ }
478
464
 
479
- /* Sizer styles */
480
- #sizer {
481
- display: flex;
482
- visibility: hidden;
483
- }
465
+ /* Indicates the number of dragged rows */
466
+ /* TODO export custom properties to control styles */
467
+ #scroller [part~='row'][dragstart]:not([dragstart=''])::before {
468
+ position: absolute;
469
+ left: var(--_grid-drag-start-x);
470
+ top: var(--_grid-drag-start-y);
471
+ z-index: 100;
472
+ content: attr(dragstart);
473
+ box-sizing: border-box;
474
+ padding: 0.3em;
475
+ color: white;
476
+ background-color: red;
477
+ border-radius: 1em;
478
+ font-size: 0.75rem;
479
+ line-height: 1;
480
+ font-weight: 500;
481
+ min-width: 1.6em;
482
+ text-align: center;
483
+ }
484
484
 
485
- #sizer [part~='details-cell'],
486
- #sizer [part~='cell'] ::slotted(vaadin-grid-cell-content) {
487
- display: none !important;
488
- }
485
+ /* Sizer styles */
486
+ #sizer {
487
+ display: flex;
488
+ visibility: hidden;
489
+ }
489
490
 
490
- #sizer [part~='cell'] {
491
- display: block;
492
- flex-shrink: 0;
493
- line-height: 0;
494
- height: 0 !important;
495
- min-height: 0 !important;
496
- max-height: 0 !important;
497
- padding: 0 !important;
498
- border: none !important;
499
- }
491
+ #sizer [part~='details-cell'],
492
+ #sizer [part~='cell'] ::slotted(vaadin-grid-cell-content) {
493
+ display: none !important;
494
+ }
500
495
 
501
- #sizer [part~='cell']::before {
502
- content: '-';
503
- }
496
+ #sizer [part~='cell'] {
497
+ display: block;
498
+ flex-shrink: 0;
499
+ line-height: 0;
500
+ height: 0 !important;
501
+ min-height: 0 !important;
502
+ max-height: 0 !important;
503
+ padding: 0 !important;
504
+ border: none !important;
505
+ }
506
+
507
+ #sizer [part~='cell']::before {
508
+ content: '-';
504
509
  }
505
510
  `;