@vaadin/grid 23.1.0-beta2 → 23.1.0-beta3
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "23.1.0-
|
|
3
|
+
"version": "23.1.0-beta3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
45
45
|
"@polymer/polymer": "^3.0.0",
|
|
46
|
-
"@vaadin/checkbox": "23.1.0-
|
|
47
|
-
"@vaadin/component-base": "23.1.0-
|
|
48
|
-
"@vaadin/lit-renderer": "23.1.0-
|
|
49
|
-
"@vaadin/text-field": "23.1.0-
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
51
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
52
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
46
|
+
"@vaadin/checkbox": "23.1.0-beta3",
|
|
47
|
+
"@vaadin/component-base": "23.1.0-beta3",
|
|
48
|
+
"@vaadin/lit-renderer": "23.1.0-beta3",
|
|
49
|
+
"@vaadin/text-field": "23.1.0-beta3",
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-beta3",
|
|
51
|
+
"@vaadin/vaadin-material-styles": "23.1.0-beta3",
|
|
52
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-beta3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@esm-bundle/chai": "^4.3.4",
|
|
56
|
-
"@vaadin/polymer-legacy-adapter": "23.1.0-
|
|
56
|
+
"@vaadin/polymer-legacy-adapter": "23.1.0-beta3",
|
|
57
57
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
58
58
|
"lit": "^2.0.0",
|
|
59
59
|
"sinon": "^13.0.2"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c787ceb8a312f88631c6d429ff320d5f89b1b838"
|
|
62
62
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable max-classes-per-file */
|
|
7
7
|
import { directive } from 'lit/directive.js';
|
|
8
|
-
import { microTask } from '@vaadin/component-base/src/async';
|
|
9
|
-
import { Debouncer } from '@vaadin/component-base/src/debounce';
|
|
8
|
+
import { microTask } from '@vaadin/component-base/src/async.js';
|
|
9
|
+
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
10
10
|
import { LitRendererDirective } from '@vaadin/lit-renderer';
|
|
11
11
|
import { CONTENT_UPDATE_DEBOUNCER } from './renderer-directives.js';
|
|
12
12
|
|
|
@@ -20,11 +20,20 @@ export const SelectionMixin = (superClass) =>
|
|
|
20
20
|
notify: true,
|
|
21
21
|
value: () => [],
|
|
22
22
|
},
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Set of selected item ids
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
__selectedKeys: {
|
|
29
|
+
type: Object,
|
|
30
|
+
value: () => new Set(),
|
|
31
|
+
},
|
|
23
32
|
};
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
static get observers() {
|
|
27
|
-
return ['
|
|
36
|
+
return ['_updateSelectedKeys(itemIdPath, selectedItems.*)'];
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
/**
|
|
@@ -33,7 +42,7 @@ export const SelectionMixin = (superClass) =>
|
|
|
33
42
|
* @protected
|
|
34
43
|
*/
|
|
35
44
|
_isSelected(item) {
|
|
36
|
-
return this.
|
|
45
|
+
return this.__selectedKeys.has(this.getItemId(item));
|
|
37
46
|
}
|
|
38
47
|
|
|
39
48
|
/**
|
|
@@ -68,8 +77,7 @@ export const SelectionMixin = (superClass) =>
|
|
|
68
77
|
* @protected
|
|
69
78
|
*/
|
|
70
79
|
_toggleItem(item) {
|
|
71
|
-
|
|
72
|
-
if (index === -1) {
|
|
80
|
+
if (!this._isSelected(item)) {
|
|
73
81
|
this.selectItem(item);
|
|
74
82
|
} else {
|
|
75
83
|
this.deselectItem(item);
|
|
@@ -77,7 +85,13 @@ export const SelectionMixin = (superClass) =>
|
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
/** @private */
|
|
80
|
-
|
|
88
|
+
_updateSelectedKeys() {
|
|
89
|
+
const selectedItems = this.selectedItems || [];
|
|
90
|
+
this.__selectedKeys = new Set();
|
|
91
|
+
selectedItems.forEach((item) => {
|
|
92
|
+
this.__selectedKeys.add(this.getItemId(item));
|
|
93
|
+
});
|
|
94
|
+
|
|
81
95
|
this.requestContentUpdate();
|
|
82
96
|
}
|
|
83
97
|
|