@vaadin/grid 23.0.2 → 23.0.5
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.
|
|
3
|
+
"version": "23.0.5",
|
|
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.
|
|
45
|
-
"@vaadin/component-base": "^23.0.
|
|
46
|
-
"@vaadin/text-field": "^23.0.
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
48
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
44
|
+
"@vaadin/checkbox": "^23.0.5",
|
|
45
|
+
"@vaadin/component-base": "^23.0.5",
|
|
46
|
+
"@vaadin/text-field": "^23.0.5",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.5",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "^23.0.5",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@esm-bundle/chai": "^4.3.4",
|
|
53
|
-
"@vaadin/polymer-legacy-adapter": "^23.0.
|
|
53
|
+
"@vaadin/polymer-legacy-adapter": "^23.0.5",
|
|
54
54
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
55
55
|
"lit": "^2.0.0",
|
|
56
56
|
"sinon": "^9.2.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "4cd2b11eb053d36fba9f0a8128da4e63984753e2"
|
|
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 =
|
|
60
|
+
const style = getComputedStyle(targetCell._content);
|
|
61
61
|
const minWidth =
|
|
62
62
|
10 +
|
|
63
63
|
parseInt(style.paddingLeft) +
|
package/src/vaadin-grid.js
CHANGED
|
@@ -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';
|
|
@@ -340,11 +340,6 @@ class Grid extends ElementMixin(
|
|
|
340
340
|
value: isTouch
|
|
341
341
|
},
|
|
342
342
|
|
|
343
|
-
/** @protected */
|
|
344
|
-
tabindex: {
|
|
345
|
-
value: undefined
|
|
346
|
-
},
|
|
347
|
-
|
|
348
343
|
/**
|
|
349
344
|
* If true, the grid's height is defined by its rows.
|
|
350
345
|
*
|
|
@@ -473,23 +468,6 @@ class Grid extends ElementMixin(
|
|
|
473
468
|
}
|
|
474
469
|
}
|
|
475
470
|
|
|
476
|
-
/**
|
|
477
|
-
* Override an observer from `DisabledMixin` to not
|
|
478
|
-
* set `tabindex` on the grid when it is re-enabled.
|
|
479
|
-
*
|
|
480
|
-
* @param {boolean} disabled
|
|
481
|
-
* @param {boolean} oldDisabled
|
|
482
|
-
* @protected
|
|
483
|
-
* @override
|
|
484
|
-
*/
|
|
485
|
-
_disabledChanged(disabled, oldDisabled) {
|
|
486
|
-
super._disabledChanged(disabled, oldDisabled);
|
|
487
|
-
|
|
488
|
-
if (oldDisabled) {
|
|
489
|
-
this.removeAttribute('tabindex');
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
471
|
/** @private */
|
|
494
472
|
__getBodyCellCoordinates(cell) {
|
|
495
473
|
if (this.$.items.contains(cell) && cell.localName === 'td') {
|
|
@@ -685,13 +663,16 @@ class Grid extends ElementMixin(
|
|
|
685
663
|
// focusable slot wrapper, that is why cells are not focused with
|
|
686
664
|
// mousedown. Workaround: listen for mousedown and focus manually.
|
|
687
665
|
cellContent.addEventListener('mousedown', () => {
|
|
688
|
-
if (
|
|
666
|
+
if (isChrome) {
|
|
689
667
|
// Chrome bug: focusing before mouseup prevents text selection, see http://crbug.com/771903
|
|
690
|
-
const mouseUpListener = () => {
|
|
691
|
-
|
|
668
|
+
const mouseUpListener = (event) => {
|
|
669
|
+
// If focus is on element within the cell content — respect it, do not change
|
|
670
|
+
const contentContainsFocusedElement = cellContent.contains(this.getRootNode().activeElement);
|
|
671
|
+
// Only focus if mouse is released on cell content itself
|
|
672
|
+
const mouseUpWithinCell = cellContent.contains(event.target);
|
|
673
|
+
if (!contentContainsFocusedElement && mouseUpWithinCell) {
|
|
692
674
|
cell.focus();
|
|
693
675
|
}
|
|
694
|
-
// If focus is in the cell content — respect it, do not change.
|
|
695
676
|
document.removeEventListener('mouseup', mouseUpListener, true);
|
|
696
677
|
};
|
|
697
678
|
document.addEventListener('mouseup', mouseUpListener, true);
|