@vaadin/grid-pro 24.4.0-dev.b3e1d14600 → 24.5.0-alpha1
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/LICENSE +3 -1141
- package/README.md +0 -1
- package/package.json +11 -11
- package/src/lit/column-renderer-directives.d.ts +1 -1
- package/src/lit/column-renderer-directives.js +1 -1
- package/src/vaadin-grid-pro-edit-checkbox.js +1 -1
- package/src/vaadin-grid-pro-edit-column-mixin.d.ts +19 -1
- package/src/vaadin-grid-pro-edit-column-mixin.js +33 -10
- package/src/vaadin-grid-pro-edit-column.d.ts +1 -1
- package/src/vaadin-grid-pro-edit-column.js +1 -1
- package/src/vaadin-grid-pro-edit-select-mixin.js +1 -1
- package/src/vaadin-grid-pro-edit-select.js +1 -1
- package/src/vaadin-grid-pro-edit-text-field.js +1 -1
- package/src/vaadin-grid-pro-inline-editing-mixin.d.ts +1 -1
- package/src/vaadin-grid-pro-inline-editing-mixin.js +115 -57
- package/src/vaadin-grid-pro.d.ts +1 -1
- package/src/vaadin-grid-pro.js +1 -1
- package/src/vaadin-lit-grid-pro-edit-checkbox.js +2 -2
- package/src/vaadin-lit-grid-pro-edit-column.js +2 -2
- package/src/vaadin-lit-grid-pro-edit-select.js +2 -2
- package/src/vaadin-lit-grid-pro-edit-text-field.js +2 -2
- package/src/vaadin-lit-grid-pro.js +2 -2
- package/theme/lumo/vaadin-grid-pro-edit-checkbox.d.ts +2 -0
- package/theme/lumo/vaadin-grid-pro-edit-column.d.ts +4 -0
- package/theme/lumo/vaadin-grid-pro-edit-select-styles.d.ts +2 -0
- package/theme/lumo/vaadin-grid-pro-edit-select.d.ts +3 -0
- package/theme/lumo/vaadin-grid-pro-edit-text-field-styles.d.ts +1 -0
- package/theme/lumo/vaadin-grid-pro-edit-text-field.d.ts +3 -0
- package/theme/lumo/vaadin-grid-pro-editor-styles.d.ts +5 -0
- package/theme/lumo/vaadin-grid-pro-styles.d.ts +2 -0
- package/theme/lumo/vaadin-grid-pro.d.ts +3 -0
- package/theme/lumo/vaadin-lit-grid-pro-edit-checkbox.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-pro-edit-column.d.ts +4 -0
- package/theme/lumo/vaadin-lit-grid-pro-edit-select.d.ts +3 -0
- package/theme/lumo/vaadin-lit-grid-pro-edit-text-field.d.ts +3 -0
- package/theme/lumo/vaadin-lit-grid-pro.d.ts +3 -0
- package/theme/material/vaadin-grid-pro-edit-checkbox.d.ts +2 -0
- package/theme/material/vaadin-grid-pro-edit-column.d.ts +4 -0
- package/theme/material/vaadin-grid-pro-edit-select-styles.d.ts +1 -0
- package/theme/material/vaadin-grid-pro-edit-select.d.ts +3 -0
- package/theme/material/vaadin-grid-pro-edit-text-field-styles.d.ts +1 -0
- package/theme/material/vaadin-grid-pro-edit-text-field.d.ts +3 -0
- package/theme/material/vaadin-grid-pro-editor-styles.d.ts +2 -0
- package/theme/material/vaadin-grid-pro-styles.d.ts +2 -0
- package/theme/material/vaadin-grid-pro.d.ts +3 -0
- package/theme/material/vaadin-lit-grid-pro-edit-checkbox.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-pro-edit-column.d.ts +4 -0
- package/theme/material/vaadin-lit-grid-pro-edit-select.d.ts +3 -0
- package/theme/material/vaadin-lit-grid-pro-edit-text-field.d.ts +3 -0
- package/theme/material/vaadin-lit-grid-pro.d.ts +3 -0
- package/web-types.json +910 -0
- package/web-types.lit.json +489 -0
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@ An extension of the `vaadin-grid` component that provides inline editing with fu
|
|
|
7
7
|
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/grid-pro)
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@vaadin/grid-pro)
|
|
10
|
-
[](https://discord.gg/PHmkCKC)
|
|
11
10
|
|
|
12
11
|
```html
|
|
13
12
|
<vaadin-grid-pro>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid-pro",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.5.0-alpha1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
41
|
"@polymer/polymer": "^3.0.0",
|
|
42
|
-
"@vaadin/checkbox": "24.
|
|
43
|
-
"@vaadin/component-base": "24.
|
|
44
|
-
"@vaadin/grid": "24.
|
|
45
|
-
"@vaadin/lit-renderer": "24.
|
|
46
|
-
"@vaadin/select": "24.
|
|
47
|
-
"@vaadin/text-field": "24.
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "24.
|
|
49
|
-
"@vaadin/vaadin-material-styles": "24.
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "24.
|
|
42
|
+
"@vaadin/checkbox": "24.5.0-alpha1",
|
|
43
|
+
"@vaadin/component-base": "24.5.0-alpha1",
|
|
44
|
+
"@vaadin/grid": "24.5.0-alpha1",
|
|
45
|
+
"@vaadin/lit-renderer": "24.5.0-alpha1",
|
|
46
|
+
"@vaadin/select": "24.5.0-alpha1",
|
|
47
|
+
"@vaadin/text-field": "24.5.0-alpha1",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "24.5.0-alpha1",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "24.5.0-alpha1",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "24.5.0-alpha1",
|
|
51
51
|
"lit": "^3.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"web-types.json",
|
|
61
61
|
"web-types.lit.json"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "57806caac5468532a3b4e3dbdda730cd0fca193a"
|
|
64
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -58,6 +58,24 @@ export declare class GridProEditColumnMixinClass<TItem> {
|
|
|
58
58
|
*/
|
|
59
59
|
editorValuePath: string;
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* A function to check whether a specific cell of this column can be
|
|
63
|
+
* edited. This allows to disable editing of individual rows or cells,
|
|
64
|
+
* based on the item.
|
|
65
|
+
*
|
|
66
|
+
* Receives a `model` object containing the item for an individual row,
|
|
67
|
+
* and should return a boolean indicating whether the column's cell in
|
|
68
|
+
* that row is editable.
|
|
69
|
+
*
|
|
70
|
+
* The `model` object contains:
|
|
71
|
+
* - `model.index` The index of the item.
|
|
72
|
+
* - `model.item` The item.
|
|
73
|
+
* - `model.expanded` Sublevel toggle state.
|
|
74
|
+
* - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
|
|
75
|
+
* - `model.selected` Selected state.
|
|
76
|
+
*/
|
|
77
|
+
isCellEditable: (model: GridItemModel<TItem>) => boolean;
|
|
78
|
+
|
|
61
79
|
protected _getEditorComponent(cell: HTMLElement): HTMLElement | null;
|
|
62
80
|
|
|
63
81
|
protected _getEditorValue(editor: HTMLElement): unknown | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
9
|
* license.
|
|
10
10
|
*/
|
|
11
|
-
import { addValueToAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
12
11
|
import { get, set } from '@vaadin/component-base/src/path-utils.js';
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -84,13 +83,36 @@ export const GridProEditColumnMixin = (superClass) =>
|
|
|
84
83
|
sync: true,
|
|
85
84
|
},
|
|
86
85
|
|
|
86
|
+
/**
|
|
87
|
+
* A function to check whether a specific cell of this column can be
|
|
88
|
+
* edited. This allows to disable editing of individual rows or cells,
|
|
89
|
+
* based on the item.
|
|
90
|
+
*
|
|
91
|
+
* Receives a `model` object containing the item for an individual row,
|
|
92
|
+
* and should return a boolean indicating whether the column's cell in
|
|
93
|
+
* that row is editable.
|
|
94
|
+
*
|
|
95
|
+
* The `model` object contains:
|
|
96
|
+
* - `model.index` The index of the item.
|
|
97
|
+
* - `model.item` The item.
|
|
98
|
+
* - `model.expanded` Sublevel toggle state.
|
|
99
|
+
* - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
|
|
100
|
+
* - `model.selected` Selected state.
|
|
101
|
+
*
|
|
102
|
+
* @type {(model: GridItemModel) => boolean}
|
|
103
|
+
*/
|
|
104
|
+
isCellEditable: {
|
|
105
|
+
type: Function,
|
|
106
|
+
observer: '_isCellEditableChanged',
|
|
107
|
+
},
|
|
108
|
+
|
|
87
109
|
/** @private */
|
|
88
110
|
_oldRenderer: Function,
|
|
89
111
|
};
|
|
90
112
|
}
|
|
91
113
|
|
|
92
114
|
static get observers() {
|
|
93
|
-
return ['_editModeRendererChanged(editModeRenderer, __initialized)'
|
|
115
|
+
return ['_editModeRendererChanged(editModeRenderer, __initialized)'];
|
|
94
116
|
}
|
|
95
117
|
|
|
96
118
|
constructor() {
|
|
@@ -121,11 +143,9 @@ export const GridProEditColumnMixin = (superClass) =>
|
|
|
121
143
|
}
|
|
122
144
|
|
|
123
145
|
/** @private */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
addValueToAttribute(target, 'part', 'editable-cell');
|
|
128
|
-
});
|
|
146
|
+
_isCellEditableChanged(newValue, oldValue) {
|
|
147
|
+
// Re-render grid to update editable-cell part names
|
|
148
|
+
this._grid.requestContentUpdate();
|
|
129
149
|
}
|
|
130
150
|
|
|
131
151
|
/** @private */
|
|
@@ -267,8 +287,11 @@ export const GridProEditColumnMixin = (superClass) =>
|
|
|
267
287
|
this._setEditorValue(editor, get(this.path, model.item));
|
|
268
288
|
editor._grid = this._grid;
|
|
269
289
|
|
|
270
|
-
|
|
271
|
-
|
|
290
|
+
if (editor.updateComplete) {
|
|
291
|
+
editor.updateComplete.then(() => this._focusEditor(editor));
|
|
292
|
+
} else {
|
|
293
|
+
this._focusEditor(editor);
|
|
294
|
+
}
|
|
272
295
|
}
|
|
273
296
|
|
|
274
297
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { animationFrame } from '@vaadin/component-base/src/async.js';
|
|
12
12
|
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
13
13
|
import { get, set } from '@vaadin/component-base/src/path-utils.js';
|
|
14
|
+
import { iterateRowCells, updatePart } from '@vaadin/grid/src/vaadin-grid-helpers.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* @polymerMixin
|
|
@@ -119,15 +120,6 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
119
120
|
this.$.table.addEventListener('click', (e) => {
|
|
120
121
|
const column = this.getEventContext(e).column;
|
|
121
122
|
if (column && this._isEditColumn(column)) {
|
|
122
|
-
if (e.target.matches(':not([type=checkbox])')) {
|
|
123
|
-
// Prevents the `click` event from a column's cell in order to prevent making the cell's parent row active.
|
|
124
|
-
// Note, it should not prevent the `click` event from checkboxes. Otherwise, they will not respond to user interactions.
|
|
125
|
-
// Read more: https://github.com/vaadin/web-components/pull/2539#discussion_r712076433.
|
|
126
|
-
// TODO: Using `preventDefault()` for any other purpose than preventing the default browser's behavior is bad practice
|
|
127
|
-
// and therefore it would be great to refactor this part someday.
|
|
128
|
-
e.preventDefault();
|
|
129
|
-
}
|
|
130
|
-
|
|
131
123
|
if (this.editOnClick) {
|
|
132
124
|
this._enterEditFromEvent(e);
|
|
133
125
|
}
|
|
@@ -165,6 +157,20 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
165
157
|
}
|
|
166
158
|
}
|
|
167
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Prevents making an edit column cell's parent row active on click.
|
|
162
|
+
*
|
|
163
|
+
* @override
|
|
164
|
+
* @protected
|
|
165
|
+
*/
|
|
166
|
+
_shouldPreventCellActivationOnClick(e) {
|
|
167
|
+
return (
|
|
168
|
+
super._shouldPreventCellActivationOnClick(e) ||
|
|
169
|
+
// The clicked cell is editable
|
|
170
|
+
this._isEditColumn(this.getEventContext(e).column)
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
168
174
|
/**
|
|
169
175
|
* Override an observer from `DisabledMixin` to stop
|
|
170
176
|
* editing when grid element becomes disabled.
|
|
@@ -207,8 +213,7 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
207
213
|
const edited = this.__edited;
|
|
208
214
|
|
|
209
215
|
if (context.item && this._isEditColumn(column)) {
|
|
210
|
-
const
|
|
211
|
-
const cell = path[path.indexOf(this.$.table) - 3];
|
|
216
|
+
const { cell } = this._getGridEventLocation(e);
|
|
212
217
|
|
|
213
218
|
if (!cell || cell.getAttribute('part').indexOf('details-cell') > -1) {
|
|
214
219
|
return;
|
|
@@ -218,6 +223,10 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
218
223
|
return;
|
|
219
224
|
}
|
|
220
225
|
|
|
226
|
+
if (!this._isCellEditable(cell)) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
221
230
|
callback(e);
|
|
222
231
|
}
|
|
223
232
|
});
|
|
@@ -273,8 +282,7 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
273
282
|
const edited = this.__edited;
|
|
274
283
|
|
|
275
284
|
if (context.item && this._isEditColumn(column)) {
|
|
276
|
-
const
|
|
277
|
-
const cell = path[path.indexOf(this.$.table) - 3];
|
|
285
|
+
const { cell } = this._getGridEventLocation(e);
|
|
278
286
|
|
|
279
287
|
if (!cell || cell.getAttribute('part').indexOf('details-cell') > -1) {
|
|
280
288
|
return;
|
|
@@ -325,8 +333,10 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
325
333
|
|
|
326
334
|
/** @private */
|
|
327
335
|
_startEdit(cell, column) {
|
|
336
|
+
const isCellEditable = this._isCellEditable(cell);
|
|
337
|
+
|
|
328
338
|
// TODO: remove `_editingDisabled` after Flow counterpart is updated.
|
|
329
|
-
if (this.disabled || this._editingDisabled) {
|
|
339
|
+
if (this.disabled || this._editingDisabled || !isCellEditable) {
|
|
330
340
|
return;
|
|
331
341
|
}
|
|
332
342
|
// Cancel debouncer enqueued on focusout
|
|
@@ -421,59 +431,67 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
421
431
|
|
|
422
432
|
this._cancelStopEdit();
|
|
423
433
|
|
|
424
|
-
const
|
|
425
|
-
|
|
434
|
+
const editableColumns = this._getEditColumns();
|
|
426
435
|
const { cell, column, model } = this.__edited;
|
|
427
|
-
const colIndex = cols.indexOf(column);
|
|
428
|
-
const { index } = model;
|
|
429
|
-
|
|
430
|
-
let nextCol = null;
|
|
431
|
-
let nextIdx = index;
|
|
432
436
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
437
|
+
this._stopEdit();
|
|
438
|
+
e.preventDefault();
|
|
439
|
+
// Prevent vaadin-grid handler from being called
|
|
440
|
+
e.stopImmediatePropagation();
|
|
441
|
+
|
|
442
|
+
// Try to find the next editable cell
|
|
443
|
+
let nextIndex = model.index;
|
|
444
|
+
let nextColumn = column;
|
|
445
|
+
let nextCell = cell;
|
|
446
|
+
let directionX = 0;
|
|
447
|
+
let directionY = 0;
|
|
448
|
+
|
|
449
|
+
// Enter key: move up / down
|
|
450
|
+
if (e.keyCode === 13 && this.enterNextRow) {
|
|
451
|
+
directionY = e.shiftKey ? -1 : 1;
|
|
441
452
|
}
|
|
442
453
|
|
|
443
454
|
// Tab: move right / left
|
|
444
455
|
if (e.keyCode === 9) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
456
|
+
directionX = e.shiftKey ? -1 : 1;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (directionX || directionY) {
|
|
460
|
+
while (nextCell) {
|
|
461
|
+
if (directionX) {
|
|
462
|
+
// Move horizontally
|
|
463
|
+
nextColumn = editableColumns[editableColumns.indexOf(nextColumn) + directionX];
|
|
464
|
+
if (!nextColumn) {
|
|
465
|
+
// Wrap to the next or previous row
|
|
466
|
+
nextIndex += directionX;
|
|
467
|
+
nextColumn = editableColumns[directionX > 0 ? 0 : editableColumns.length - 1];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
// Move vertically
|
|
471
|
+
if (directionY) {
|
|
472
|
+
nextIndex += directionY;
|
|
473
|
+
}
|
|
474
|
+
// Stop looking if the next cell is editable
|
|
475
|
+
const nextRow = this._getRowByIndex(nextIndex);
|
|
476
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
|
477
|
+
nextCell = nextRow && Array.from(nextRow.children).find((cell) => cell._column === nextColumn);
|
|
478
|
+
if (nextCell && this._isCellEditable(nextCell)) {
|
|
479
|
+
break;
|
|
451
480
|
}
|
|
452
|
-
} else if (cols[colIndex + 1]) {
|
|
453
|
-
nextCol = cols[colIndex + 1];
|
|
454
|
-
} else {
|
|
455
|
-
nextIdx = index + 1;
|
|
456
|
-
nextCol = cols[0];
|
|
457
481
|
}
|
|
458
482
|
}
|
|
459
483
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
const nextCell = Array.from(nextRow.children).find((cell) => cell._column === nextCol);
|
|
466
|
-
e.preventDefault();
|
|
467
|
-
|
|
468
|
-
// Prevent vaadin-grid handler from being called
|
|
469
|
-
e.stopImmediatePropagation();
|
|
484
|
+
// Focus current cell as fallback
|
|
485
|
+
if (!nextCell) {
|
|
486
|
+
nextCell = cell;
|
|
487
|
+
nextIndex = model.index;
|
|
488
|
+
}
|
|
470
489
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
490
|
+
if (!this.singleCellEdit && nextCell !== cell) {
|
|
491
|
+
this._startEdit(nextCell, nextColumn);
|
|
492
|
+
} else {
|
|
493
|
+
this._ensureScrolledToIndex(nextIndex);
|
|
494
|
+
nextCell.focus();
|
|
477
495
|
}
|
|
478
496
|
}
|
|
479
497
|
|
|
@@ -492,6 +510,46 @@ export const InlineEditingMixin = (superClass) =>
|
|
|
492
510
|
super._updateItem(row, item);
|
|
493
511
|
}
|
|
494
512
|
|
|
513
|
+
/**
|
|
514
|
+
* Override method from `StylingMixin` to apply `editable-cell` part to the
|
|
515
|
+
* cells of edit columns.
|
|
516
|
+
*
|
|
517
|
+
* @override
|
|
518
|
+
*/
|
|
519
|
+
_generateCellPartNames(row, model) {
|
|
520
|
+
super._generateCellPartNames(row, model);
|
|
521
|
+
|
|
522
|
+
iterateRowCells(row, (cell) => {
|
|
523
|
+
const isEditable = this._isCellEditable(cell);
|
|
524
|
+
const target = cell._focusButton || cell;
|
|
525
|
+
updatePart(target, isEditable, 'editable-cell');
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** @private */
|
|
530
|
+
_isCellEditable(cell) {
|
|
531
|
+
const column = cell._column;
|
|
532
|
+
// Not editable if the column is not an edit column
|
|
533
|
+
if (!this._isEditColumn(column)) {
|
|
534
|
+
return false;
|
|
535
|
+
}
|
|
536
|
+
// Cell is editable by default if isCellEditable is not configured
|
|
537
|
+
if (!column.isCellEditable) {
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
// Otherwise, check isCellEditable function
|
|
541
|
+
const model = this.__getRowModel(cell.parentElement);
|
|
542
|
+
const isEditable = column.isCellEditable(model);
|
|
543
|
+
|
|
544
|
+
// Cancel editing if the cell is currently edited one and becomes no longer editable
|
|
545
|
+
// TODO: should be moved to `_updateItem` when Grid connector is updated to use it.
|
|
546
|
+
if (this.__edited && this.__edited.cell === cell && !isEditable) {
|
|
547
|
+
this._stopEdit(true, true);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return isEditable;
|
|
551
|
+
}
|
|
552
|
+
|
|
495
553
|
/**
|
|
496
554
|
* Fired before exiting the cell edit mode, if the value has been changed.
|
|
497
555
|
* If the default is prevented, value change would not be applied.
|
package/src/vaadin-grid-pro.d.ts
CHANGED
package/src/vaadin-grid-pro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -16,7 +16,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
16
16
|
*
|
|
17
17
|
* ## Disclaimer
|
|
18
18
|
*
|
|
19
|
-
* This component is an experiment not
|
|
19
|
+
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
20
|
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
21
|
*/
|
|
22
22
|
class GridProEditCheckbox extends Checkbox {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -20,7 +20,7 @@ import { GridProEditColumnMixin } from './vaadin-grid-pro-edit-column-mixin.js';
|
|
|
20
20
|
*
|
|
21
21
|
* ## Disclaimer
|
|
22
22
|
*
|
|
23
|
-
* This component is an experiment not
|
|
23
|
+
* This component is an experiment and not yet a part of Vaadin platform.
|
|
24
24
|
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
25
25
|
*/
|
|
26
26
|
class GridProEditColumn extends GridProEditColumnMixin(GridColumn) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -17,7 +17,7 @@ import { GridProEditSelectMixin } from './vaadin-grid-pro-edit-select-mixin.js';
|
|
|
17
17
|
*
|
|
18
18
|
* ## Disclaimer
|
|
19
19
|
*
|
|
20
|
-
* This component is an experiment not
|
|
20
|
+
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
21
|
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
22
|
*/
|
|
23
23
|
class GridProEditSelect extends GridProEditSelectMixin(Select) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -16,7 +16,7 @@ import { TextField } from '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
|
16
16
|
*
|
|
17
17
|
* ## Disclaimer
|
|
18
18
|
*
|
|
19
|
-
* This component is an experiment not
|
|
19
|
+
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
20
|
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
21
|
*/
|
|
22
22
|
class GridProEditText extends TextField {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -17,7 +17,7 @@ import { InlineEditingMixin } from './vaadin-grid-pro-inline-editing-mixin.js';
|
|
|
17
17
|
*
|
|
18
18
|
* ## Disclaimer
|
|
19
19
|
*
|
|
20
|
-
* This component is an experiment not
|
|
20
|
+
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
21
|
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
22
|
*/
|
|
23
23
|
class GridPro extends InlineEditingMixin(Grid) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|