@vaadin/grid-pro 25.0.0-alpha7 → 25.0.0-alpha9

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-pro",
3
- "version": "25.0.0-alpha7",
3
+ "version": "25.0.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,6 +23,8 @@
23
23
  "lit.d.ts",
24
24
  "lit.js",
25
25
  "src",
26
+ "!src/styles/*-base-styles.d.ts",
27
+ "!src/styles/*-base-styles.js",
26
28
  "theme",
27
29
  "vaadin-*.d.ts",
28
30
  "vaadin-*.js",
@@ -37,19 +39,19 @@
37
39
  ],
38
40
  "dependencies": {
39
41
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/checkbox": "25.0.0-alpha7",
41
- "@vaadin/component-base": "25.0.0-alpha7",
42
- "@vaadin/grid": "25.0.0-alpha7",
43
- "@vaadin/lit-renderer": "25.0.0-alpha7",
44
- "@vaadin/select": "25.0.0-alpha7",
45
- "@vaadin/text-field": "25.0.0-alpha7",
46
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha7",
47
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha7",
42
+ "@vaadin/checkbox": "25.0.0-alpha9",
43
+ "@vaadin/component-base": "25.0.0-alpha9",
44
+ "@vaadin/grid": "25.0.0-alpha9",
45
+ "@vaadin/lit-renderer": "25.0.0-alpha9",
46
+ "@vaadin/select": "25.0.0-alpha9",
47
+ "@vaadin/text-field": "25.0.0-alpha9",
48
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
49
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
48
50
  "lit": "^3.0.0"
49
51
  },
50
52
  "devDependencies": {
51
- "@vaadin/chai-plugins": "25.0.0-alpha7",
52
- "@vaadin/test-runner-commands": "25.0.0-alpha7",
53
+ "@vaadin/chai-plugins": "25.0.0-alpha9",
54
+ "@vaadin/test-runner-commands": "25.0.0-alpha9",
53
55
  "@vaadin/testing-helpers": "^2.0.0",
54
56
  "sinon": "^18.0.0"
55
57
  },
@@ -58,5 +60,5 @@
58
60
  "web-types.json",
59
61
  "web-types.lit.json"
60
62
  ],
61
- "gitHead": "87f72707ce6866892f8be5782fa0da008e87dcbc"
63
+ "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
62
64
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export const gridProStyles: CSSResult;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import '@vaadin/component-base/src/style-props.js';
12
+ import { css } from 'lit';
13
+ import { gridStyles } from '@vaadin/grid/src/styles/vaadin-grid-base-styles.js';
14
+
15
+ const gridPro = css`
16
+ [part~='body-cell'] {
17
+ --_highlight-color: color-mix(in srgb, currentColor 5%, transparent);
18
+ --_highlight-color2: color-mix(in srgb, currentColor 10%, transparent);
19
+ --_highlight-bg: linear-gradient(var(--_highlight-color), var(--_highlight-color));
20
+ }
21
+
22
+ [part~='editable-cell'] {
23
+ display: flex;
24
+ align-items: inherit;
25
+ align-self: stretch;
26
+ flex: 1;
27
+ min-width: 0;
28
+ cursor: var(--vaadin-clickable-cursor);
29
+ outline: 0;
30
+ }
31
+
32
+ [part~='editable-cell']:hover,
33
+ :host([navigating]) [part~='editable-cell']:focus {
34
+ background: var(--vaadin-grid-pro-editable-cell-background-hover, var(--_highlight-bg));
35
+ }
36
+
37
+ /* Indicate editable cells */
38
+
39
+ :host([theme~='highlight-editable-cells']) [part~='editable-cell'] {
40
+ background: var(--vaadin-grid-pro-editable-cell-background, var(--_highlight-bg));
41
+ }
42
+
43
+ :host([theme~='highlight-editable-cells']) [part~='editable-cell']:is(:hover, :focus-visible) {
44
+ background:
45
+ var(--vaadin-grid-pro-editable-cell-background-hover, var(--_highlight-bg)),
46
+ var(--vaadin-grid-pro-editable-cell-background, var(--_highlight-bg));
47
+ }
48
+
49
+ /* Indicate read-only cells */
50
+
51
+ /* prettier-ignore */
52
+ :host([theme~='highlight-read-only-cells']) [part~='body-cell']:not(:has([part~='editable-cell'])) {
53
+ --vaadin-grid-cell-background-hover: repeating-linear-gradient(
54
+ -45deg,
55
+ transparent,
56
+ transparent 30%,
57
+ var(--_highlight-color2) 30%,
58
+ var(--_highlight-color2) 50%
59
+ );
60
+ background-size: 6px 6px;
61
+ }
62
+
63
+ /* Loading editor cell styles are used by Flow GridPro */
64
+ :host([loading-editor]) [part~='focused-cell']::before {
65
+ content: '';
66
+ position: absolute;
67
+ inset: 0;
68
+ pointer-events: none;
69
+ box-shadow: inset 0 0 0 var(--vaadin-focus-ring-width) var(--vaadin-focus-ring-color);
70
+ animation: loading-editor 1.4s infinite;
71
+ opacity: 0;
72
+ }
73
+
74
+ @keyframes loading-editor {
75
+ 50% {
76
+ opacity: 1;
77
+ }
78
+ }
79
+
80
+ [part~='updating-cell']::after {
81
+ content: '';
82
+ position: absolute;
83
+ inset: var(--_cell-padding);
84
+ margin: var(--vaadin-focus-ring-width);
85
+ border-radius: 4px;
86
+ background-size: max(4em, 50%);
87
+ background-repeat: no-repeat;
88
+ background-position: min(-200%, -4em) 0;
89
+ background-image: linear-gradient(90deg, transparent, currentColor, transparent);
90
+ animation: updating-cell 1.3s ease-out infinite;
91
+ opacity: 0.1;
92
+ }
93
+
94
+ @keyframes updating-cell {
95
+ 100% {
96
+ background-position: max(300%, 8em) 0;
97
+ }
98
+ }
99
+ `;
100
+
101
+ export const gridProStyles = [gridPro, gridStyles];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export const gridProStyles: CSSResult;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import { gridStyles } from '@vaadin/grid/src/styles/vaadin-grid-core-styles.js';
12
+
13
+ export const gridProStyles = gridStyles;
@@ -8,6 +8,7 @@
8
8
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
9
  * license.
10
10
  */
11
+ import { getDeepActiveElement } from '@vaadin/a11y-base/src/focus-utils.js';
11
12
  import { get, set } from '@vaadin/component-base/src/path-utils.js';
12
13
 
13
14
  /**
@@ -290,6 +291,16 @@ export const GridProEditColumnMixin = (superClass) =>
290
291
  } else {
291
292
  this._focusEditor(editor);
292
293
  }
294
+
295
+ if (this.editorType === 'custom') {
296
+ editor.addEventListener('opened-changed', (event) => {
297
+ const element = event.target;
298
+ const activeElement = getDeepActiveElement();
299
+ if (!element.opened && !element.contains(activeElement)) {
300
+ this._grid._stopEdit();
301
+ }
302
+ });
303
+ }
293
304
  }
294
305
 
295
306
  /**
@@ -543,17 +543,17 @@ export const InlineEditingMixin = (superClass) =>
543
543
 
544
544
  /**
545
545
  * @param {!HTMLElement} row
546
- * @param {GridItem} item
547
- * @protected
546
+ * @private
548
547
  */
549
- _updateItem(row, item) {
548
+ __updateRow(row) {
549
+ const item = this.__getRowItem(row);
550
550
  if (this.__edited) {
551
551
  const { cell, model } = this.__edited;
552
552
  if (cell.parentNode === row && model.item !== item) {
553
553
  this._stopEdit();
554
554
  }
555
555
  }
556
- super._updateItem(row, item);
556
+ super.__updateRow(row, item);
557
557
  }
558
558
 
559
559
  /**
@@ -588,7 +588,7 @@ export const InlineEditingMixin = (superClass) =>
588
588
  const isEditable = column.isCellEditable(model);
589
589
 
590
590
  // Cancel editing if the cell is currently edited one and becomes no longer editable
591
- // TODO: should be moved to `_updateItem` when Grid connector is updated to use it.
591
+ // TODO: should be moved to `__updateRow` when Grid connector is updated to use it.
592
592
  if (this.__edited && this.__edited.cell === cell && !isEditable) {
593
593
  this._stopEdit(true, true);
594
594
  }
@@ -49,7 +49,7 @@ export interface GridProEventMap<TItem>
49
49
  *
50
50
  * See [`<vaadin-grid>`](#/elements/vaadin-grid) documentation for details.
51
51
  *
52
- * ```
52
+ * ```html
53
53
  * <vaadin-grid-pro></vaadin-grid-pro>
54
54
  * ```
55
55
  *
@@ -9,7 +9,9 @@
9
9
  * license.
10
10
  */
11
11
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
12
+ import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
12
13
  import { Grid } from '@vaadin/grid/src/vaadin-grid.js';
14
+ import { gridProStyles } from './styles/vaadin-grid-pro-core-styles.js';
13
15
  import { InlineEditingMixin } from './vaadin-grid-pro-inline-editing-mixin.js';
14
16
 
15
17
  /**
@@ -19,7 +21,7 @@ import { InlineEditingMixin } from './vaadin-grid-pro-inline-editing-mixin.js';
19
21
  *
20
22
  * See [`<vaadin-grid>`](#/elements/vaadin-grid) documentation for details.
21
23
  *
22
- * ```
24
+ * ```html
23
25
  * <vaadin-grid-pro></vaadin-grid-pro>
24
26
  * ```
25
27
  *
@@ -49,7 +51,7 @@ import { InlineEditingMixin } from './vaadin-grid-pro-inline-editing-mixin.js';
49
51
  * @extends Grid
50
52
  * @mixes InlineEditingMixin
51
53
  */
52
- class GridPro extends InlineEditingMixin(Grid) {
54
+ class GridPro extends SlotStylesMixin(InlineEditingMixin(Grid)) {
53
55
  static get is() {
54
56
  return 'vaadin-grid-pro';
55
57
  }
@@ -57,6 +59,34 @@ class GridPro extends InlineEditingMixin(Grid) {
57
59
  static get cvdlName() {
58
60
  return 'vaadin-grid-pro';
59
61
  }
62
+
63
+ static get styles() {
64
+ return gridProStyles;
65
+ }
66
+
67
+ get slotStyles() {
68
+ const tag = this.localName;
69
+
70
+ return [
71
+ `
72
+ ${tag} [theme="grid-pro-editor"] {
73
+ --vaadin-input-field-border-radius: 0px;
74
+ --vaadin-input-field-border-width: 0px;
75
+ width: 100%;
76
+ }
77
+
78
+ ${tag} [theme="grid-pro-editor"]::part(input-field) {
79
+ height: 100%;
80
+ outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
81
+ }
82
+
83
+ vaadin-grid-cell-content:has([theme="grid-pro-editor"]) {
84
+ padding: 0;
85
+ overflow: visible;
86
+ }
87
+ `,
88
+ ];
89
+ }
60
90
  }
61
91
 
62
92
  defineCustomElement(GridPro);
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/grid-pro",
4
- "version": "25.0.0-alpha7",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -401,7 +401,7 @@
401
401
  },
402
402
  {
403
403
  "name": "vaadin-grid-pro",
404
- "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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-grid) documentation for details.\n\n```\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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-checkbox).\n- `<vaadin-grid-pro-edit-text-field>` - has the same API as [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-select).",
404
+ "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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-checkbox).\n- `<vaadin-grid-pro-edit-text-field>` - has the same API as [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-select).",
405
405
  "attributes": [
406
406
  {
407
407
  "name": "accessible-name",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/grid-pro",
4
- "version": "25.0.0-alpha7",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -177,7 +177,7 @@
177
177
  },
178
178
  {
179
179
  "name": "vaadin-grid-pro",
180
- "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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-grid) documentation for details.\n\n```\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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-checkbox).\n- `<vaadin-grid-pro-edit-text-field>` - has the same API as [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-select).",
180
+ "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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/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>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-checkbox).\n- `<vaadin-grid-pro-edit-text-field>` - has the same API as [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-select).",
181
181
  "extension": true,
182
182
  "attributes": [
183
183
  {