@vaadin/dialog 23.0.0-alpha1 → 23.0.0-alpha5
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-dialog-draggable-mixin.d.ts +1 -1
- package/src/vaadin-dialog-draggable-mixin.js +8 -6
- package/src/vaadin-dialog-resizable-mixin.d.ts +1 -1
- package/src/vaadin-dialog-resizable-mixin.js +7 -2
- package/src/vaadin-dialog-utils.d.ts +1 -1
- package/src/vaadin-dialog-utils.js +6 -0
- package/src/vaadin-dialog.d.ts +8 -1
- package/src/vaadin-dialog.js +3 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-alpha5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"main": "vaadin-dialog.js",
|
|
20
20
|
"module": "vaadin-dialog.js",
|
|
21
|
+
"type": "module",
|
|
21
22
|
"files": [
|
|
22
23
|
"src",
|
|
23
24
|
"theme",
|
|
@@ -33,20 +34,19 @@
|
|
|
33
34
|
],
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
36
|
-
"@polymer/iron-resizable-behavior": "^3.0.0",
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "23.0.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
40
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
41
|
-
"@vaadin/vaadin-overlay": "23.0.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
38
|
+
"@vaadin/component-base": "23.0.0-alpha5",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-alpha5",
|
|
40
|
+
"@vaadin/vaadin-material-styles": "23.0.0-alpha5",
|
|
41
|
+
"@vaadin/vaadin-overlay": "23.0.0-alpha5",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-alpha5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
46
|
-
"@vaadin/polymer-legacy-adapter": "23.0.0-
|
|
46
|
+
"@vaadin/polymer-legacy-adapter": "23.0.0-alpha5",
|
|
47
47
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
48
|
-
"@vaadin/text-area": "23.0.0-
|
|
48
|
+
"@vaadin/text-area": "23.0.0-alpha5",
|
|
49
49
|
"sinon": "^9.2.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "74f9294964eb8552d96578c14af6ad214f5257bc"
|
|
52
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
@@ -71,12 +71,14 @@ export const DialogDraggableMixin = (superClass) =>
|
|
|
71
71
|
const isContentPart = e.target === this.$.overlay.$.content;
|
|
72
72
|
|
|
73
73
|
const isDraggable = e.composedPath().some((node, index) => {
|
|
74
|
-
if (node.classList) {
|
|
75
|
-
|
|
76
|
-
const isDraggableLeafOnly = node.classList.contains('draggable-leaf-only');
|
|
77
|
-
const isLeafNode = index === 0;
|
|
78
|
-
return (isDraggableLeafOnly && isLeafNode) || (isDraggableNode && (!isDraggableLeafOnly || isLeafNode));
|
|
74
|
+
if (!node.classList) {
|
|
75
|
+
return false;
|
|
79
76
|
}
|
|
77
|
+
|
|
78
|
+
const isDraggableNode = node.classList.contains(this.__dragHandleClassName || 'draggable');
|
|
79
|
+
const isDraggableLeafOnly = node.classList.contains('draggable-leaf-only');
|
|
80
|
+
const isLeafNode = index === 0;
|
|
81
|
+
return (isDraggableLeafOnly && isLeafNode) || (isDraggableNode && (!isDraggableLeafOnly || isLeafNode));
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
if ((isResizerContainer && !isResizerContainerScrollbar) || isContentPart || isDraggable) {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
1
6
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
2
7
|
import { eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
|
|
3
8
|
|
|
@@ -211,10 +216,10 @@ export const DialogResizableMixin = (superClass) =>
|
|
|
211
216
|
}
|
|
212
217
|
break;
|
|
213
218
|
}
|
|
219
|
+
default:
|
|
220
|
+
break;
|
|
214
221
|
}
|
|
215
222
|
});
|
|
216
|
-
|
|
217
|
-
this.$.overlay.notifyResize();
|
|
218
223
|
}
|
|
219
224
|
}
|
|
220
225
|
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* Checks if the argument is a touch event and if so, returns a first touch.
|
|
3
9
|
* Otherwise, if the mouse event was passed, returns it as is.
|
package/src/vaadin-dialog.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
|
+
import { OverlayElement } from '@vaadin/vaadin-overlay/src/vaadin-overlay.js';
|
|
7
8
|
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
8
9
|
import { DialogDraggableMixin } from './vaadin-dialog-draggable-mixin.js';
|
|
9
10
|
import { DialogResizableMixin } from './vaadin-dialog-resizable-mixin.js';
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* An element used internally by `<vaadin-dialog>`. Not intended to be used separately.
|
|
14
|
+
*/
|
|
15
|
+
export class DialogOverlay extends OverlayElement {}
|
|
16
|
+
|
|
11
17
|
export type DialogRenderer = (root: HTMLElement, dialog?: Dialog) => void;
|
|
12
18
|
|
|
13
19
|
export type DialogResizableDirection = 'n' | 'e' | 's' | 'w' | 'nw' | 'ne' | 'se' | 'sw';
|
|
@@ -159,6 +165,7 @@ declare class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixi
|
|
|
159
165
|
declare global {
|
|
160
166
|
interface HTMLElementTagNameMap {
|
|
161
167
|
'vaadin-dialog': Dialog;
|
|
168
|
+
'vaadin-dialog-overlay': DialogOverlay;
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
171
|
|
package/src/vaadin-dialog.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
|
|
7
|
-
import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
|
|
8
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
9
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
8
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
@@ -40,7 +38,7 @@ let memoizedTemplate;
|
|
|
40
38
|
* @extends OverlayElement
|
|
41
39
|
* @private
|
|
42
40
|
*/
|
|
43
|
-
class DialogOverlay extends
|
|
41
|
+
export class DialogOverlay extends OverlayElement {
|
|
44
42
|
static get is() {
|
|
45
43
|
return 'vaadin-dialog-overlay';
|
|
46
44
|
}
|
|
@@ -73,7 +71,7 @@ class DialogOverlay extends mixinBehaviors(IronResizableBehavior, OverlayElement
|
|
|
73
71
|
*/
|
|
74
72
|
setBounds(bounds) {
|
|
75
73
|
const overlay = this.$.overlay;
|
|
76
|
-
const parsedBounds =
|
|
74
|
+
const parsedBounds = { ...bounds };
|
|
77
75
|
|
|
78
76
|
if (overlay.style.position !== 'absolute') {
|
|
79
77
|
overlay.style.position = 'absolute';
|