@vaadin/grid 25.2.0-alpha9 → 25.2.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/custom-elements.json +53 -19
- package/package.json +12 -12
- package/src/styles/vaadin-grid-filter-base-styles.js +4 -0
- package/src/styles/vaadin-grid-sorter-base-styles.js +4 -0
- package/src/styles/vaadin-grid-tree-toggle-base-styles.js +4 -0
- package/src/vaadin-grid-a11y-mixin.js +2 -5
- package/src/vaadin-grid-active-item-mixin.js +0 -15
- package/src/vaadin-grid-array-data-provider-mixin.js +0 -3
- package/src/vaadin-grid-column-auto-width-mixin.js +1 -4
- package/src/vaadin-grid-column-group-mixin.js +0 -3
- package/src/vaadin-grid-column-group.d.ts +3 -1
- package/src/vaadin-grid-column-group.js +0 -1
- package/src/vaadin-grid-column-mixin.js +2 -10
- package/src/vaadin-grid-column-reordering-mixin.js +3 -14
- package/src/vaadin-grid-column-resizing-mixin.js +0 -11
- package/src/vaadin-grid-column.d.ts +5 -2
- package/src/vaadin-grid-column.js +0 -1
- package/src/vaadin-grid-data-provider-mixin.js +0 -15
- package/src/vaadin-grid-drag-and-drop-mixin.js +1 -44
- package/src/vaadin-grid-dynamic-columns-mixin.js +1 -4
- package/src/vaadin-grid-event-context-mixin.js +0 -3
- package/src/vaadin-grid-filter-column-mixin.js +0 -3
- package/src/vaadin-grid-filter-column.d.ts +3 -1
- package/src/vaadin-grid-filter-column.js +0 -1
- package/src/vaadin-grid-filter-element-mixin.js +1 -3
- package/src/vaadin-grid-filter-mixin.js +0 -3
- package/src/vaadin-grid-filter.js +0 -1
- package/src/vaadin-grid-helpers.js +1 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +2 -13
- package/src/vaadin-grid-mixin.js +4 -26
- package/src/vaadin-grid-resize-mixin.js +0 -2
- package/src/vaadin-grid-row-details-mixin.js +0 -3
- package/src/vaadin-grid-scroll-mixin.js +0 -3
- package/src/vaadin-grid-selection-column-base-mixin.js +0 -2
- package/src/vaadin-grid-selection-column-mixin.js +0 -4
- package/src/vaadin-grid-selection-column.d.ts +3 -1
- package/src/vaadin-grid-selection-column.js +0 -1
- package/src/vaadin-grid-selection-mixin.js +10 -20
- package/src/vaadin-grid-sort-column-mixin.js +0 -3
- package/src/vaadin-grid-sort-column.d.ts +3 -1
- package/src/vaadin-grid-sort-column.js +0 -1
- package/src/vaadin-grid-sort-mixin.js +0 -3
- package/src/vaadin-grid-sorter-mixin.js +0 -2
- package/src/vaadin-grid-sorter.js +0 -3
- package/src/vaadin-grid-styling-mixin.d.ts +1 -1
- package/src/vaadin-grid-styling-mixin.js +0 -3
- package/src/vaadin-grid-tree-column-mixin.js +0 -3
- package/src/vaadin-grid-tree-column.d.ts +3 -1
- package/src/vaadin-grid-tree-column.js +0 -1
- package/src/vaadin-grid-tree-toggle-mixin.js +0 -3
- package/src/vaadin-grid-tree-toggle.js +0 -3
- package/src/vaadin-grid.d.ts +1 -1
- package/src/vaadin-grid.js +1 -3
- package/web-types.json +397 -769
- package/web-types.lit.json +247 -233
|
@@ -20,9 +20,6 @@ function isDetailsCell(element) {
|
|
|
20
20
|
return element.matches('[part~="details-cell"]');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* @polymerMixin
|
|
25
|
-
*/
|
|
26
23
|
export const KeyboardNavigationMixin = (superClass) =>
|
|
27
24
|
class KeyboardNavigationMixin extends superClass {
|
|
28
25
|
static get properties() {
|
|
@@ -103,7 +100,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
103
100
|
['_itemsFocusable', '_footerFocusable', '_headerFocusable'].forEach((prop) => {
|
|
104
101
|
const focusable = this[prop];
|
|
105
102
|
if (value) {
|
|
106
|
-
const parent = focusable
|
|
103
|
+
const parent = focusable?.parentElement;
|
|
107
104
|
if (isCell(focusable)) {
|
|
108
105
|
// Cell itself focusable (default)
|
|
109
106
|
this[prop] = parent;
|
|
@@ -428,7 +425,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
428
425
|
const rowGroup = row.parentNode;
|
|
429
426
|
// Body rows have index property, otherwise DOM child index of the row is used.
|
|
430
427
|
if (rowGroup === this.$.items) {
|
|
431
|
-
return bodyFallbackIndex
|
|
428
|
+
return bodyFallbackIndex ?? row.index;
|
|
432
429
|
}
|
|
433
430
|
return [...rowGroup.children].indexOf(row);
|
|
434
431
|
}
|
|
@@ -1097,12 +1094,4 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
1097
1094
|
}
|
|
1098
1095
|
return null;
|
|
1099
1096
|
}
|
|
1100
|
-
|
|
1101
|
-
/**
|
|
1102
|
-
* Fired when a cell is focused with click or keyboard navigation.
|
|
1103
|
-
*
|
|
1104
|
-
* Use context property of @see {@link GridCellFocusEvent} to get detail information about the event.
|
|
1105
|
-
*
|
|
1106
|
-
* @event cell-focus
|
|
1107
|
-
*/
|
|
1108
1097
|
};
|
package/src/vaadin-grid-mixin.js
CHANGED
|
@@ -42,25 +42,6 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* A mixin providing common grid functionality.
|
|
45
|
-
*
|
|
46
|
-
* @polymerMixin
|
|
47
|
-
* @mixes A11yMixin
|
|
48
|
-
* @mixes ActiveItemMixin
|
|
49
|
-
* @mixes ArrayDataProviderMixin
|
|
50
|
-
* @mixes ColumnResizingMixin
|
|
51
|
-
* @mixes DataProviderMixin
|
|
52
|
-
* @mixes DynamicColumnsMixin
|
|
53
|
-
* @mixes FilterMixin
|
|
54
|
-
* @mixes RowDetailsMixin
|
|
55
|
-
* @mixes ScrollMixin
|
|
56
|
-
* @mixes SelectionMixin
|
|
57
|
-
* @mixes SortMixin
|
|
58
|
-
* @mixes KeyboardNavigationMixin
|
|
59
|
-
* @mixes ColumnReorderingMixin
|
|
60
|
-
* @mixes EventContextMixin
|
|
61
|
-
* @mixes StylingMixin
|
|
62
|
-
* @mixes DragAndDropMixin
|
|
63
|
-
* @mixes ResizeMixin
|
|
64
45
|
*/
|
|
65
46
|
export const GridMixin = (superClass) =>
|
|
66
47
|
class extends ColumnAutoWidthMixin(
|
|
@@ -417,7 +398,7 @@ export const GridMixin = (superClass) =>
|
|
|
417
398
|
const slot = document.createElement('slot');
|
|
418
399
|
slot.setAttribute('name', slotName);
|
|
419
400
|
|
|
420
|
-
if (column
|
|
401
|
+
if (column?._focusButtonMode) {
|
|
421
402
|
const div = document.createElement('div');
|
|
422
403
|
div.setAttribute('role', 'button');
|
|
423
404
|
div.setAttribute('tabindex', '-1');
|
|
@@ -871,7 +852,7 @@ export const GridMixin = (superClass) =>
|
|
|
871
852
|
_showTooltip(event) {
|
|
872
853
|
// Check if there is a slotted vaadin-tooltip element.
|
|
873
854
|
const tooltip = this._tooltipController.node;
|
|
874
|
-
if (tooltip
|
|
855
|
+
if (tooltip?.isConnected) {
|
|
875
856
|
const target = event.target;
|
|
876
857
|
|
|
877
858
|
if (!this.__isCellFullyVisible(target)) {
|
|
@@ -882,7 +863,7 @@ export const GridMixin = (superClass) =>
|
|
|
882
863
|
this._tooltipController.setContext(this.getEventContext(event));
|
|
883
864
|
|
|
884
865
|
// Trigger opening using the corresponding delay.
|
|
885
|
-
|
|
866
|
+
this._tooltipController.open({
|
|
886
867
|
focus: event.type === 'focusin',
|
|
887
868
|
hover: event.type === 'mouseenter',
|
|
888
869
|
});
|
|
@@ -918,10 +899,7 @@ export const GridMixin = (superClass) =>
|
|
|
918
899
|
|
|
919
900
|
/** @protected */
|
|
920
901
|
_hideTooltip(immediate) {
|
|
921
|
-
|
|
922
|
-
if (tooltip) {
|
|
923
|
-
tooltip._stateController.close(immediate);
|
|
924
|
-
}
|
|
902
|
+
this._tooltipController.close(immediate);
|
|
925
903
|
}
|
|
926
904
|
|
|
927
905
|
/**
|
|
@@ -15,8 +15,6 @@ import { addListener, setTouchAction } from '@vaadin/component-base/src/gestures
|
|
|
15
15
|
* Web component-specific selection state updates must be implemented in the
|
|
16
16
|
* `<vaadin-grid-selection-column>` itself, by overriding the protected methods
|
|
17
17
|
* provided by this mixin.
|
|
18
|
-
*
|
|
19
|
-
* @polymerMixin
|
|
20
18
|
*/
|
|
21
19
|
export const GridSelectionColumnBaseMixin = (superClass) =>
|
|
22
20
|
class GridSelectionColumnBaseMixin extends superClass {
|
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { GridSelectionColumnBaseMixin } from './vaadin-grid-selection-column-base-mixin.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* @polymerMixin
|
|
10
|
-
* @mixes GridSelectionColumnBaseMixin
|
|
11
|
-
*/
|
|
12
8
|
export const GridSelectionColumnMixin = (superClass) =>
|
|
13
9
|
class extends GridSelectionColumnBaseMixin(superClass) {
|
|
14
10
|
static get properties() {
|
|
@@ -37,7 +37,9 @@ export * from './vaadin-grid-selection-column-mixin.js';
|
|
|
37
37
|
*
|
|
38
38
|
* @fires {CustomEvent} select-all-changed - Fired when the `selectAll` property changes.
|
|
39
39
|
*/
|
|
40
|
-
declare class GridSelectionColumn<TItem = GridDefaultItem> extends HTMLElement {
|
|
40
|
+
declare class GridSelectionColumn<TItem = GridDefaultItem> extends HTMLElement {
|
|
41
|
+
hidden: boolean;
|
|
42
|
+
}
|
|
41
43
|
|
|
42
44
|
interface GridSelectionColumn<TItem = GridDefaultItem>
|
|
43
45
|
extends GridSelectionColumnMixinClass<TItem>, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {
|
|
@@ -34,7 +34,6 @@ import { GridSelectionColumnMixin } from './vaadin-grid-selection-column-mixin.j
|
|
|
34
34
|
*
|
|
35
35
|
* @customElement vaadin-grid-selection-column
|
|
36
36
|
* @extends GridColumn
|
|
37
|
-
* @mixes GridSelectionColumnMixin
|
|
38
37
|
*/
|
|
39
38
|
class GridSelectionColumn extends GridSelectionColumnMixin(GridColumn) {
|
|
40
39
|
static get is() {
|
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @polymerMixin
|
|
9
|
-
*/
|
|
10
7
|
export const SelectionMixin = (superClass) =>
|
|
11
8
|
class SelectionMixin extends superClass {
|
|
12
9
|
static get properties() {
|
|
@@ -42,7 +39,6 @@ export const SelectionMixin = (superClass) =>
|
|
|
42
39
|
*/
|
|
43
40
|
isItemSelectable: {
|
|
44
41
|
type: Function,
|
|
45
|
-
notify: (() => true)(), // prevent Polymer analyzer from documenting a changed event
|
|
46
42
|
},
|
|
47
43
|
|
|
48
44
|
/**
|
|
@@ -109,6 +105,16 @@ export const SelectionMixin = (superClass) =>
|
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
107
|
|
|
108
|
+
/** @protected */
|
|
109
|
+
updated(props) {
|
|
110
|
+
super.updated(props);
|
|
111
|
+
|
|
112
|
+
if (props.has('isItemSelectable')) {
|
|
113
|
+
/** @internal to not document it in CEM */
|
|
114
|
+
this.dispatchEvent(new CustomEvent('is-item-selectable-changed'));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
112
118
|
/** @private */
|
|
113
119
|
__selectedItemsChanged() {
|
|
114
120
|
this._getRenderedRows().forEach((row) => {
|
|
@@ -131,20 +137,4 @@ export const SelectionMixin = (superClass) =>
|
|
|
131
137
|
|
|
132
138
|
return selectedKeys;
|
|
133
139
|
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Fired when the `selectedItems` property changes.
|
|
137
|
-
*
|
|
138
|
-
* @event selected-items-changed
|
|
139
|
-
*/
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Fired when the user selects or deselects an item through the selection column.
|
|
143
|
-
*
|
|
144
|
-
* @event item-toggle
|
|
145
|
-
* @param {Object} detail
|
|
146
|
-
* @param {GridItem} detail.item the item that was selected or deselected
|
|
147
|
-
* @param {boolean} detail.selected true if the item was selected
|
|
148
|
-
* @param {boolean} detail.shiftKey true if the shift key was pressed
|
|
149
|
-
*/
|
|
150
140
|
};
|
|
@@ -24,7 +24,9 @@ export * from './vaadin-grid-sort-column-mixin.js';
|
|
|
24
24
|
*
|
|
25
25
|
* @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
|
|
26
26
|
*/
|
|
27
|
-
declare class GridSortColumn<TItem = GridDefaultItem> extends HTMLElement {
|
|
27
|
+
declare class GridSortColumn<TItem = GridDefaultItem> extends HTMLElement {
|
|
28
|
+
hidden: boolean;
|
|
29
|
+
}
|
|
28
30
|
|
|
29
31
|
interface GridSortColumn<TItem = GridDefaultItem>
|
|
30
32
|
extends GridSortColumnMixinClass, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {
|
|
@@ -25,7 +25,6 @@ import { GridSortColumnMixin } from './vaadin-grid-sort-column-mixin.js';
|
|
|
25
25
|
*
|
|
26
26
|
* @customElement vaadin-grid-sort-column
|
|
27
27
|
* @extends GridColumn
|
|
28
|
-
* @mixes GridSortColumnMixin
|
|
29
28
|
*/
|
|
30
29
|
class GridSortColumn extends GridSortColumnMixin(GridColumn) {
|
|
31
30
|
static get is() {
|
|
@@ -53,9 +53,6 @@ import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
|
|
|
53
53
|
*
|
|
54
54
|
* @customElement vaadin-grid-sorter
|
|
55
55
|
* @extends HTMLElement
|
|
56
|
-
* @mixes GridSorterMixin
|
|
57
|
-
* @mixes ThemableMixin
|
|
58
|
-
* @mixes DirMixin
|
|
59
56
|
*/
|
|
60
57
|
class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
61
58
|
static get is() {
|
|
@@ -34,7 +34,7 @@ export declare class StylingMixinClass<TItem> {
|
|
|
34
34
|
cellPartNameGenerator: GridCellPartNameGenerator<TItem> | null | undefined;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Runs the `
|
|
37
|
+
* Runs the `cellPartNameGenerator` for the visible cells.
|
|
38
38
|
* If the generator depends on varying conditions, you need to
|
|
39
39
|
* call this function manually in order to update the styles when
|
|
40
40
|
* the conditions change.
|
|
@@ -20,7 +20,9 @@ import type { GridTreeColumnMixinClass } from './vaadin-grid-tree-column-mixin.j
|
|
|
20
20
|
* ...
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
declare class GridTreeColumn<TItem = GridDefaultItem> extends HTMLElement {
|
|
23
|
+
declare class GridTreeColumn<TItem = GridDefaultItem> extends HTMLElement {
|
|
24
|
+
hidden: boolean;
|
|
25
|
+
}
|
|
24
26
|
|
|
25
27
|
interface GridTreeColumn<TItem = GridDefaultItem>
|
|
26
28
|
extends GridTreeColumnMixinClass<TItem>, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {}
|
|
@@ -22,7 +22,6 @@ import { GridTreeColumnMixin } from './vaadin-grid-tree-column-mixin.js';
|
|
|
22
22
|
* ```
|
|
23
23
|
* @customElement vaadin-grid-tree-column
|
|
24
24
|
* @extends GridColumn
|
|
25
|
-
* @mixes GridTreeColumnMixin
|
|
26
25
|
*/
|
|
27
26
|
class GridTreeColumn extends GridTreeColumnMixin(GridColumn) {
|
|
28
27
|
static get is() {
|
|
@@ -61,9 +61,6 @@ import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
|
|
|
61
61
|
*
|
|
62
62
|
* @customElement vaadin-grid-tree-toggle
|
|
63
63
|
* @extends HTMLElement
|
|
64
|
-
* @mixes ThemableMixin
|
|
65
|
-
* @mixes DirMixin
|
|
66
|
-
* @mixes GridTreeToggleMixin
|
|
67
64
|
*/
|
|
68
65
|
class GridTreeToggle extends GridTreeToggleMixin(
|
|
69
66
|
ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -251,7 +251,7 @@ export type GridDefaultItem = any;
|
|
|
251
251
|
*
|
|
252
252
|
* @fires {CustomEvent} active-item-changed - Fired when the `activeItem` property changes.
|
|
253
253
|
* @fires {CustomEvent} cell-activate - Fired when the cell is activated with click or keyboard.
|
|
254
|
-
* @fires {CustomEvent} cell-focus - Fired when a cell is focused with click or keyboard navigation.
|
|
254
|
+
* @fires {CustomEvent} cell-focus - Fired when a cell is focused with click or keyboard navigation. Use the `context` property to read event details.
|
|
255
255
|
* @fires {CustomEvent} column-reorder - Fired when the columns in the grid are reordered.
|
|
256
256
|
* @fires {CustomEvent} column-resize - Fired when the grid column resize is finished.
|
|
257
257
|
* @fires {CustomEvent} data-provider-changed - Fired when the `dataProvider` property changes.
|
package/src/vaadin-grid.js
CHANGED
|
@@ -252,7 +252,7 @@ import { GridMixin } from './vaadin-grid-mixin.js';
|
|
|
252
252
|
*
|
|
253
253
|
* @fires {CustomEvent} active-item-changed - Fired when the `activeItem` property changes.
|
|
254
254
|
* @fires {CustomEvent} cell-activate - Fired when the cell is activated with click or keyboard.
|
|
255
|
-
* @fires {CustomEvent} cell-focus - Fired when a cell is focused with click or keyboard navigation.
|
|
255
|
+
* @fires {CustomEvent} cell-focus - Fired when a cell is focused with click or keyboard navigation. Use the `context` property to read event details.
|
|
256
256
|
* @fires {CustomEvent} column-reorder - Fired when the columns in the grid are reordered.
|
|
257
257
|
* @fires {CustomEvent} column-resize - Fired when the grid column resize is finished.
|
|
258
258
|
* @fires {CustomEvent} data-provider-changed - Fired when the `dataProvider` property changes.
|
|
@@ -267,8 +267,6 @@ import { GridMixin } from './vaadin-grid-mixin.js';
|
|
|
267
267
|
*
|
|
268
268
|
* @customElement vaadin-grid
|
|
269
269
|
* @extends HTMLElement
|
|
270
|
-
* @mixes GridMixin
|
|
271
|
-
* @mixes ThemableMixin
|
|
272
270
|
*/
|
|
273
271
|
class Grid extends GridMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
274
272
|
static get is() {
|