@vaadin/grid-pro 24.10.5 → 24.10.7

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.10.5",
3
+ "version": "24.10.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,20 +39,20 @@
39
39
  "dependencies": {
40
40
  "@open-wc/dedupe-mixin": "^1.3.0",
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/checkbox": "~24.10.5",
43
- "@vaadin/component-base": "~24.10.5",
44
- "@vaadin/grid": "~24.10.5",
45
- "@vaadin/lit-renderer": "~24.10.5",
46
- "@vaadin/select": "~24.10.5",
47
- "@vaadin/text-field": "~24.10.5",
48
- "@vaadin/vaadin-lumo-styles": "~24.10.5",
49
- "@vaadin/vaadin-material-styles": "~24.10.5",
50
- "@vaadin/vaadin-themable-mixin": "~24.10.5",
42
+ "@vaadin/checkbox": "~24.10.7",
43
+ "@vaadin/component-base": "~24.10.7",
44
+ "@vaadin/grid": "~24.10.7",
45
+ "@vaadin/lit-renderer": "~24.10.7",
46
+ "@vaadin/select": "~24.10.7",
47
+ "@vaadin/text-field": "~24.10.7",
48
+ "@vaadin/vaadin-lumo-styles": "~24.10.7",
49
+ "@vaadin/vaadin-material-styles": "~24.10.7",
50
+ "@vaadin/vaadin-themable-mixin": "~24.10.7",
51
51
  "lit": "^3.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@vaadin/chai-plugins": "~24.10.5",
55
- "@vaadin/test-runner-commands": "~24.10.5",
54
+ "@vaadin/chai-plugins": "~24.10.7",
55
+ "@vaadin/test-runner-commands": "~24.10.7",
56
56
  "@vaadin/testing-helpers": "^1.1.0",
57
57
  "sinon": "^18.0.0"
58
58
  },
@@ -61,5 +61,5 @@
61
61
  "web-types.json",
62
62
  "web-types.lit.json"
63
63
  ],
64
- "gitHead": "58e7810171be7423aab5c5caefbf67f62074c796"
64
+ "gitHead": "76ffc73953fac4a5f24942460dc149f04501f5ad"
65
65
  }
@@ -363,15 +363,27 @@ export const InlineEditingMixin = (superClass) =>
363
363
 
364
364
  /** @private */
365
365
  _startEdit(cell, column) {
366
- const isCellEditable = this._isCellEditable(cell);
367
-
368
366
  // TODO: remove `_editingDisabled` after Flow counterpart is updated.
369
- if (this.disabled || this._editingDisabled || !isCellEditable) {
367
+ if (this.disabled || this._editingDisabled || !this._isCellEditable(cell)) {
370
368
  return;
371
369
  }
372
- // Cancel debouncer enqueued on focusout
370
+
371
+ // Unfocusable editors never fire focusout, so no stop was scheduled.
372
+ // Stop the previous edit here.
373
+ if (this.__edited && this.__edited.cell !== cell) {
374
+ this._stopEdit();
375
+ }
376
+
377
+ // Cancel debouncer enqueued on focusout, including one enqueued by the
378
+ // blur() in the stop above
373
379
  this._cancelStopEdit();
374
380
 
381
+ // Stopping the previous edit runs listeners that may have made this cell
382
+ // non-editable
383
+ if (!this._isCellEditable(cell)) {
384
+ return;
385
+ }
386
+
375
387
  this._scrollHorizontallyToCell(cell);
376
388
 
377
389
  const model = this.__getRowModel(cell.parentElement);
@@ -400,42 +412,49 @@ export const InlineEditingMixin = (superClass) =>
400
412
  if (!this.__edited) {
401
413
  return;
402
414
  }
415
+ if (this.__stoppingEdit) {
416
+ // `item-property-changed` listeners may re-render and re-enter here
417
+ // before `__edited` is cleared, so ignore nested calls, including cancels
418
+ return;
419
+ }
403
420
  const { cell, column, model } = this.__edited;
404
-
405
- if (!shouldCancel && !this.hasAttribute('loading-editor')) {
406
- const editor = column._getEditorComponent(cell);
407
- if (editor) {
408
- const value = column._getEditorValue(editor);
409
- if (value !== get(column.path, model.item)) {
410
- // In some cases, where the value comes from the editor's change
411
- // event (eg. custom editor in vaadin-grid-pro-flow), the event is
412
- // not dispatched in FF/Safari/Edge. That's due the change event
413
- // doesn't occur when the editor is removed from the DOM. Manually
414
- // calling blur makes the event to be dispatched.
415
- editor.blur();
416
-
417
- this.dispatchEvent(
418
- new CustomEvent('item-property-changed', {
419
- detail: {
420
- index: model.index,
421
- item: model.item,
422
- path: column.path,
423
- value,
424
- },
425
- bubbles: true,
426
- cancelable: true,
427
- composed: true,
428
- }),
429
- );
421
+ this.__stoppingEdit = true;
422
+
423
+ try {
424
+ if (!shouldCancel && !this.hasAttribute('loading-editor')) {
425
+ const editor = column._getEditorComponent(cell);
426
+ if (editor) {
427
+ const value = column._getEditorValue(editor);
428
+ if (value !== get(column.path, model.item)) {
429
+ // Some browsers skip the change event when the editor is
430
+ // removed from the DOM, so blur to dispatch it.
431
+ editor.blur();
432
+
433
+ this.dispatchEvent(
434
+ new CustomEvent('item-property-changed', {
435
+ detail: {
436
+ index: model.index,
437
+ item: model.item,
438
+ path: column.path,
439
+ value,
440
+ },
441
+ bubbles: true,
442
+ cancelable: true,
443
+ composed: true,
444
+ }),
445
+ );
446
+ }
430
447
  }
431
448
  }
432
- }
433
449
 
434
- column._stopCellEdit(cell, model);
450
+ column._stopCellEdit(cell, model);
435
451
 
436
- this.__edited = null;
452
+ this.__edited = null;
437
453
 
438
- this.removeEventListener('item-property-changed', this.__boundItemPropertyChanged);
454
+ this.removeEventListener('item-property-changed', this.__boundItemPropertyChanged);
455
+ } finally {
456
+ this.__stoppingEdit = false;
457
+ }
439
458
 
440
459
  if (shouldRestoreFocus) {
441
460
  cell.focus();
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.10.5",
4
+ "version": "24.10.7",
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/24.10.5/#/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.10.5/#/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.10.5/#/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.10.5/#/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.10.7/#/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.10.7/#/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.10.7/#/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.10.7/#/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": "24.10.5",
4
+ "version": "24.10.7",
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/24.10.5/#/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.10.5/#/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.10.5/#/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.10.5/#/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.10.7/#/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.10.7/#/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.10.7/#/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.10.7/#/elements/vaadin-select).",
181
181
  "extension": true,
182
182
  "attributes": [
183
183
  {