@vaadin/vaadin-grid 5.9.1 → 5.9.4
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 +21 -20
- package/src/vaadin-grid-column-reordering-mixin.js +11 -3
- package/src/vaadin-grid-column.js +4 -2
- package/src/vaadin-grid-disabled-mixin.d.ts +34 -0
- package/src/vaadin-grid-disabled-mixin.js +43 -0
- package/src/vaadin-grid-selection-mixin.js +1 -5
- package/src/vaadin-grid-styles.js +5 -0
- package/src/vaadin-grid.d.ts +4 -1
- package/src/vaadin-grid.js +7 -3
- package/theme/lumo/vaadin-grid-styles.js +8 -0
- package/theme/material/vaadin-grid-styles.js +8 -0
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"repository": "vaadin/vaadin-grid",
|
|
16
16
|
"homepage": "https://vaadin.com/components",
|
|
17
17
|
"name": "@vaadin/vaadin-grid",
|
|
18
|
-
"version": "5.9.
|
|
18
|
+
"version": "5.9.4",
|
|
19
19
|
"main": "vaadin-grid.js",
|
|
20
20
|
"author": "Vaadin Ltd",
|
|
21
21
|
"license": "Apache-2.0",
|
|
@@ -44,33 +44,34 @@
|
|
|
44
44
|
"@vaadin/vaadin-element-mixin": "^2.4.1"
|
|
45
45
|
},
|
|
46
46
|
"resolutions": {
|
|
47
|
-
"@webcomponents/webcomponentsjs": "2.0.0",
|
|
48
|
-
"es-abstract": "1.17.6",
|
|
49
|
-
"@types/doctrine": "0.0.3",
|
|
47
|
+
"@webcomponents/webcomponentsjs": "2.0.0",
|
|
50
48
|
"inherits": "2.0.3",
|
|
51
49
|
"samsam": "1.1.3",
|
|
52
50
|
"supports-color": "3.1.2",
|
|
53
51
|
"type-detect": "1.0.0"
|
|
54
52
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@web-padawan/gen-typescript-declarations": "^1.6.2",
|
|
55
|
+
"web-component-tester": "6.9.2",
|
|
56
|
+
"@polymer/app-localize-behavior": "^3.0.0",
|
|
57
|
+
"@polymer/iron-ajax": "^3.0.0",
|
|
58
|
+
"@polymer/iron-component-page": "^4.0.0",
|
|
59
|
+
"@polymer/iron-image": "^3.0.0",
|
|
60
|
+
"@polymer/iron-list": "^3.0.0",
|
|
61
|
+
"@polymer/iron-media-query": "^3.0.0",
|
|
61
62
|
"@polymer/iron-test-helpers": "^3.0.0",
|
|
62
|
-
"@polymer/paper-input": "^3.0.0",
|
|
63
63
|
"@polymer/paper-checkbox": "^3.0.0",
|
|
64
|
-
"@polymer/
|
|
65
|
-
"@polymer/iron-image": "^3.0.0",
|
|
64
|
+
"@polymer/paper-input": "^3.0.0",
|
|
66
65
|
"@polymer/paper-slider": "^3.0.0",
|
|
67
|
-
"@polymer/
|
|
68
|
-
"@polymer/iron-component-page": "^4.0.0",
|
|
69
|
-
"@polymer/iron-ajax": "^3.0.0",
|
|
70
|
-
"@polymer/app-localize-behavior": "^3.0.0",
|
|
71
|
-
"@polymer/iron-list": "^3.0.0",
|
|
72
|
-
"@vaadin/vaadin-demo-helpers": "^3.1.0",
|
|
66
|
+
"@polymer/test-fixture": "^4.0.0",
|
|
73
67
|
"@vaadin/vaadin-button": "^2.4.0",
|
|
74
|
-
"@vaadin/vaadin-context-menu": "^4.5.0"
|
|
68
|
+
"@vaadin/vaadin-context-menu": "^4.5.0",
|
|
69
|
+
"@vaadin/vaadin-demo-helpers": "^3.1.0",
|
|
70
|
+
"@webcomponents/webcomponentsjs": "^2.0.0",
|
|
71
|
+
"wct-browser-legacy": "^1.0.1"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"generate-typings": "gen-typescript-declarations --outDir . --verify",
|
|
75
|
+
"test": "wct --npm"
|
|
75
76
|
}
|
|
76
77
|
}
|
|
@@ -8,7 +8,6 @@ import { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event
|
|
|
8
8
|
import { GridHelper } from './vaadin-grid-helpers.js';
|
|
9
9
|
import { addListener } from '@polymer/polymer/lib/utils/gestures.js';
|
|
10
10
|
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js';
|
|
11
|
-
import { useShadow } from '@polymer/polymer/lib/utils/settings.js';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* @polymerMixin
|
|
@@ -214,15 +213,24 @@ export const ColumnReorderingMixin = superClass => class ColumnReorderingMixin e
|
|
|
214
213
|
if (!this._draggedColumn) {
|
|
215
214
|
this._toggleAttribute('no-content-pointer-events', true, this.$.scroller);
|
|
216
215
|
}
|
|
216
|
+
// Workaround a ShadyDOM bug
|
|
217
|
+
this._reorderGhost.hidden = true;
|
|
218
|
+
|
|
217
219
|
let cell;
|
|
218
|
-
if (
|
|
220
|
+
if (this.shadowRoot.elementFromPoint) {
|
|
219
221
|
cell = this.shadowRoot.elementFromPoint(x, y);
|
|
220
222
|
} else {
|
|
221
223
|
cell = document.elementFromPoint(x, y);
|
|
224
|
+
}
|
|
222
225
|
|
|
223
|
-
|
|
226
|
+
this._reorderGhost.hidden = false;
|
|
227
|
+
|
|
228
|
+
// Workaround FF58/ShadyDOM bugs
|
|
229
|
+
while (!cell._column && cell.parentElement) {
|
|
224
230
|
if (cell.localName === 'vaadin-grid-cell-content') {
|
|
225
231
|
cell = cell.assignedSlot.parentNode;
|
|
232
|
+
} else {
|
|
233
|
+
cell = cell.parentElement;
|
|
226
234
|
}
|
|
227
235
|
|
|
228
236
|
}
|
|
@@ -368,7 +368,9 @@ export const ColumnBaseMixin = superClass => class ColumnBaseMixin extends super
|
|
|
368
368
|
_setFooterTemplateOrRenderer(footerTemplate, footerRenderer, footerCell) {
|
|
369
369
|
if ((footerTemplate || footerRenderer) && footerCell) {
|
|
370
370
|
this.__setColumnTemplateOrRenderer(footerTemplate, footerRenderer, [footerCell]);
|
|
371
|
-
this._grid
|
|
371
|
+
if (this._grid) {
|
|
372
|
+
this._grid.__updateHeaderFooterRowVisibility(footerCell.parentElement);
|
|
373
|
+
}
|
|
372
374
|
}
|
|
373
375
|
}
|
|
374
376
|
|
|
@@ -482,7 +484,7 @@ export const ColumnBaseMixin = superClass => class ColumnBaseMixin extends super
|
|
|
482
484
|
}
|
|
483
485
|
}
|
|
484
486
|
|
|
485
|
-
if (headerCell) {
|
|
487
|
+
if (headerCell && this._grid) {
|
|
486
488
|
this._grid.__updateHeaderFooterRowVisibility(headerCell.parentElement);
|
|
487
489
|
}
|
|
488
490
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file was automatically generated by
|
|
5
|
+
* https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations
|
|
6
|
+
*
|
|
7
|
+
* To modify these typings, edit the source file(s):
|
|
8
|
+
* src/vaadin-grid-disabled-mixin.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// tslint:disable:variable-name Describing an API that's defined elsewhere.
|
|
13
|
+
// tslint:disable:no-any describes the API as best we are able today
|
|
14
|
+
|
|
15
|
+
export {DisabledMixin};
|
|
16
|
+
|
|
17
|
+
declare function DisabledMixin<T extends new (...args: any[]) => {}>(base: T): T & DisabledMixinConstructor;
|
|
18
|
+
|
|
19
|
+
interface DisabledMixinConstructor {
|
|
20
|
+
new(...args: any[]): DisabledMixin;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {DisabledMixinConstructor};
|
|
24
|
+
|
|
25
|
+
interface DisabledMixin {
|
|
26
|
+
disabled: boolean|null|undefined;
|
|
27
|
+
_disabledChanged(disabled: any): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Overrides the default element `click` method in order to prevent
|
|
31
|
+
* firing the `click` event when the element is disabled.
|
|
32
|
+
*/
|
|
33
|
+
click(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2017 Vaadin Ltd.
|
|
4
|
+
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @polymerMixin
|
|
8
|
+
*/
|
|
9
|
+
export const DisabledMixin = superClass => class DisabledMixin extends superClass {
|
|
10
|
+
static get properties() {
|
|
11
|
+
return {
|
|
12
|
+
disabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
value: false,
|
|
15
|
+
observer: '_disabledChanged',
|
|
16
|
+
reflectToAttribute: true
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** @protected */
|
|
22
|
+
_disabledChanged(disabled) {
|
|
23
|
+
if (disabled) {
|
|
24
|
+
this.setAttribute('tabindex', '-1');
|
|
25
|
+
this.setAttribute('aria-disabled', 'true');
|
|
26
|
+
} else {
|
|
27
|
+
this.removeAttribute('tabindex');
|
|
28
|
+
this.removeAttribute('aria-disabled');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Overrides the default element `click` method in order to prevent
|
|
34
|
+
* firing the `click` event when the element is disabled.
|
|
35
|
+
* @protected
|
|
36
|
+
* @override
|
|
37
|
+
*/
|
|
38
|
+
click() {
|
|
39
|
+
if (!this.disabled) {
|
|
40
|
+
super.click();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -80,11 +80,7 @@ export const SelectionMixin = superClass => class SelectionMixin extends superCl
|
|
|
80
80
|
|
|
81
81
|
/** @private */
|
|
82
82
|
_selectedItemsChanged(e) {
|
|
83
|
-
|
|
84
|
-
Array.from(this.$.items.children).forEach(row => {
|
|
85
|
-
this._updateItem(row, row._item);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
83
|
+
this._assignModels();
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
/** @private */
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
15
|
|
|
16
|
+
import {DisabledMixin} from './vaadin-grid-disabled-mixin.js';
|
|
17
|
+
|
|
16
18
|
import {ScrollerElement} from './vaadin-grid-scroller.js';
|
|
17
19
|
|
|
18
20
|
import {A11yMixin} from './vaadin-grid-a11y-mixin.js';
|
|
@@ -255,7 +257,7 @@ import {timeOut, animationFrame} from '@polymer/polymer/lib/utils/async.js';
|
|
|
255
257
|
* `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
|
|
256
258
|
* `frozen` | Frozen cell | cell
|
|
257
259
|
* `last-frozen` | Last frozen cell | cell
|
|
258
|
-
*
|
|
260
|
+
* `first-column` | First visible cell on a row | cell
|
|
259
261
|
* `last-column` | Last visible cell on a row | cell
|
|
260
262
|
* `selected` | Selected row | row
|
|
261
263
|
* `expanded` | Expanded row | row
|
|
@@ -263,6 +265,7 @@ import {timeOut, animationFrame} from '@polymer/polymer/lib/utils/async.js';
|
|
|
263
265
|
* `loading` | Row that is waiting for data from data provider | row
|
|
264
266
|
* `odd` | Odd row | row
|
|
265
267
|
* `first` | The first body row | row
|
|
268
|
+
* `last` | The last body row | row
|
|
266
269
|
* `dragstart` | Set for one frame when drag of a row is starting. The value is a number when multiple rows are dragged | row
|
|
267
270
|
* `dragover` | Set when the row is dragged over | row
|
|
268
271
|
* `drag-disabled` | Set to a row that isn't available for dragging | row
|
package/src/vaadin-grid.js
CHANGED
|
@@ -6,6 +6,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
6
6
|
import '@polymer/polymer/polymer-legacy.js';
|
|
7
7
|
|
|
8
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
+
import { DisabledMixin } from './vaadin-grid-disabled-mixin.js';
|
|
9
10
|
import { ScrollerElement } from './vaadin-grid-scroller.js';
|
|
10
11
|
import { A11yMixin } from './vaadin-grid-a11y-mixin.js';
|
|
11
12
|
import { ActiveItemMixin } from './vaadin-grid-active-item-mixin.js';
|
|
@@ -239,7 +240,7 @@ const TOUCH_DEVICE = (() => {
|
|
|
239
240
|
* `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
|
|
240
241
|
* `frozen` | Frozen cell | cell
|
|
241
242
|
* `last-frozen` | Last frozen cell | cell
|
|
242
|
-
|
|
243
|
+
* `first-column` | First visible cell on a row | cell
|
|
243
244
|
* `last-column` | Last visible cell on a row | cell
|
|
244
245
|
* `selected` | Selected row | row
|
|
245
246
|
* `expanded` | Expanded row | row
|
|
@@ -247,6 +248,7 @@ const TOUCH_DEVICE = (() => {
|
|
|
247
248
|
* `loading` | Row that is waiting for data from data provider | row
|
|
248
249
|
* `odd` | Odd row | row
|
|
249
250
|
* `first` | The first body row | row
|
|
251
|
+
* `last` | The last body row | row
|
|
250
252
|
* `dragstart` | Set for one frame when drag of a row is starting. The value is a number when multiple rows are dragged | row
|
|
251
253
|
* `dragover` | Set when the row is dragged over | row
|
|
252
254
|
* `drag-disabled` | Set to a row that isn't available for dragging | row
|
|
@@ -293,7 +295,8 @@ class GridElement extends
|
|
|
293
295
|
EventContextMixin(
|
|
294
296
|
DragAndDropMixin(
|
|
295
297
|
StylingMixin(
|
|
296
|
-
|
|
298
|
+
DisabledMixin(
|
|
299
|
+
ScrollerElement))))))))))))))))))) {
|
|
297
300
|
static get template() {
|
|
298
301
|
return html`
|
|
299
302
|
<style include="vaadin-grid-styles"></style>
|
|
@@ -322,7 +325,7 @@ class GridElement extends
|
|
|
322
325
|
}
|
|
323
326
|
|
|
324
327
|
static get version() {
|
|
325
|
-
return '5.9.
|
|
328
|
+
return '5.9.4';
|
|
326
329
|
}
|
|
327
330
|
|
|
328
331
|
static get observers() {
|
|
@@ -764,6 +767,7 @@ class GridElement extends
|
|
|
764
767
|
}
|
|
765
768
|
|
|
766
769
|
this._toggleAttribute('first', index === 0, row);
|
|
770
|
+
this._toggleAttribute('last', index === this._effectiveSize - 1, row);
|
|
767
771
|
this._toggleAttribute('odd', index % 2, row);
|
|
768
772
|
this._a11yUpdateRowRowindex(row, index);
|
|
769
773
|
this._getItem(index, row);
|
|
@@ -29,6 +29,10 @@ const $_documentContainer = html`<dom-module id="lumo-grid" theme-for="vaadin-gr
|
|
|
29
29
|
--_lumo-grid-selected-row-color: var(--lumo-primary-color-10pct);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
:host([disabled]) {
|
|
33
|
+
opacity: 0.7;
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
/* No (outer) border */
|
|
33
37
|
|
|
34
38
|
:host(:not([theme~="no-border"])) {
|
|
@@ -118,6 +122,10 @@ const $_documentContainer = html`<dom-module id="lumo-grid" theme-for="vaadin-gr
|
|
|
118
122
|
margin-top: -1px;
|
|
119
123
|
}
|
|
120
124
|
|
|
125
|
+
:host([all-rows-visible]) [part~="row"][last][dragover="below"] [part~="cell"]::after {
|
|
126
|
+
height: 1px;
|
|
127
|
+
}
|
|
128
|
+
|
|
121
129
|
[part~="row"][dragover="above"] [part~="cell"]::after {
|
|
122
130
|
top: auto;
|
|
123
131
|
bottom: 100%;
|
|
@@ -13,6 +13,10 @@ const $_documentContainer = html`<dom-module id="material-grid" theme-for="vaadi
|
|
|
13
13
|
color: var(--material-body-text-color);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
opacity: 0.7;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
[part~="cell"] {
|
|
17
21
|
min-height: 48px;
|
|
18
22
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -161,6 +165,10 @@ const $_documentContainer = html`<dom-module id="material-grid" theme-for="vaadi
|
|
|
161
165
|
margin-top: -1px;
|
|
162
166
|
}
|
|
163
167
|
|
|
168
|
+
:host([all-rows-visible]) [part~="row"][last][dragover="below"] [part~="cell"]::after {
|
|
169
|
+
height: 1px;
|
|
170
|
+
}
|
|
171
|
+
|
|
164
172
|
[part~="row"][dragover="above"] [part~="cell"]::after {
|
|
165
173
|
top: auto;
|
|
166
174
|
bottom: 100%;
|