@vaadin/grid-pro 24.4.0-rc1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid-pro",
3
- "version": "24.4.0-rc1",
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.4.0-rc1",
43
- "@vaadin/component-base": "24.4.0-rc1",
44
- "@vaadin/grid": "24.4.0-rc1",
45
- "@vaadin/lit-renderer": "24.4.0-rc1",
46
- "@vaadin/select": "24.4.0-rc1",
47
- "@vaadin/text-field": "24.4.0-rc1",
48
- "@vaadin/vaadin-lumo-styles": "24.4.0-rc1",
49
- "@vaadin/vaadin-material-styles": "24.4.0-rc1",
50
- "@vaadin/vaadin-themable-mixin": "24.4.0-rc1",
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": "a81e3b927d44c56613fa4e1307494a2acc81005f"
63
+ "gitHead": "57806caac5468532a3b4e3dbdda730cd0fca193a"
64
64
  }
@@ -120,15 +120,6 @@ export const InlineEditingMixin = (superClass) =>
120
120
  this.$.table.addEventListener('click', (e) => {
121
121
  const column = this.getEventContext(e).column;
122
122
  if (column && this._isEditColumn(column)) {
123
- if (e.target.matches(':not([type=checkbox])')) {
124
- // Prevents the `click` event from a column's cell in order to prevent making the cell's parent row active.
125
- // Note, it should not prevent the `click` event from checkboxes. Otherwise, they will not respond to user interactions.
126
- // Read more: https://github.com/vaadin/web-components/pull/2539#discussion_r712076433.
127
- // TODO: Using `preventDefault()` for any other purpose than preventing the default browser's behavior is bad practice
128
- // and therefore it would be great to refactor this part someday.
129
- e.preventDefault();
130
- }
131
-
132
123
  if (this.editOnClick) {
133
124
  this._enterEditFromEvent(e);
134
125
  }
@@ -166,6 +157,20 @@ export const InlineEditingMixin = (superClass) =>
166
157
  }
167
158
  }
168
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
+
169
174
  /**
170
175
  * Override an observer from `DisabledMixin` to stop
171
176
  * editing when grid element becomes disabled.
@@ -208,8 +213,7 @@ export const InlineEditingMixin = (superClass) =>
208
213
  const edited = this.__edited;
209
214
 
210
215
  if (context.item && this._isEditColumn(column)) {
211
- const path = e.composedPath();
212
- const cell = path[path.indexOf(this.$.table) - 3];
216
+ const { cell } = this._getGridEventLocation(e);
213
217
 
214
218
  if (!cell || cell.getAttribute('part').indexOf('details-cell') > -1) {
215
219
  return;
@@ -278,8 +282,7 @@ export const InlineEditingMixin = (superClass) =>
278
282
  const edited = this.__edited;
279
283
 
280
284
  if (context.item && this._isEditColumn(column)) {
281
- const path = e.composedPath();
282
- const cell = path[path.indexOf(this.$.table) - 3];
285
+ const { cell } = this._getGridEventLocation(e);
283
286
 
284
287
  if (!cell || cell.getAttribute('part').indexOf('details-cell') > -1) {
285
288
  return;
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": "24.4.0-rc1",
4
+ "version": "24.5.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -105,7 +105,7 @@
105
105
  },
106
106
  {
107
107
  "name": "width",
108
- "description": "Width of the cells for this column.",
108
+ "description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
109
109
  "value": {
110
110
  "type": [
111
111
  "string",
@@ -292,7 +292,7 @@
292
292
  },
293
293
  {
294
294
  "name": "width",
295
- "description": "Width of the cells for this column.",
295
+ "description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
296
296
  "value": {
297
297
  "type": [
298
298
  "string",
@@ -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/24.4.0-rc1/#/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/24.4.0-rc1/#/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/24.4.0-rc1/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/24.4.0-rc1/#/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/24.5.0-alpha1/#/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/24.5.0-alpha1/#/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/24.5.0-alpha1/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-alpha1/#/elements/vaadin-select).",
405
405
  "attributes": [
406
406
  {
407
407
  "name": "size",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/grid-pro",
4
- "version": "24.4.0-rc1",
4
+ "version": "24.5.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -105,7 +105,7 @@
105
105
  },
106
106
  {
107
107
  "name": ".width",
108
- "description": "Width of the cells for this column.",
108
+ "description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
109
109
  "value": {
110
110
  "kind": "expression"
111
111
  }
@@ -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/24.4.0-rc1/#/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/24.4.0-rc1/#/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/24.4.0-rc1/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/24.4.0-rc1/#/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/24.5.0-alpha1/#/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/24.5.0-alpha1/#/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/24.5.0-alpha1/#/elements/vaadin-text-field).\n- `<vaadin-grid-pro-edit-select>` - has the same API as [`<vaadin-select>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-alpha1/#/elements/vaadin-select).",
181
181
  "extension": true,
182
182
  "attributes": [
183
183
  {