@vaadin/grid 24.0.0-alpha7 → 24.0.0-alpha8
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/package.json +10 -10
- package/src/all-imports.js +1 -1
- package/src/array-data-provider.js +1 -1
- package/src/lit/column-renderer-directives.d.ts +1 -1
- package/src/lit/column-renderer-directives.js +1 -1
- package/src/lit/renderer-directives.d.ts +1 -1
- package/src/lit/renderer-directives.js +1 -1
- package/src/vaadin-grid-a11y-mixin.js +1 -1
- package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
- package/src/vaadin-grid-active-item-mixin.js +1 -1
- package/src/vaadin-grid-array-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
- package/src/vaadin-grid-column-group.d.ts +1 -1
- package/src/vaadin-grid-column-group.js +17 -17
- package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-reordering-mixin.js +3 -5
- package/src/vaadin-grid-column-resizing-mixin.js +1 -1
- package/src/vaadin-grid-column.d.ts +1 -1
- package/src/vaadin-grid-column.js +5 -5
- package/src/vaadin-grid-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-grid-data-provider-mixin.js +1 -1
- package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
- package/src/vaadin-grid-drag-and-drop-mixin.js +2 -2
- package/src/vaadin-grid-dynamic-columns-mixin.js +2 -2
- package/src/vaadin-grid-event-context-mixin.d.ts +1 -1
- package/src/vaadin-grid-event-context-mixin.js +1 -1
- package/src/vaadin-grid-filter-column.d.ts +1 -1
- package/src/vaadin-grid-filter-column.js +1 -1
- package/src/vaadin-grid-filter-mixin.js +1 -1
- package/src/vaadin-grid-filter.d.ts +1 -1
- package/src/vaadin-grid-filter.js +1 -1
- package/src/vaadin-grid-helpers.js +1 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +3 -3
- package/src/vaadin-grid-row-details-mixin.d.ts +1 -1
- package/src/vaadin-grid-row-details-mixin.js +1 -1
- package/src/vaadin-grid-scroll-mixin.d.ts +1 -1
- package/src/vaadin-grid-scroll-mixin.js +5 -4
- package/src/vaadin-grid-selection-column.d.ts +1 -1
- package/src/vaadin-grid-selection-column.js +1 -1
- package/src/vaadin-grid-selection-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-mixin.js +1 -1
- package/src/vaadin-grid-sort-column.d.ts +1 -1
- package/src/vaadin-grid-sort-column.js +1 -1
- package/src/vaadin-grid-sort-mixin.d.ts +1 -1
- package/src/vaadin-grid-sort-mixin.js +1 -1
- package/src/vaadin-grid-sorter.d.ts +1 -1
- package/src/vaadin-grid-sorter.js +1 -1
- package/src/vaadin-grid-styles.js +1 -1
- package/src/vaadin-grid-styling-mixin.d.ts +1 -1
- package/src/vaadin-grid-styling-mixin.js +1 -1
- package/src/vaadin-grid-tree-column.d.ts +1 -1
- package/src/vaadin-grid-tree-column.js +1 -1
- package/src/vaadin-grid-tree-toggle.d.ts +1 -1
- package/src/vaadin-grid-tree-toggle.js +1 -1
- package/src/vaadin-grid.d.ts +1 -1
- package/src/vaadin-grid.js +22 -13
- package/theme/lumo/vaadin-grid-styles.js +5 -5
- package/theme/material/vaadin-grid-styles.js +1 -1
- package/web-types.json +576 -3
- package/web-types.lit.json +318 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { iterateChildren, updatePart } from './vaadin-grid-helpers.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { GridDefaultItem } from './vaadin-grid.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
|
package/src/vaadin-grid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-grid-column.js';
|
|
@@ -539,9 +539,15 @@ class Grid extends ElementMixin(
|
|
|
539
539
|
const cell = this.shadowRoot.activeElement;
|
|
540
540
|
const cellCoordinates = this.__getBodyCellCoordinates(cell);
|
|
541
541
|
|
|
542
|
+
const previousSize = virtualizer.size || 0;
|
|
542
543
|
virtualizer.size = effectiveSize;
|
|
543
|
-
|
|
544
|
-
|
|
544
|
+
|
|
545
|
+
// Request an update for the previous last row to have the "last" state removed
|
|
546
|
+
virtualizer.update(previousSize - 1, previousSize - 1);
|
|
547
|
+
if (effectiveSize < previousSize) {
|
|
548
|
+
// Size was decreased, so the new last row requires an explicit update
|
|
549
|
+
virtualizer.update(effectiveSize - 1, effectiveSize - 1);
|
|
550
|
+
}
|
|
545
551
|
|
|
546
552
|
// If the focused cell's parent row got hidden by the size change, focus the corresponding new cell
|
|
547
553
|
if (cellCoordinates && cell.parentElement.hidden) {
|
|
@@ -803,10 +809,7 @@ class Grid extends ElementMixin(
|
|
|
803
809
|
* @param {boolean} noNotify
|
|
804
810
|
* @protected
|
|
805
811
|
*/
|
|
806
|
-
|
|
807
|
-
_updateRow(row, columns, section, isColumnRow, noNotify) {
|
|
808
|
-
section ||= 'body';
|
|
809
|
-
|
|
812
|
+
_updateRow(row, columns, section = 'body', isColumnRow = false, noNotify = false) {
|
|
810
813
|
const contentsFragment = document.createDocumentFragment();
|
|
811
814
|
|
|
812
815
|
iterateChildren(row, (cell) => {
|
|
@@ -821,7 +824,9 @@ class Grid extends ElementMixin(
|
|
|
821
824
|
|
|
822
825
|
if (section === 'body') {
|
|
823
826
|
// Body
|
|
824
|
-
column._cells
|
|
827
|
+
if (!column._cells) {
|
|
828
|
+
column._cells = [];
|
|
829
|
+
}
|
|
825
830
|
cell = column._cells.find((cell) => cell._vacant);
|
|
826
831
|
if (!cell) {
|
|
827
832
|
cell = this._createCell('td', column);
|
|
@@ -832,7 +837,9 @@ class Grid extends ElementMixin(
|
|
|
832
837
|
|
|
833
838
|
if (index === cols.length - 1 && this.rowDetailsRenderer) {
|
|
834
839
|
// Add details cell as last cell to body rows
|
|
835
|
-
this._detailsCells
|
|
840
|
+
if (!this._detailsCells) {
|
|
841
|
+
this._detailsCells = [];
|
|
842
|
+
}
|
|
836
843
|
const detailsCell = this._detailsCells.find((cell) => cell._vacant) || this._createCell('td');
|
|
837
844
|
if (this._detailsCells.indexOf(detailsCell) === -1) {
|
|
838
845
|
this._detailsCells.push(detailsCell);
|
|
@@ -858,7 +865,9 @@ class Grid extends ElementMixin(
|
|
|
858
865
|
row.appendChild(cell);
|
|
859
866
|
column[`_${section}Cell`] = cell;
|
|
860
867
|
} else {
|
|
861
|
-
column._emptyCells
|
|
868
|
+
if (!column._emptyCells) {
|
|
869
|
+
column._emptyCells = [];
|
|
870
|
+
}
|
|
862
871
|
cell = column._emptyCells.find((cell) => cell._vacant) || this._createCell(tagName);
|
|
863
872
|
cell._column = column;
|
|
864
873
|
row.appendChild(cell);
|
|
@@ -970,7 +979,7 @@ class Grid extends ElementMixin(
|
|
|
970
979
|
updateRowStates(row, {
|
|
971
980
|
first: index === 0,
|
|
972
981
|
last: index === this._effectiveSize - 1,
|
|
973
|
-
odd: index % 2,
|
|
982
|
+
odd: index % 2 !== 0,
|
|
974
983
|
even: index % 2 === 0,
|
|
975
984
|
});
|
|
976
985
|
}
|
|
@@ -990,7 +999,7 @@ class Grid extends ElementMixin(
|
|
|
990
999
|
*/
|
|
991
1000
|
_renderColumnTree(columnTree) {
|
|
992
1001
|
iterateChildren(this.$.items, (row) => {
|
|
993
|
-
this._updateRow(row, columnTree[columnTree.length - 1],
|
|
1002
|
+
this._updateRow(row, columnTree[columnTree.length - 1], 'body', false, true);
|
|
994
1003
|
|
|
995
1004
|
const model = this.__getRowModel(row);
|
|
996
1005
|
this._updateRowOrderParts(row);
|
|
@@ -1049,7 +1058,7 @@ class Grid extends ElementMixin(
|
|
|
1049
1058
|
/** @private */
|
|
1050
1059
|
__updateFooterPositioning() {
|
|
1051
1060
|
// TODO: fixed in Firefox 99, remove when we can drop Firefox ESR 91 support
|
|
1052
|
-
if (this._firefox && parseFloat(navigator.userAgent.match(/Firefox\/(\d{2,3}.\d)/)[1]) < 99) {
|
|
1061
|
+
if (this._firefox && parseFloat(navigator.userAgent.match(/Firefox\/(\d{2,3}.\d)/u)[1]) < 99) {
|
|
1053
1062
|
// Sticky (or translated) footer in a flexbox host doesn't get included in
|
|
1054
1063
|
// the scroll height calculation on FF. This is a workaround for the issue.
|
|
1055
1064
|
this.$.items.style.paddingBottom = 0;
|
|
@@ -57,7 +57,7 @@ registerStyles(
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/* Hide first body row top border */
|
|
60
|
-
:host(:not([theme~='no-row-borders'])) [part~='row']
|
|
60
|
+
:host(:not([theme~='no-row-borders'])) [part~='first-row'] [part~='cell']:not([part~='details-cell']) {
|
|
61
61
|
border-top: 0;
|
|
62
62
|
min-height: calc(var(--lumo-size-m) - var(--_lumo-grid-border-width));
|
|
63
63
|
}
|
|
@@ -137,7 +137,7 @@ registerStyles(
|
|
|
137
137
|
margin-top: -1px;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
:host([all-rows-visible]) [part~='row'][
|
|
140
|
+
:host([all-rows-visible]) [part~='last-row'][dragover='below'] [part~='cell']::after {
|
|
141
141
|
height: 1px;
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -309,8 +309,8 @@ registerStyles(
|
|
|
309
309
|
|
|
310
310
|
/* Row stripes */
|
|
311
311
|
|
|
312
|
-
:host([theme~='row-stripes']) [part~='row']
|
|
313
|
-
:host([theme~='row-stripes']) [part~='row']
|
|
312
|
+
:host([theme~='row-stripes']) [part~='even-row'] [part~='body-cell'],
|
|
313
|
+
:host([theme~='row-stripes']) [part~='even-row'] [part~='details-cell'] {
|
|
314
314
|
background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
315
315
|
background-repeat: repeat-x;
|
|
316
316
|
}
|
|
@@ -342,7 +342,7 @@ registerStyles(
|
|
|
342
342
|
min-height: var(--lumo-size-s);
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
:host([theme~='compact']) [part~='row']
|
|
345
|
+
:host([theme~='compact']) [part~='first-row'] [part~='cell']:not([part~='details-cell']) {
|
|
346
346
|
min-height: calc(var(--lumo-size-s) - var(--_lumo-grid-border-width));
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -191,7 +191,7 @@ registerStyles(
|
|
|
191
191
|
margin-top: -1px;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
:host([all-rows-visible]) [part~='row'][
|
|
194
|
+
:host([all-rows-visible]) [part~='last-row'][dragover='below'] [part~='cell']::after {
|
|
195
195
|
height: 1px;
|
|
196
196
|
}
|
|
197
197
|
|