@vaadin/grid 23.0.1 → 23.0.4

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",
3
- "version": "23.0.1",
3
+ "version": "23.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,19 +41,19 @@
41
41
  "dependencies": {
42
42
  "@open-wc/dedupe-mixin": "^1.3.0",
43
43
  "@polymer/polymer": "^3.0.0",
44
- "@vaadin/checkbox": "^23.0.1",
45
- "@vaadin/component-base": "^23.0.1",
46
- "@vaadin/text-field": "^23.0.1",
47
- "@vaadin/vaadin-lumo-styles": "^23.0.1",
48
- "@vaadin/vaadin-material-styles": "^23.0.1",
49
- "@vaadin/vaadin-themable-mixin": "^23.0.1"
44
+ "@vaadin/checkbox": "^23.0.4",
45
+ "@vaadin/component-base": "^23.0.4",
46
+ "@vaadin/text-field": "^23.0.4",
47
+ "@vaadin/vaadin-lumo-styles": "^23.0.4",
48
+ "@vaadin/vaadin-material-styles": "^23.0.4",
49
+ "@vaadin/vaadin-themable-mixin": "^23.0.4"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@esm-bundle/chai": "^4.3.4",
53
- "@vaadin/polymer-legacy-adapter": "^23.0.1",
53
+ "@vaadin/polymer-legacy-adapter": "^23.0.4",
54
54
  "@vaadin/testing-helpers": "^0.3.2",
55
55
  "lit": "^2.0.0",
56
56
  "sinon": "^9.2.0"
57
57
  },
58
- "gitHead": "05fcc6daa21325753cf528c9c1072ccd8dd1e52e"
58
+ "gitHead": "d8db2046661c42fb5aac09ed683b500bf4613b26"
59
59
  }
@@ -57,7 +57,7 @@ export const ColumnResizingMixin = (superClass) =>
57
57
  const targetCell = columnRowCells.filter((cell) => cell._column === column)[0];
58
58
  // Resize the target column
59
59
  if (targetCell.offsetWidth) {
60
- const style = window.getComputedStyle(targetCell);
60
+ const style = getComputedStyle(targetCell._content);
61
61
  const minWidth =
62
62
  10 +
63
63
  parseInt(style.paddingLeft) +
@@ -91,6 +91,9 @@ export const KeyboardNavigationMixin = (superClass) =>
91
91
  this.addEventListener('mousedown', () => {
92
92
  this.toggleAttribute('navigating', false);
93
93
  this._isMousedown = true;
94
+
95
+ // Reset stored order when moving focus with mouse.
96
+ this._focusedColumnOrder = undefined;
94
97
  });
95
98
  this.addEventListener('mouseup', () => (this._isMousedown = false));
96
99
  }
@@ -81,6 +81,7 @@ class GridTreeToggle extends ThemableMixin(DirMixin(PolymerElement)) {
81
81
  :host {
82
82
  display: inline-flex;
83
83
  align-items: baseline;
84
+ max-width: 100%;
84
85
 
85
86
  /* CSS API for :host */
86
87
  --vaadin-grid-tree-toggle-level-offset: 1em;
@@ -125,6 +126,12 @@ class GridTreeToggle extends ThemableMixin(DirMixin(PolymerElement)) {
125
126
  :host([leaf]) [part='toggle'] {
126
127
  visibility: hidden;
127
128
  }
129
+
130
+ slot {
131
+ display: block;
132
+ overflow: hidden;
133
+ text-overflow: ellipsis;
134
+ }
128
135
  </style>
129
136
 
130
137
  <span id="level-spacer"></span>
@@ -7,7 +7,7 @@ import './vaadin-grid-column.js';
7
7
  import './vaadin-grid-styles.js';
8
8
  import { beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
9
9
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
10
- import { isAndroid, isFirefox, isIOS, isSafari, isTouch } from '@vaadin/component-base/src/browser-utils.js';
10
+ import { isAndroid, isChrome, isFirefox, isIOS, isSafari, isTouch } from '@vaadin/component-base/src/browser-utils.js';
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
12
  import { TabindexMixin } from '@vaadin/component-base/src/tabindex-mixin.js';
13
13
  import { processTemplates } from '@vaadin/component-base/src/templates.js';
@@ -685,13 +685,16 @@ class Grid extends ElementMixin(
685
685
  // focusable slot wrapper, that is why cells are not focused with
686
686
  // mousedown. Workaround: listen for mousedown and focus manually.
687
687
  cellContent.addEventListener('mousedown', () => {
688
- if (window.chrome) {
688
+ if (isChrome) {
689
689
  // Chrome bug: focusing before mouseup prevents text selection, see http://crbug.com/771903
690
- const mouseUpListener = () => {
691
- if (!cellContent.contains(this.getRootNode().activeElement)) {
690
+ const mouseUpListener = (event) => {
691
+ // If focus is on element within the cell content — respect it, do not change
692
+ const contentContainsFocusedElement = cellContent.contains(this.getRootNode().activeElement);
693
+ // Only focus if mouse is released on cell content itself
694
+ const mouseUpWithinCell = cellContent.contains(event.target);
695
+ if (!contentContainsFocusedElement && mouseUpWithinCell) {
692
696
  cell.focus();
693
697
  }
694
- // If focus is in the cell content — respect it, do not change.
695
698
  document.removeEventListener('mouseup', mouseUpListener, true);
696
699
  };
697
700
  document.addEventListener('mouseup', mouseUpListener, true);