@vaadin/context-menu 23.1.0 → 23.1.3

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/context-menu",
3
- "version": "23.1.0",
3
+ "version": "23.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,20 +37,20 @@
37
37
  "dependencies": {
38
38
  "@open-wc/dedupe-mixin": "^1.3.0",
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/component-base": "^23.1.0",
41
- "@vaadin/item": "^23.1.0",
42
- "@vaadin/list-box": "^23.1.0",
43
- "@vaadin/lit-renderer": "^23.1.0",
44
- "@vaadin/vaadin-lumo-styles": "^23.1.0",
45
- "@vaadin/vaadin-material-styles": "^23.1.0",
46
- "@vaadin/vaadin-overlay": "^23.1.0",
47
- "@vaadin/vaadin-themable-mixin": "^23.1.0"
40
+ "@vaadin/component-base": "^23.1.3",
41
+ "@vaadin/item": "^23.1.3",
42
+ "@vaadin/list-box": "^23.1.3",
43
+ "@vaadin/lit-renderer": "^23.1.3",
44
+ "@vaadin/vaadin-lumo-styles": "^23.1.3",
45
+ "@vaadin/vaadin-material-styles": "^23.1.3",
46
+ "@vaadin/vaadin-overlay": "^23.1.3",
47
+ "@vaadin/vaadin-themable-mixin": "^23.1.3"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@esm-bundle/chai": "^4.3.4",
51
- "@vaadin/polymer-legacy-adapter": "^23.1.0",
51
+ "@vaadin/polymer-legacy-adapter": "^23.1.3",
52
52
  "@vaadin/testing-helpers": "^0.3.2",
53
53
  "sinon": "^13.0.2"
54
54
  },
55
- "gitHead": "322bba42b83f908a78cd972b06acadc5da95a69d"
55
+ "gitHead": "3066c296ad0ef652bc49417005523398199f1bf2"
56
56
  }
@@ -289,13 +289,13 @@ declare class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(HTM
289
289
  addEventListener<K extends keyof ContextMenuEventMap>(
290
290
  type: K,
291
291
  listener: (this: ContextMenu, ev: ContextMenuEventMap[K]) => void,
292
- options?: boolean | AddEventListenerOptions,
292
+ options?: AddEventListenerOptions | boolean,
293
293
  ): void;
294
294
 
295
295
  removeEventListener<K extends keyof ContextMenuEventMap>(
296
296
  type: K,
297
297
  listener: (this: ContextMenu, ev: ContextMenuEventMap[K]) => void,
298
- options?: boolean | EventListenerOptions,
298
+ options?: EventListenerOptions | boolean,
299
299
  ): void;
300
300
  }
301
301
 
@@ -34,8 +34,20 @@ register({
34
34
  }
35
35
  },
36
36
 
37
- touchstart(e) {
37
+ _setSourceEvent(e) {
38
38
  this.info.sourceEvent = e;
39
+
40
+ const path = e.composedPath();
41
+
42
+ // Calling `sourceEvent.composedPath()` after a timeout would return an empty array.
43
+ // This is especially problematic on iOS where we configure the timer on touchstart.
44
+ // Store the composed path to be used by `grid.getEventContext(event)` so it works.
45
+ this.info.sourceEvent.__composedPath = path;
46
+ },
47
+
48
+ touchstart(e) {
49
+ this._setSourceEvent(e);
50
+
39
51
  this.info.touchStartCoords = {
40
52
  x: e.changedTouches[0].clientX,
41
53
  y: e.changedTouches[0].clientY,
@@ -80,7 +92,7 @@ register({
80
92
 
81
93
  contextmenu(e) {
82
94
  if (!e.shiftKey) {
83
- this.info.sourceEvent = e;
95
+ this._setSourceEvent(e);
84
96
  this.fire(e.target, e.clientX, e.clientY);
85
97
  prevent('tap');
86
98
  }
@@ -9,10 +9,10 @@ import { ListBox } from '@vaadin/list-box/src/vaadin-list-box.js';
9
9
 
10
10
  export interface ContextMenuItem {
11
11
  text?: string;
12
- component?: string | HTMLElement;
12
+ component?: HTMLElement | string;
13
13
  disabled?: boolean;
14
14
  checked?: boolean;
15
- theme?: string | string[];
15
+ theme?: string[] | string;
16
16
  children?: ContextMenuItem[];
17
17
  }
18
18
 
@@ -37,7 +37,7 @@ declare global {
37
37
  */
38
38
  declare class ContextMenuListBox extends ListBox {}
39
39
 
40
- export declare function ItemsMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<ItemsMixinClass>;
40
+ export declare function ItemsMixin<T extends Constructor<HTMLElement>>(base: T): Constructor<ItemsMixinClass> & T;
41
41
 
42
42
  export declare class ItemsMixinClass {
43
43
  /**