@vaadin/grid 23.1.8 → 23.1.10

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.1.8",
3
+ "version": "23.1.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -43,20 +43,20 @@
43
43
  "dependencies": {
44
44
  "@open-wc/dedupe-mixin": "^1.3.0",
45
45
  "@polymer/polymer": "^3.0.0",
46
- "@vaadin/checkbox": "~23.1.8",
47
- "@vaadin/component-base": "~23.1.8",
48
- "@vaadin/lit-renderer": "~23.1.8",
49
- "@vaadin/text-field": "~23.1.8",
50
- "@vaadin/vaadin-lumo-styles": "~23.1.8",
51
- "@vaadin/vaadin-material-styles": "~23.1.8",
52
- "@vaadin/vaadin-themable-mixin": "~23.1.8"
46
+ "@vaadin/checkbox": "~23.1.10",
47
+ "@vaadin/component-base": "~23.1.10",
48
+ "@vaadin/lit-renderer": "~23.1.10",
49
+ "@vaadin/text-field": "~23.1.10",
50
+ "@vaadin/vaadin-lumo-styles": "~23.1.10",
51
+ "@vaadin/vaadin-material-styles": "~23.1.10",
52
+ "@vaadin/vaadin-themable-mixin": "~23.1.10"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@esm-bundle/chai": "^4.3.4",
56
- "@vaadin/polymer-legacy-adapter": "~23.1.8",
56
+ "@vaadin/polymer-legacy-adapter": "~23.1.10",
57
57
  "@vaadin/testing-helpers": "^0.3.2",
58
58
  "lit": "^2.0.0",
59
59
  "sinon": "^13.0.2"
60
60
  },
61
- "gitHead": "297e4e51743751bed97f5400e661529a7d550870"
61
+ "gitHead": "439dc60a019bae972f286adc0479d340dd1ffe72"
62
62
  }
@@ -17,6 +17,9 @@ const DropLocation = {
17
17
  EMPTY: 'empty',
18
18
  };
19
19
 
20
+ // Detects if the browser doesn't support HTML5 Drag & Drop API (and falls back to the @vaadin/vaadin-mobile-drag-drop polyfill)
21
+ const usesDnDPolyfill = !('draggable' in document.createElement('div'));
22
+
20
23
  /**
21
24
  * @polymerMixin
22
25
  */
@@ -133,9 +136,11 @@ export const DragAndDropMixin = (superClass) =>
133
136
 
134
137
  const rowRect = row.getBoundingClientRect();
135
138
 
136
- if (this._ios) {
139
+ if (usesDnDPolyfill) {
140
+ // The polyfill drag image is automatically centered so there is no need to adjust the position
137
141
  e.dataTransfer.setDragImage(row);
138
142
  } else {
143
+ // The native drag image needs to be shifted manually to compensate for the touch position offset
139
144
  e.dataTransfer.setDragImage(row, e.clientX - rowRect.left, e.clientY - rowRect.top);
140
145
  }
141
146
 
@@ -170,11 +170,7 @@ registerStyles(
170
170
  border-radius: var(--lumo-border-radius-s) 0 0 var(--lumo-border-radius-s);
171
171
  }
172
172
 
173
- [ios] [part~='row'][dragstart] [part~='cell'] {
174
- background: var(--lumo-primary-color-50pct);
175
- }
176
-
177
- #scroller:not([ios]) [part~='row'][dragstart]:not([dragstart=''])::after {
173
+ #scroller [part~='row'][dragstart]:not([dragstart=''])::after {
178
174
  display: block;
179
175
  position: absolute;
180
176
  left: var(--_grid-drag-start-x);
@@ -10,7 +10,7 @@ registerStyles(
10
10
  --vaadin-grid-tree-toggle-level-offset: 2em;
11
11
  align-items: center;
12
12
  vertical-align: middle;
13
- margin-left: calc(var(--lumo-space-s) * -1);
13
+ transform: translateX(calc(var(--lumo-space-s) * -1));
14
14
  -webkit-tap-highlight-color: transparent;
15
15
  }
16
16
 
@@ -221,11 +221,7 @@ registerStyles(
221
221
  box-shadow: none !important;
222
222
  }
223
223
 
224
- [ios] [part~='row'][dragstart] [part~='cell'] {
225
- background: var(--material-primary-color);
226
- }
227
-
228
- #scroller:not([ios]) [part~='row'][dragstart]:not([dragstart=''])::after {
224
+ #scroller [part~='row'][dragstart]:not([dragstart=''])::after {
229
225
  display: block;
230
226
  position: absolute;
231
227
  left: var(--_grid-drag-start-x);
@@ -262,7 +258,7 @@ registerStyles(
262
258
  border-left: 1px solid var(--material-divider-color);
263
259
  }
264
260
 
265
- :host([dir='rtl']) #scroller:not([ios]) [part~='row'][dragstart]:not([dragstart=''])::after {
261
+ :host([dir='rtl']) #scroller [part~='row'][dragstart]:not([dragstart=''])::after {
266
262
  left: auto;
267
263
  right: var(--_grid-drag-start-x);
268
264
  }