@vaadin/context-menu 22.0.14 → 22.0.15
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 +10 -10
- package/src/vaadin-context-menu-overlay.js +4 -4
- package/src/vaadin-context-menu.d.ts +3 -3
- package/src/vaadin-context-menu.js +8 -8
- package/src/vaadin-contextmenu-event.js +4 -4
- package/src/vaadin-contextmenu-items-mixin.js +5 -5
- package/src/vaadin-device-detector.js +4 -4
- package/theme/lumo/vaadin-context-menu-styles.js +3 -3
- package/theme/material/vaadin-context-menu-styles.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/context-menu",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
36
36
|
"@polymer/iron-media-query": "^3.0.0",
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "^22.0.
|
|
39
|
-
"@vaadin/item": "^22.0.
|
|
40
|
-
"@vaadin/list-box": "^22.0.
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "^22.0.
|
|
42
|
-
"@vaadin/vaadin-material-styles": "^22.0.
|
|
43
|
-
"@vaadin/vaadin-overlay": "^22.0.
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "^22.0.
|
|
38
|
+
"@vaadin/component-base": "^22.0.15",
|
|
39
|
+
"@vaadin/item": "^22.0.15",
|
|
40
|
+
"@vaadin/list-box": "^22.0.15",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.15",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "^22.0.15",
|
|
43
|
+
"@vaadin/vaadin-overlay": "^22.0.15",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.15"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@esm-bundle/chai": "^4.3.4",
|
|
48
|
-
"@vaadin/polymer-legacy-adapter": "^22.0.
|
|
48
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.15",
|
|
49
49
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
50
50
|
"sinon": "^9.2.1"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "bba021b56ba45da93d2bb980242956ad929ecfe2"
|
|
53
53
|
}
|
|
@@ -28,7 +28,7 @@ registerStyles(
|
|
|
28
28
|
background-color: #fff;
|
|
29
29
|
}
|
|
30
30
|
`,
|
|
31
|
-
{ moduleId: 'vaadin-context-menu-overlay-styles' }
|
|
31
|
+
{ moduleId: 'vaadin-context-menu-overlay-styles' },
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -49,8 +49,8 @@ class ContextMenuOverlay extends PositionMixin(OverlayElement) {
|
|
|
49
49
|
*/
|
|
50
50
|
parentOverlay: {
|
|
51
51
|
type: Object,
|
|
52
|
-
readOnly: true
|
|
53
|
-
}
|
|
52
|
+
readOnly: true,
|
|
53
|
+
},
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -102,7 +102,7 @@ class ContextMenuOverlay extends PositionMixin(OverlayElement) {
|
|
|
102
102
|
return {
|
|
103
103
|
xMax: overlayRect.right - contentRect.width,
|
|
104
104
|
xMin: overlayRect.left + contentRect.width,
|
|
105
|
-
yMax
|
|
105
|
+
yMax,
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -18,7 +18,7 @@ export interface ContextMenuRendererContext {
|
|
|
18
18
|
export type ContextMenuRenderer = (
|
|
19
19
|
root: HTMLElement,
|
|
20
20
|
contextMenu?: ContextMenu,
|
|
21
|
-
context?: ContextMenuRendererContext
|
|
21
|
+
context?: ContextMenuRendererContext,
|
|
22
22
|
) => void;
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -290,13 +290,13 @@ declare class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(Ges
|
|
|
290
290
|
addEventListener<K extends keyof ContextMenuEventMap>(
|
|
291
291
|
type: K,
|
|
292
292
|
listener: (this: ContextMenu, ev: ContextMenuEventMap[K]) => void,
|
|
293
|
-
options?: boolean | AddEventListenerOptions
|
|
293
|
+
options?: boolean | AddEventListenerOptions,
|
|
294
294
|
): void;
|
|
295
295
|
|
|
296
296
|
removeEventListener<K extends keyof ContextMenuEventMap>(
|
|
297
297
|
type: K,
|
|
298
298
|
listener: (this: ContextMenu, ev: ContextMenuEventMap[K]) => void,
|
|
299
|
-
options?: boolean | EventListenerOptions
|
|
299
|
+
options?: boolean | EventListenerOptions,
|
|
300
300
|
): void;
|
|
301
301
|
}
|
|
302
302
|
|
|
@@ -242,7 +242,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
242
242
|
* of the context menu to listen for `openOn` events.
|
|
243
243
|
*/
|
|
244
244
|
selector: {
|
|
245
|
-
type: String
|
|
245
|
+
type: String,
|
|
246
246
|
},
|
|
247
247
|
|
|
248
248
|
/**
|
|
@@ -253,7 +253,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
253
253
|
type: Boolean,
|
|
254
254
|
value: false,
|
|
255
255
|
notify: true,
|
|
256
|
-
readOnly: true
|
|
256
|
+
readOnly: true,
|
|
257
257
|
},
|
|
258
258
|
|
|
259
259
|
/**
|
|
@@ -263,7 +263,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
263
263
|
*/
|
|
264
264
|
openOn: {
|
|
265
265
|
type: String,
|
|
266
|
-
value: 'vaadin-contextmenu'
|
|
266
|
+
value: 'vaadin-contextmenu',
|
|
267
267
|
},
|
|
268
268
|
|
|
269
269
|
/**
|
|
@@ -277,7 +277,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
277
277
|
type: Object,
|
|
278
278
|
value: function () {
|
|
279
279
|
return this;
|
|
280
|
-
}
|
|
280
|
+
},
|
|
281
281
|
},
|
|
282
282
|
|
|
283
283
|
/**
|
|
@@ -288,7 +288,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
288
288
|
closeOn: {
|
|
289
289
|
type: String,
|
|
290
290
|
value: 'click',
|
|
291
|
-
observer: '_closeOnChanged'
|
|
291
|
+
observer: '_closeOnChanged',
|
|
292
292
|
},
|
|
293
293
|
|
|
294
294
|
/**
|
|
@@ -303,7 +303,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
303
303
|
* @type {ContextMenuRenderer | undefined}
|
|
304
304
|
*/
|
|
305
305
|
renderer: {
|
|
306
|
-
type: Function
|
|
306
|
+
type: Function,
|
|
307
307
|
},
|
|
308
308
|
|
|
309
309
|
/** @private */
|
|
@@ -316,7 +316,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
316
316
|
_boundOpen: Object,
|
|
317
317
|
|
|
318
318
|
/** @private */
|
|
319
|
-
_touch: Boolean
|
|
319
|
+
_touch: Boolean,
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -502,7 +502,7 @@ class ContextMenu extends ElementMixin(ThemePropertyMixin(ItemsMixin(GestureEven
|
|
|
502
502
|
if (e && !this.opened) {
|
|
503
503
|
this._context = {
|
|
504
504
|
detail: e.detail,
|
|
505
|
-
target: this._contextTarget(e)
|
|
505
|
+
target: this._contextTarget(e),
|
|
506
506
|
};
|
|
507
507
|
|
|
508
508
|
if (this._context.target) {
|
|
@@ -11,13 +11,13 @@ register({
|
|
|
11
11
|
deps: ['touchstart', 'touchmove', 'touchend', 'contextmenu'],
|
|
12
12
|
flow: {
|
|
13
13
|
start: ['touchstart', 'contextmenu'],
|
|
14
|
-
end: ['contextmenu']
|
|
14
|
+
end: ['contextmenu'],
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
emits: ['vaadin-contextmenu'],
|
|
18
18
|
|
|
19
19
|
info: {
|
|
20
|
-
sourceEvent: null
|
|
20
|
+
sourceEvent: null,
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
reset: function () {
|
|
@@ -38,7 +38,7 @@ register({
|
|
|
38
38
|
this.info.sourceEvent = e;
|
|
39
39
|
this.info.touchStartCoords = {
|
|
40
40
|
x: e.changedTouches[0].clientX,
|
|
41
|
-
y: e.changedTouches[0].clientY
|
|
41
|
+
y: e.changedTouches[0].clientY,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
// After timeout event is already retargeted to the parent element in case there is one.
|
|
@@ -97,5 +97,5 @@ register({
|
|
|
97
97
|
if (ev.defaultPrevented && sourceEvent && sourceEvent.preventDefault) {
|
|
98
98
|
sourceEvent.preventDefault();
|
|
99
99
|
}
|
|
100
|
-
}
|
|
100
|
+
},
|
|
101
101
|
});
|
|
@@ -94,7 +94,7 @@ export const ItemsMixin = (superClass) =>
|
|
|
94
94
|
* ----------------|----------------|----------------
|
|
95
95
|
* `:host` | expanded | Expanded parent item
|
|
96
96
|
*/
|
|
97
|
-
items: Array
|
|
97
|
+
items: Array,
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -177,9 +177,9 @@ export const ItemsMixin = (superClass) =>
|
|
|
177
177
|
itemElement.dispatchEvent(
|
|
178
178
|
new CustomEvent('opensubmenu', {
|
|
179
179
|
detail: {
|
|
180
|
-
children: itemElement._item.children
|
|
181
|
-
}
|
|
182
|
-
})
|
|
180
|
+
children: itemElement._item.children,
|
|
181
|
+
},
|
|
182
|
+
}),
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -333,7 +333,7 @@ export const ItemsMixin = (superClass) =>
|
|
|
333
333
|
requestAnimationFrame(() => (this.__openListenerActive = true));
|
|
334
334
|
const openSubMenu = (
|
|
335
335
|
e,
|
|
336
|
-
itemElement = e.composedPath().filter((e) => e.localName === 'vaadin-context-menu-item')[0]
|
|
336
|
+
itemElement = e.composedPath().filter((e) => e.localName === 'vaadin-context-menu-item')[0],
|
|
337
337
|
) => {
|
|
338
338
|
// Delay enabling the mouseover listener to avoid it from triggering on parent menu open
|
|
339
339
|
if (!this.__openListenerActive) {
|
|
@@ -29,7 +29,7 @@ class DeviceDetector extends PolymerElement {
|
|
|
29
29
|
phone: {
|
|
30
30
|
type: Boolean,
|
|
31
31
|
computed: '_phone(wide, touch)',
|
|
32
|
-
notify: true
|
|
32
|
+
notify: true,
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -39,7 +39,7 @@ class DeviceDetector extends PolymerElement {
|
|
|
39
39
|
touch: {
|
|
40
40
|
type: Boolean,
|
|
41
41
|
notify: true,
|
|
42
|
-
value: isTouch
|
|
42
|
+
value: isTouch,
|
|
43
43
|
},
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -47,8 +47,8 @@ class DeviceDetector extends PolymerElement {
|
|
|
47
47
|
*/
|
|
48
48
|
wide: {
|
|
49
49
|
type: Boolean,
|
|
50
|
-
notify: true
|
|
51
|
-
}
|
|
50
|
+
notify: true,
|
|
51
|
+
},
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -31,7 +31,7 @@ const contextMenuOverlay = css`
|
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
registerStyles('vaadin-context-menu-overlay', [menuOverlay, contextMenuOverlay], {
|
|
34
|
-
moduleId: 'lumo-context-menu-overlay'
|
|
34
|
+
moduleId: 'lumo-context-menu-overlay',
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
registerStyles(
|
|
@@ -84,7 +84,7 @@ registerStyles(
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
`,
|
|
87
|
-
{ moduleId: 'lumo-context-menu-list-box' }
|
|
87
|
+
{ moduleId: 'lumo-context-menu-list-box' },
|
|
88
88
|
);
|
|
89
89
|
|
|
90
90
|
registerStyles(
|
|
@@ -124,5 +124,5 @@ registerStyles(
|
|
|
124
124
|
padding-right: var(--lumo-space-m);
|
|
125
125
|
}
|
|
126
126
|
`,
|
|
127
|
-
{ moduleId: 'lumo-context-menu-item' }
|
|
127
|
+
{ moduleId: 'lumo-context-menu-item' },
|
|
128
128
|
);
|
|
@@ -12,7 +12,7 @@ const contextMenuOverlay = css`
|
|
|
12
12
|
`;
|
|
13
13
|
|
|
14
14
|
registerStyles('vaadin-context-menu-overlay', [menuOverlay, contextMenuOverlay], {
|
|
15
|
-
moduleId: 'material-context-menu-overlay'
|
|
15
|
+
moduleId: 'material-context-menu-overlay',
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
registerStyles(
|
|
@@ -44,7 +44,7 @@ registerStyles(
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
`,
|
|
47
|
-
{ moduleId: 'material-context-menu-list-box' }
|
|
47
|
+
{ moduleId: 'material-context-menu-list-box' },
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
registerStyles(
|
|
@@ -79,5 +79,5 @@ registerStyles(
|
|
|
79
79
|
background-color: var(--material-secondary-background-color);
|
|
80
80
|
}
|
|
81
81
|
`,
|
|
82
|
-
{ moduleId: 'material-context-menu-item' }
|
|
82
|
+
{ moduleId: 'material-context-menu-item' },
|
|
83
83
|
);
|