@vaadin/grid-pro 25.2.0-alpha1 → 25.2.0-alpha11

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.
@@ -890,7 +890,7 @@
890
890
  "declarations": [
891
891
  {
892
892
  "kind": "class",
893
- "description": "\n`<vaadin-grid-pro>` is a high quality data grid / data table Web Component with extended functionality.\nIt extends `<vaadin-grid>` and adds extra features on top of the basic ones.\n\nSee [`<vaadin-grid>`](#/elements/vaadin-grid) documentation for details.\n\n```html\n<vaadin-grid-pro></vaadin-grid-pro>\n```\n\n### Internal components\n\nIn addition to `<vaadin-grid-pro>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-grid-pro-edit-checkbox>` - has the same API as [`<vaadin-checkbox>`](#/elements/vaadin-checkbox).\n- `<vaadin-grid-pro-edit-text-field>` - has the same API as [`<vaadin-text-field>`](#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](#/elements/vaadin-select).",
893
+ "description": "`<vaadin-grid-pro>` is a high quality data grid / data table Web Component with extended functionality.\nIt extends `<vaadin-grid>` and adds extra features on top of the basic ones.\n\nSee [`<vaadin-grid>`](#/elements/vaadin-grid) documentation for details.\n\n```html\n<vaadin-grid-pro></vaadin-grid-pro>\n```\n\n### Internal components\n\nIn addition to `<vaadin-grid-pro>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-grid-pro-edit-checkbox>` - has the same API as [`<vaadin-checkbox>`](#/elements/vaadin-checkbox).\n- `<vaadin-grid-pro-edit-text-field>` - has the same API as [`<vaadin-text-field>`](#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](#/elements/vaadin-select).",
894
894
  "name": "GridPro",
895
895
  "members": [
896
896
  {
@@ -1066,6 +1066,20 @@
1066
1066
  "package": "@vaadin/grid/src/vaadin-grid.js"
1067
1067
  }
1068
1068
  },
1069
+ {
1070
+ "kind": "field",
1071
+ "name": "disabled",
1072
+ "privacy": "public",
1073
+ "type": {
1074
+ "text": "boolean"
1075
+ },
1076
+ "description": "If true, the user cannot interact with this element.",
1077
+ "attribute": "disabled",
1078
+ "inheritedFrom": {
1079
+ "name": "DisabledMixin",
1080
+ "package": "@vaadin/a11y-base/src/disabled-mixin.js"
1081
+ }
1082
+ },
1069
1083
  {
1070
1084
  "kind": "field",
1071
1085
  "name": "dragFilter",
@@ -1532,11 +1546,6 @@
1532
1546
  "name": "Grid",
1533
1547
  "package": "@vaadin/grid/src/vaadin-grid.js"
1534
1548
  }
1535
- },
1536
- {
1537
- "kind": "field",
1538
- "name": "slotStyles",
1539
- "readonly": true
1540
1549
  }
1541
1550
  ],
1542
1551
  "events": [
@@ -1577,7 +1586,7 @@
1577
1586
  "type": {
1578
1587
  "text": "CustomEvent"
1579
1588
  },
1580
- "description": "Fired when a cell is focused with click or keyboard navigation.",
1589
+ "description": "Fired when a cell is focused with click or keyboard navigation. Use the `context` property to read event details.",
1581
1590
  "name": "cell-focus",
1582
1591
  "inheritedFrom": {
1583
1592
  "name": "Grid",
@@ -1666,7 +1675,7 @@
1666
1675
  "type": {
1667
1676
  "text": "CustomEvent"
1668
1677
  },
1669
- "description": "Fired before exiting the cell edit mode, if the value has been changed.",
1678
+ "description": "Fired before exiting cell edit mode if the value has been changed. If the default is prevented, the value change is not applied.",
1670
1679
  "inheritedFrom": {
1671
1680
  "name": "InlineEditingMixin",
1672
1681
  "module": "src/vaadin-grid-pro-inline-editing-mixin.js"
@@ -1818,6 +1827,18 @@
1818
1827
  "package": "@vaadin/grid/src/vaadin-grid.js"
1819
1828
  }
1820
1829
  },
1830
+ {
1831
+ "name": "disabled",
1832
+ "type": {
1833
+ "text": "boolean"
1834
+ },
1835
+ "description": "If true, the user cannot interact with this element.",
1836
+ "fieldName": "disabled",
1837
+ "inheritedFrom": {
1838
+ "name": "DisabledMixin",
1839
+ "package": "@vaadin/a11y-base/src/disabled-mixin.js"
1840
+ }
1841
+ },
1821
1842
  {
1822
1843
  "name": "drag-filter",
1823
1844
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid-pro",
3
- "version": "25.2.0-alpha1",
3
+ "version": "25.2.0-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,22 +37,22 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.2.0-alpha1",
41
- "@vaadin/checkbox": "25.2.0-alpha1",
42
- "@vaadin/component-base": "25.2.0-alpha1",
43
- "@vaadin/grid": "25.2.0-alpha1",
44
- "@vaadin/lit-renderer": "25.2.0-alpha1",
45
- "@vaadin/select": "25.2.0-alpha1",
46
- "@vaadin/text-field": "25.2.0-alpha1",
47
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha1",
40
+ "@vaadin/a11y-base": "25.2.0-alpha11",
41
+ "@vaadin/checkbox": "25.2.0-alpha11",
42
+ "@vaadin/component-base": "25.2.0-alpha11",
43
+ "@vaadin/grid": "25.2.0-alpha11",
44
+ "@vaadin/lit-renderer": "25.2.0-alpha11",
45
+ "@vaadin/select": "25.2.0-alpha11",
46
+ "@vaadin/text-field": "25.2.0-alpha11",
47
+ "@vaadin/vaadin-themable-mixin": "25.2.0-alpha11",
48
48
  "lit": "^3.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@vaadin/aura": "25.2.0-alpha1",
52
- "@vaadin/chai-plugins": "25.2.0-alpha1",
53
- "@vaadin/test-runner-commands": "25.2.0-alpha1",
51
+ "@vaadin/aura": "25.2.0-alpha11",
52
+ "@vaadin/chai-plugins": "25.2.0-alpha11",
53
+ "@vaadin/test-runner-commands": "25.2.0-alpha11",
54
54
  "@vaadin/testing-helpers": "^2.0.0",
55
- "@vaadin/vaadin-lumo-styles": "25.2.0-alpha1",
55
+ "@vaadin/vaadin-lumo-styles": "25.2.0-alpha11",
56
56
  "sinon": "^21.0.2"
57
57
  },
58
58
  "cvdlName": "vaadin-grid-pro",
@@ -61,5 +61,5 @@
61
61
  "web-types.json",
62
62
  "web-types.lit.json"
63
63
  ],
64
- "gitHead": "866f813f89655a351cbd25328eba1fcb317e267d"
64
+ "gitHead": "fdc37e932709f95491a027aeb2090911cb7528c6"
65
65
  }
@@ -4,16 +4,12 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
11
10
  import { getDeepActiveElement } from '@vaadin/a11y-base/src/focus-utils.js';
12
11
  import { get, set } from '@vaadin/component-base/src/path-utils.js';
13
12
 
14
- /**
15
- * @polymerMixin
16
- */
17
13
  export const GridProEditColumnMixin = (superClass) =>
18
14
  class extends superClass {
19
15
  static get properties() {
@@ -60,7 +56,6 @@ export const GridProEditColumnMixin = (superClass) =>
60
56
  */
61
57
  editorType: {
62
58
  type: String,
63
- notify: true, // FIXME(web-padawan): needed by Flow counterpart
64
59
  value: 'text',
65
60
  },
66
61
 
@@ -29,7 +29,9 @@ export * from './vaadin-grid-pro-edit-column-mixin.js';
29
29
  * ...
30
30
  * ```
31
31
  */
32
- declare class GridProEditColumn<TItem = GridDefaultItem> extends HTMLElement {}
32
+ declare class GridProEditColumn<TItem = GridDefaultItem> extends HTMLElement {
33
+ hidden: boolean;
34
+ }
33
35
 
34
36
  interface GridProEditColumn<TItem = GridDefaultItem>
35
37
  extends GridProEditColumnMixinClass<TItem>, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {}
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -32,7 +31,6 @@ import { GridProEditColumnMixin } from './vaadin-grid-pro-edit-column-mixin.js';
32
31
  *
33
32
  * @customElement vaadin-grid-pro-edit-column
34
33
  * @extends GridColumn
35
- * @mixes GridProEditColumnMixin
36
34
  */
37
35
  class GridProEditColumn extends GridProEditColumnMixin(GridColumn) {
38
36
  static get is() {
@@ -4,14 +4,10 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
11
10
 
12
- /**
13
- * @polymerMixin
14
- */
15
11
  export const GridProEditSelectMixin = (superClass) =>
16
12
  class extends superClass {
17
13
  static get properties() {
@@ -96,13 +92,13 @@ export const GridProEditSelectMixin = (superClass) =>
96
92
  }
97
93
 
98
94
  _optionsChanged(options) {
99
- if (options && options.length) {
95
+ if (options?.length) {
100
96
  this.items = options.map((option) => ({
101
97
  label: option,
102
98
  value: option,
103
99
  }));
104
100
 
105
- this._overlayElement = this._overlayElement || this.shadowRoot.querySelector('vaadin-select-overlay');
101
+ this._overlayElement ||= this.shadowRoot.querySelector('vaadin-select-overlay');
106
102
  this._overlayElement.addEventListener('vaadin-overlay-outside-click', () => {
107
103
  this._grid._stopEdit();
108
104
  });
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -17,7 +16,6 @@ import { GridProEditSelectMixin } from './vaadin-grid-pro-edit-select-mixin.js';
17
16
  *
18
17
  * @customElement vaadin-grid-pro-edit-select
19
18
  * @extends Select
20
- * @mixes GridProEditSelectMixin
21
19
  * @private
22
20
  */
23
21
  class GridProEditSelect extends GridProEditSelectMixin(Select) {
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -13,9 +12,6 @@ import { Debouncer } from '@vaadin/component-base/src/debounce.js';
13
12
  import { get, set } from '@vaadin/component-base/src/path-utils.js';
14
13
  import { iterateRowCells, updatePart } from '@vaadin/grid/src/vaadin-grid-helpers.js';
15
14
 
16
- /**
17
- * @polymerMixin
18
- */
19
15
  export const InlineEditingMixin = (superClass) =>
20
16
  class InlineEditingMixin extends superClass {
21
17
  static get properties() {
@@ -28,7 +24,6 @@ export const InlineEditingMixin = (superClass) =>
28
24
  */
29
25
  enterNextRow: {
30
26
  type: Boolean,
31
- notify: true, // FIXME(yuriy-fix): needed by Flow counterpart
32
27
  },
33
28
 
34
29
  /**
@@ -41,7 +36,6 @@ export const InlineEditingMixin = (superClass) =>
41
36
  */
42
37
  singleCellEdit: {
43
38
  type: Boolean,
44
- notify: true, // FIXME(yuriy-fix): needed by Flow counterpart
45
39
  },
46
40
 
47
41
  /**
@@ -230,7 +224,7 @@ export const InlineEditingMixin = (superClass) =>
230
224
  return;
231
225
  }
232
226
 
233
- if (edited && edited.cell === cell) {
227
+ if (edited?.cell === cell) {
234
228
  return;
235
229
  }
236
230
 
@@ -257,7 +251,7 @@ export const InlineEditingMixin = (superClass) =>
257
251
 
258
252
  /** @private */
259
253
  _isEditColumn(column) {
260
- return column && column.localName.toLowerCase() === 'vaadin-grid-pro-edit-column';
254
+ return column?.localName.toLowerCase() === 'vaadin-grid-pro-edit-column';
261
255
  }
262
256
 
263
257
  /** @private */
@@ -303,7 +297,7 @@ export const InlineEditingMixin = (superClass) =>
303
297
  return;
304
298
  }
305
299
 
306
- if (edited && edited.cell === cell && column._getEditorComponent(cell).contains(e.target)) {
300
+ if (edited?.cell === cell && column._getEditorComponent(cell).contains(e.target)) {
307
301
  return;
308
302
  }
309
303
 
@@ -325,6 +319,19 @@ export const InlineEditingMixin = (superClass) =>
325
319
  this._debouncerStopEdit = Debouncer.debounce(this._debouncerStopEdit, animationFrame, this._stopEdit.bind(this));
326
320
  }
327
321
 
322
+ /**
323
+ * Override method from ScrollMixin to stop editing if the edited cell
324
+ * is scrolled out of the view and removed from the DOM.
325
+ * @private
326
+ */
327
+ __updateColumnsBodyContentHidden() {
328
+ super.__updateColumnsBodyContentHidden();
329
+
330
+ if (this.__edited && !this.__edited.cell.isConnected) {
331
+ this._stopEdit(true, false);
332
+ }
333
+ }
334
+
328
335
  /** @private */
329
336
  __shouldIgnoreFocusOut(event) {
330
337
  const edited = this.__edited;
@@ -357,9 +364,11 @@ export const InlineEditingMixin = (superClass) =>
357
364
  // Cancel debouncer enqueued on focusout
358
365
  this._cancelStopEdit();
359
366
 
360
- this._scrollHorizontallyToCell(cell);
367
+ // Scroll column into view synchronously, which also triggers lazy column
368
+ // rendering to ensure cells for that column are in the DOM.
369
+ this.scrollToColumn(column);
361
370
 
362
- const model = this.__getRowModel(cell.parentElement);
371
+ const model = this.__getRowModel(cell.__parentRow);
363
372
  this.__edited = { cell, column, model };
364
373
  column._startCellEdit(cell, model);
365
374
 
@@ -448,7 +457,7 @@ export const InlineEditingMixin = (superClass) =>
448
457
 
449
458
  // Do not prevent Tab to allow native input blur and wait for it,
450
459
  // unless the keydown event is from the edit cell select overlay.
451
- if (e.key === 'Tab' && editor && editor.contains(e.target)) {
460
+ if (e.key === 'Tab' && editor?.contains(e.target)) {
452
461
  const ignore = await new Promise((resolve) => {
453
462
  editor.addEventListener(
454
463
  'focusout',
@@ -505,7 +514,7 @@ export const InlineEditingMixin = (superClass) =>
505
514
  // Stop looking if the next cell is editable
506
515
  const nextRow = this._getRowByIndex(nextIndex);
507
516
  // eslint-disable-next-line @typescript-eslint/no-loop-func
508
- nextCell = nextRow && Array.from(nextRow.children).find((cell) => cell._column === nextColumn);
517
+ nextCell = nextRow && Array.from(nextRow.__cells).find((cell) => cell._column === nextColumn);
509
518
  if (nextCell && this._isCellEditable(nextCell)) {
510
519
  break;
511
520
  }
@@ -537,7 +546,7 @@ export const InlineEditingMixin = (superClass) =>
537
546
  if (!this._isCellEditable(cell)) {
538
547
  // Cell is no longer editable, cancel edit
539
548
  this._stopEdit(true, true);
540
- } else if (cell.parentNode === row && item && this.getItemId(model.item) !== this.getItemId(item)) {
549
+ } else if (cell.__parentRow === row && item && this.getItemId(model.item) !== this.getItemId(item)) {
541
550
  // Edited item identity has changed, stop edit
542
551
  this._stopEdit();
543
552
  }
@@ -573,29 +582,7 @@ export const InlineEditingMixin = (superClass) =>
573
582
  return true;
574
583
  }
575
584
  // Otherwise, check isCellEditable function
576
- const model = this.__getRowModel(cell.parentElement);
585
+ const model = this.__getRowModel(cell.__parentRow);
577
586
  return column.isCellEditable(model);
578
587
  }
579
-
580
- /**
581
- * Fired before exiting the cell edit mode, if the value has been changed.
582
- * If the default is prevented, value change would not be applied.
583
- *
584
- * @event item-property-changed
585
- * @param {Object} detail
586
- * @param {Object} detail.index the row index of the edited cell
587
- * @param {Object} detail.item the grid item rendered to the row of the edited cell
588
- * @param {Object} detail.path the column path of the edited cell
589
- * @param {Object} detail.value the new value of the edited cell
590
- */
591
-
592
- /**
593
- * Fired when the user starts editing a grid cell.
594
- *
595
- * @event cell-edit-started
596
- * @param {Object} detail
597
- * @param {Object} detail.index the row index of the edited cell
598
- * @param {Object} detail.item the grid item rendered to the row of the edited cell
599
- * @param {Object} detail.path the column path of the edited cell
600
- */
601
588
  };
@@ -69,7 +69,7 @@ export interface GridProEventMap<TItem>
69
69
  * @fires {CustomEvent} grid-dragstart - Fired when starting to drag grid rows.
70
70
  * @fires {CustomEvent} grid-dragend - Fired when the dragging of the rows ends.
71
71
  * @fires {CustomEvent} grid-drop - Fired when a drop occurs on top of the grid.
72
- * @fires {CustomEvent} item-property-changed - Fired before exiting the cell edit mode, if the value has been changed.
72
+ * @fires {CustomEvent} item-property-changed - Fired before exiting cell edit mode if the value has been changed. If the default is prevented, the value change is not applied.
73
73
  * @fires {CustomEvent} loading-changed - Fired when the `loading` property changes.
74
74
  * @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
75
75
  */
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -15,7 +14,6 @@ import { gridProStyles } from './styles/vaadin-grid-pro-base-styles.js';
15
14
  import { InlineEditingMixin } from './vaadin-grid-pro-inline-editing-mixin.js';
16
15
 
17
16
  /**
18
- *
19
17
  * `<vaadin-grid-pro>` is a high quality data grid / data table Web Component with extended functionality.
20
18
  * It extends `<vaadin-grid>` and adds extra features on top of the basic ones.
21
19
  *
@@ -43,13 +41,12 @@ import { InlineEditingMixin } from './vaadin-grid-pro-inline-editing-mixin.js';
43
41
  * @fires {CustomEvent} grid-dragstart - Fired when starting to drag grid rows.
44
42
  * @fires {CustomEvent} grid-dragend - Fired when the dragging of the rows ends.
45
43
  * @fires {CustomEvent} grid-drop - Fired when a drop occurs on top of the grid.
46
- * @fires {CustomEvent} item-property-changed - Fired before exiting the cell edit mode, if the value has been changed.
44
+ * @fires {CustomEvent} item-property-changed - Fired before exiting cell edit mode if the value has been changed. If the default is prevented, the value change is not applied.
47
45
  * @fires {CustomEvent} loading-changed - Fired when the `loading` property changes.
48
46
  * @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
49
47
  *
50
48
  * @customElement vaadin-grid-pro
51
49
  * @extends Grid
52
- * @mixes InlineEditingMixin
53
50
  */
54
51
  class GridPro extends SlotStylesMixin(InlineEditingMixin(Grid)) {
55
52
  static get is() {