@vaadin/grid-pro 23.1.0-alpha2 → 23.1.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/package.json +16 -16
- package/src/vaadin-grid-pro-edit-column.js +11 -9
- package/src/vaadin-grid-pro-edit-select.js +7 -5
- package/src/vaadin-grid-pro-inline-editing-mixin.d.ts +1 -1
- package/src/vaadin-grid-pro-inline-editing-mixin.js +30 -18
- package/src/vaadin-grid-pro.d.ts +2 -2
- package/theme/lumo/vaadin-grid-pro-edit-select-styles.js +1 -1
- package/theme/lumo/vaadin-grid-pro-edit-text-field-styles.js +1 -1
- package/theme/lumo/vaadin-grid-pro-styles.js +4 -6
- package/theme/material/vaadin-grid-pro-edit-select-styles.js +1 -1
- package/theme/material/vaadin-grid-pro-edit-text-field-styles.js +1 -1
- package/theme/material/vaadin-grid-pro-styles.js +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid-pro",
|
|
3
|
-
"version": "23.1.0-
|
|
3
|
+
"version": "23.1.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/checkbox": "23.1.0-
|
|
39
|
-
"@vaadin/component-base": "23.1.0-
|
|
40
|
-
"@vaadin/grid": "23.1.0-
|
|
41
|
-
"@vaadin/item": "23.1.0-
|
|
42
|
-
"@vaadin/list-box": "23.1.0-
|
|
43
|
-
"@vaadin/select": "23.1.0-
|
|
44
|
-
"@vaadin/text-field": "23.1.0-
|
|
38
|
+
"@vaadin/checkbox": "23.1.0-beta1",
|
|
39
|
+
"@vaadin/component-base": "23.1.0-beta1",
|
|
40
|
+
"@vaadin/grid": "23.1.0-beta1",
|
|
41
|
+
"@vaadin/item": "23.1.0-beta1",
|
|
42
|
+
"@vaadin/list-box": "23.1.0-beta1",
|
|
43
|
+
"@vaadin/select": "23.1.0-beta1",
|
|
44
|
+
"@vaadin/text-field": "23.1.0-beta1",
|
|
45
45
|
"@vaadin/vaadin-license-checker": "^2.1.0",
|
|
46
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
47
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
48
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-beta1",
|
|
47
|
+
"@vaadin/vaadin-material-styles": "23.1.0-beta1",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-beta1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@esm-bundle/chai": "^4.3.4",
|
|
52
|
-
"@vaadin/date-picker": "23.1.0-
|
|
53
|
-
"@vaadin/dialog": "23.1.0-
|
|
54
|
-
"@vaadin/polymer-legacy-adapter": "23.1.0-
|
|
52
|
+
"@vaadin/date-picker": "23.1.0-beta1",
|
|
53
|
+
"@vaadin/dialog": "23.1.0-beta1",
|
|
54
|
+
"@vaadin/polymer-legacy-adapter": "23.1.0-beta1",
|
|
55
55
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
56
56
|
"lit": "^2.0.0",
|
|
57
|
-
"sinon": "^
|
|
57
|
+
"sinon": "^13.0.2"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "8be43cf83102a6b9ccf309687446e590ce0164e8"
|
|
60
60
|
}
|
|
@@ -59,7 +59,7 @@ class GridProEditColumn extends GridColumn {
|
|
|
59
59
|
*/
|
|
60
60
|
editorOptions: {
|
|
61
61
|
type: Array,
|
|
62
|
-
value: () => []
|
|
62
|
+
value: () => [],
|
|
63
63
|
},
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -75,7 +75,7 @@ class GridProEditColumn extends GridColumn {
|
|
|
75
75
|
editorType: {
|
|
76
76
|
type: String,
|
|
77
77
|
notify: true, // FIXME(web-padawan): needed by Flow counterpart
|
|
78
|
-
value: 'text'
|
|
78
|
+
value: 'text',
|
|
79
79
|
},
|
|
80
80
|
|
|
81
81
|
/**
|
|
@@ -85,7 +85,7 @@ class GridProEditColumn extends GridColumn {
|
|
|
85
85
|
*/
|
|
86
86
|
editorValuePath: {
|
|
87
87
|
type: String,
|
|
88
|
-
value: 'value'
|
|
88
|
+
value: 'value',
|
|
89
89
|
},
|
|
90
90
|
|
|
91
91
|
/**
|
|
@@ -93,11 +93,11 @@ class GridProEditColumn extends GridColumn {
|
|
|
93
93
|
*/
|
|
94
94
|
path: {
|
|
95
95
|
type: String,
|
|
96
|
-
observer: '_pathChanged'
|
|
96
|
+
observer: '_pathChanged',
|
|
97
97
|
},
|
|
98
98
|
|
|
99
99
|
/** @private */
|
|
100
|
-
_oldRenderer: Function
|
|
100
|
+
_oldRenderer: Function,
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -122,7 +122,7 @@ class GridProEditColumn extends GridColumn {
|
|
|
122
122
|
|
|
123
123
|
/** @private */
|
|
124
124
|
_pathChanged(path) {
|
|
125
|
-
if (!path || path.length
|
|
125
|
+
if (!path || path.length === 0) {
|
|
126
126
|
throw new Error('You should specify the path for the edit column');
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -132,7 +132,7 @@ class GridProEditColumn extends GridColumn {
|
|
|
132
132
|
this._cells.forEach((cell) => {
|
|
133
133
|
const part = cell.getAttribute('part');
|
|
134
134
|
if (part.indexOf('editable-cell') < 0) {
|
|
135
|
-
cell.setAttribute('part', part
|
|
135
|
+
cell.setAttribute('part', `${part} editable-cell`);
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
}
|
|
@@ -243,9 +243,11 @@ class GridProEditColumn extends GridColumn {
|
|
|
243
243
|
_setEditorValue(editor, value) {
|
|
244
244
|
const path = this.editorType === 'checkbox' ? 'checked' : this.editorValuePath;
|
|
245
245
|
// FIXME(yuriy): Required for the flow counterpart as it is passing the string value to webcomponent
|
|
246
|
-
value = this.editorType === 'checkbox' && typeof value === 'string' ? value
|
|
246
|
+
value = this.editorType === 'checkbox' && typeof value === 'string' ? value === 'true' : value;
|
|
247
247
|
set(editor, path, value);
|
|
248
|
-
|
|
248
|
+
if (editor.notifyPath) {
|
|
249
|
+
editor.notifyPath(path, value);
|
|
250
|
+
}
|
|
249
251
|
}
|
|
250
252
|
|
|
251
253
|
/**
|
|
@@ -23,16 +23,16 @@ class GridProEditSelect extends Select {
|
|
|
23
23
|
return {
|
|
24
24
|
options: {
|
|
25
25
|
type: Array,
|
|
26
|
-
value: () => []
|
|
26
|
+
value: () => [],
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
_grid: {
|
|
30
|
-
type: Object
|
|
30
|
+
type: Object,
|
|
31
31
|
},
|
|
32
32
|
|
|
33
33
|
_initialized: {
|
|
34
|
-
type: Boolean
|
|
35
|
-
}
|
|
34
|
+
type: Boolean,
|
|
35
|
+
},
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -72,7 +72,9 @@ class GridProEditSelect extends Select {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (event.keyCode === 9) {
|
|
75
|
-
!this._grid.singleCellEdit
|
|
75
|
+
if (!this._grid.singleCellEdit) {
|
|
76
|
+
this._grid._switchEditCell(event);
|
|
77
|
+
}
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
// Call `super` to close overlay on Tab.
|
|
@@ -22,7 +22,7 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
22
22
|
*/
|
|
23
23
|
enterNextRow: {
|
|
24
24
|
type: Boolean,
|
|
25
|
-
notify: true // FIXME(yuriy-fix): needed by Flow counterpart
|
|
25
|
+
notify: true, // FIXME(yuriy-fix): needed by Flow counterpart
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -35,7 +35,7 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
35
35
|
*/
|
|
36
36
|
singleCellEdit: {
|
|
37
37
|
type: Boolean,
|
|
38
|
-
notify: true // FIXME(yuriy-fix): needed by Flow counterpart
|
|
38
|
+
notify: true, // FIXME(yuriy-fix): needed by Flow counterpart
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -44,13 +44,13 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
44
44
|
* @attr {boolean} edit-on-click
|
|
45
45
|
*/
|
|
46
46
|
editOnClick: {
|
|
47
|
-
type: Boolean
|
|
47
|
+
type: Boolean,
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
/** @private */
|
|
51
51
|
_editingDisabled: {
|
|
52
|
-
type: Boolean
|
|
53
|
-
}
|
|
52
|
+
type: Boolean,
|
|
53
|
+
},
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -80,19 +80,31 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
80
80
|
this.addEventListener('keydown', (e) => {
|
|
81
81
|
switch (e.keyCode) {
|
|
82
82
|
case 27:
|
|
83
|
-
this.__edited
|
|
83
|
+
if (this.__edited) {
|
|
84
|
+
this._stopEdit(true);
|
|
85
|
+
}
|
|
84
86
|
break;
|
|
85
87
|
case 9:
|
|
86
|
-
this.__edited
|
|
88
|
+
if (this.__edited) {
|
|
89
|
+
this._switchEditCell(e);
|
|
90
|
+
}
|
|
87
91
|
break;
|
|
88
92
|
case 13:
|
|
89
|
-
this.__edited
|
|
93
|
+
if (this.__edited) {
|
|
94
|
+
this._switchEditCell(e);
|
|
95
|
+
} else {
|
|
96
|
+
this._enterEditFromEvent(e);
|
|
97
|
+
}
|
|
90
98
|
break;
|
|
91
99
|
case 32:
|
|
92
|
-
!this.__edited
|
|
100
|
+
if (!this.__edited) {
|
|
101
|
+
this._enterEditFromEvent(e);
|
|
102
|
+
}
|
|
93
103
|
break;
|
|
94
104
|
default:
|
|
95
|
-
e.key && e.key.length === 1
|
|
105
|
+
if (e.key && e.key.length === 1) {
|
|
106
|
+
this._enterEditFromEvent(e, 'text');
|
|
107
|
+
}
|
|
96
108
|
break;
|
|
97
109
|
}
|
|
98
110
|
});
|
|
@@ -179,7 +191,7 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
179
191
|
/** @private */
|
|
180
192
|
_applyEdit({ path, value, index, item }) {
|
|
181
193
|
this.set(path, value, item);
|
|
182
|
-
this.notifyPath(
|
|
194
|
+
this.notifyPath(`items.${index}.${path}`, value);
|
|
183
195
|
}
|
|
184
196
|
|
|
185
197
|
/** @private */
|
|
@@ -296,7 +308,7 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
296
308
|
if (edited) {
|
|
297
309
|
// detect focus moving to e.g. vaadin-select-overlay
|
|
298
310
|
const overlay = Array.from(e.composedPath()).filter(
|
|
299
|
-
(node) => node.nodeType === Node.ELEMENT_NODE && /^vaadin-(?!dialog).*-overlay$/i.test(node.localName)
|
|
311
|
+
(node) => node.nodeType === Node.ELEMENT_NODE && /^vaadin-(?!dialog).*-overlay$/i.test(node.localName),
|
|
300
312
|
)[0];
|
|
301
313
|
|
|
302
314
|
if (overlay) {
|
|
@@ -326,10 +338,10 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
326
338
|
detail: {
|
|
327
339
|
index: model.index,
|
|
328
340
|
item: model.item,
|
|
329
|
-
path: column.path
|
|
341
|
+
path: column.path,
|
|
330
342
|
},
|
|
331
|
-
composed: true
|
|
332
|
-
})
|
|
343
|
+
composed: true,
|
|
344
|
+
}),
|
|
333
345
|
);
|
|
334
346
|
this.addEventListener('item-property-changed', this.__boundItemPropertyChanged);
|
|
335
347
|
}
|
|
@@ -363,12 +375,12 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
363
375
|
index: model.index,
|
|
364
376
|
item: model.item,
|
|
365
377
|
path: column.path,
|
|
366
|
-
value: value
|
|
378
|
+
value: value,
|
|
367
379
|
},
|
|
368
380
|
bubbles: true,
|
|
369
381
|
cancelable: true,
|
|
370
|
-
composed: true
|
|
371
|
-
})
|
|
382
|
+
composed: true,
|
|
383
|
+
}),
|
|
372
384
|
);
|
|
373
385
|
}
|
|
374
386
|
}
|
package/src/vaadin-grid-pro.d.ts
CHANGED
|
@@ -78,13 +78,13 @@ declare class GridPro<TItem = GridDefaultItem> extends Grid<TItem> {
|
|
|
78
78
|
addEventListener<K extends keyof GridProEventMap<TItem>>(
|
|
79
79
|
type: K,
|
|
80
80
|
listener: (this: GridPro<TItem>, ev: GridProEventMap<TItem>[K]) => void,
|
|
81
|
-
options?: boolean | AddEventListenerOptions
|
|
81
|
+
options?: boolean | AddEventListenerOptions,
|
|
82
82
|
): void;
|
|
83
83
|
|
|
84
84
|
removeEventListener<K extends keyof GridProEventMap<TItem>>(
|
|
85
85
|
type: K,
|
|
86
86
|
listener: (this: GridPro<TItem>, ev: GridProEventMap<TItem>[K]) => void,
|
|
87
|
-
options?: boolean | EventListenerOptions
|
|
87
|
+
options?: boolean | EventListenerOptions,
|
|
88
88
|
): void;
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -2,5 +2,5 @@ import { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mi
|
|
|
2
2
|
import { gridProEditor } from './vaadin-grid-pro-editor-styles.js';
|
|
3
3
|
|
|
4
4
|
registerStyles('vaadin-grid-pro-edit-text-field', gridProEditor, {
|
|
5
|
-
moduleId: 'lumo-grid-pro-edit-text-field'
|
|
5
|
+
moduleId: 'lumo-grid-pro-edit-text-field',
|
|
6
6
|
});
|
|
@@ -23,20 +23,18 @@ registerStyles(
|
|
|
23
23
|
|
|
24
24
|
[part~='editable-cell']:hover,
|
|
25
25
|
[part~='editable-cell']:focus {
|
|
26
|
-
background-color
|
|
27
|
-
background-clip: padding-box;
|
|
26
|
+
background: var(--lumo-base-color) linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/* Indicate editable cells */
|
|
31
30
|
|
|
32
31
|
:host([theme~='highlight-editable-cells']) [part~='editable-cell'] {
|
|
33
|
-
background-color
|
|
34
|
-
background-clip: border-box;
|
|
32
|
+
background: var(--lumo-base-color) linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
:host([theme~='highlight-editable-cells']) [part~='editable-cell']:hover,
|
|
38
36
|
:host([theme~='highlight-editable-cells']) [part~='editable-cell']:focus {
|
|
39
|
-
background-color
|
|
37
|
+
background: var(--lumo-base-color) linear-gradient(var(--lumo-contrast-10pct), var(--lumo-contrast-10pct));
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
/* Indicate read-only cells */
|
|
@@ -51,5 +49,5 @@ registerStyles(
|
|
|
51
49
|
);
|
|
52
50
|
}
|
|
53
51
|
`,
|
|
54
|
-
{ moduleId: 'lumo-grid-pro' }
|
|
52
|
+
{ moduleId: 'lumo-grid-pro' },
|
|
55
53
|
);
|
|
@@ -2,5 +2,5 @@ import { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mi
|
|
|
2
2
|
import { gridProEditor } from './vaadin-grid-pro-editor-styles.js';
|
|
3
3
|
|
|
4
4
|
registerStyles('vaadin-grid-pro-edit-text-field', gridProEditor, {
|
|
5
|
-
moduleId: 'material-grid-pro-edit-text-field'
|
|
5
|
+
moduleId: 'material-grid-pro-edit-text-field',
|
|
6
6
|
});
|
|
@@ -16,9 +16,8 @@ registerStyles(
|
|
|
16
16
|
|
|
17
17
|
[part~='row'] > [part~='editable-cell']:hover,
|
|
18
18
|
[part~='row'] > [part~='editable-cell']:focus {
|
|
19
|
-
background
|
|
20
|
-
background-clip: padding-box;
|
|
19
|
+
background: var(--material-background-color) linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08));
|
|
21
20
|
}
|
|
22
21
|
`,
|
|
23
|
-
{ moduleId: 'material-grid-pro' }
|
|
22
|
+
{ moduleId: 'material-grid-pro' },
|
|
24
23
|
);
|