@vaadin/dialog 22.0.0-beta1 → 22.0.1
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/README.md +25 -24
- package/package.json +11 -10
- package/src/vaadin-dialog-draggable-mixin.d.ts +4 -9
- package/src/vaadin-dialog-draggable-mixin.js +8 -11
- package/src/vaadin-dialog-resizable-mixin.d.ts +4 -9
- package/src/vaadin-dialog-resizable-mixin.js +2 -2
- package/src/vaadin-dialog.js +2 -2
- package/theme/lumo/vaadin-dialog-styles.js +1 -1
- package/theme/material/vaadin-dialog-styles.js +2 -2
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaadin/dialog
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
|
5
|
-
[API documentation ↗](https://vaadin.com/components/vaadin-dialog/html-api)
|
|
3
|
+
A web component for presenting information and user interface elements in an overlay.
|
|
6
4
|
|
|
7
|
-
[
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/dialog)
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/@vaadin/dialog)
|
|
10
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-dialog)
|
|
11
8
|
[](https://discord.gg/PHmkCKC)
|
|
12
9
|
|
|
13
10
|
```html
|
|
@@ -21,41 +18,44 @@
|
|
|
21
18
|
</script>
|
|
22
19
|
```
|
|
23
20
|
|
|
24
|
-
[<img src="https://raw.githubusercontent.com/vaadin/
|
|
21
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/dialog/screenshot.png" width="264" alt="Screenshot of vaadin-dialog">](https://vaadin.com/docs/latest/ds/components/dialog)
|
|
25
22
|
|
|
26
23
|
## Installation
|
|
27
24
|
|
|
28
|
-
Install
|
|
25
|
+
Install the component:
|
|
29
26
|
|
|
30
27
|
```sh
|
|
31
|
-
npm i @vaadin/dialog
|
|
28
|
+
npm i @vaadin/dialog
|
|
32
29
|
```
|
|
33
30
|
|
|
34
|
-
Once installed, import
|
|
31
|
+
Once installed, import the component in your application:
|
|
35
32
|
|
|
36
33
|
```js
|
|
37
|
-
import '@vaadin/dialog
|
|
34
|
+
import '@vaadin/dialog';
|
|
38
35
|
```
|
|
39
36
|
|
|
40
|
-
##
|
|
37
|
+
## Themes
|
|
41
38
|
|
|
42
|
-
Vaadin components
|
|
39
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
40
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/dialog/vaadin-dialog.js) of the package uses the Lumo theme.
|
|
43
41
|
|
|
44
|
-
To use the Material theme, import the
|
|
42
|
+
To use the Material theme, import the component from the `theme/material` folder:
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`theme/lumo/vaadin-dialog.js`
|
|
44
|
+
```js
|
|
45
|
+
import '@vaadin/dialog/theme/material/vaadin-dialog.js';
|
|
46
|
+
```
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
You can also import the Lumo version of the component explicitly:
|
|
53
49
|
|
|
54
|
-
|
|
50
|
+
```js
|
|
51
|
+
import '@vaadin/dialog/theme/lumo/vaadin-dialog.js';
|
|
52
|
+
```
|
|
55
53
|
|
|
56
|
-
-
|
|
54
|
+
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
```js
|
|
57
|
+
import '@vaadin/dialog/src/vaadin-dialog.js';
|
|
58
|
+
```
|
|
59
59
|
|
|
60
60
|
## Contributing
|
|
61
61
|
|
|
@@ -65,4 +65,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
|
|
|
65
65
|
|
|
66
66
|
Apache License 2.0
|
|
67
67
|
|
|
68
|
-
Vaadin collects development time
|
|
68
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
69
|
+
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,20 +32,21 @@
|
|
|
32
32
|
"polymer"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
35
36
|
"@polymer/iron-resizable-behavior": "^3.0.0",
|
|
36
37
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "22.0.
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "22.0.
|
|
39
|
-
"@vaadin/vaadin-material-styles": "22.0.
|
|
40
|
-
"@vaadin/vaadin-overlay": "22.0.
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "22.0.
|
|
38
|
+
"@vaadin/component-base": "^22.0.1",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.1",
|
|
40
|
+
"@vaadin/vaadin-material-styles": "^22.0.1",
|
|
41
|
+
"@vaadin/vaadin-overlay": "^22.0.1",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.1"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
45
|
-
"@vaadin/polymer-legacy-adapter": "22.0.
|
|
46
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
47
|
-
"@vaadin/text-area": "22.0.
|
|
46
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.1",
|
|
47
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
48
|
+
"@vaadin/text-area": "^22.0.1",
|
|
48
49
|
"sinon": "^9.2.1"
|
|
49
50
|
},
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
|
|
51
52
|
}
|
|
@@ -3,16 +3,13 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
7
|
|
|
7
|
-
declare function DialogDraggableMixin<T extends
|
|
8
|
+
export declare function DialogDraggableMixin<T extends Constructor<HTMLElement>>(
|
|
8
9
|
base: T
|
|
9
|
-
): T &
|
|
10
|
+
): T & Constructor<DialogDraggableMixinClass>;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
new (...args: any[]): DialogDraggableMixin;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface DialogDraggableMixin {
|
|
12
|
+
export declare class DialogDraggableMixinClass {
|
|
16
13
|
/**
|
|
17
14
|
* Set to true to enable repositioning the dialog by clicking and dragging.
|
|
18
15
|
*
|
|
@@ -25,5 +22,3 @@ interface DialogDraggableMixin {
|
|
|
25
22
|
*/
|
|
26
23
|
draggable: boolean;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
export { DialogDraggableMixin, DialogDraggableMixinConstructor };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
})();
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
7
|
+
import { eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* @polymerMixin
|
|
@@ -37,7 +34,7 @@ export const DialogDraggableMixin = (superClass) =>
|
|
|
37
34
|
/** @private */
|
|
38
35
|
_touchDevice: {
|
|
39
36
|
type: Boolean,
|
|
40
|
-
value:
|
|
37
|
+
value: isTouch
|
|
41
38
|
},
|
|
42
39
|
|
|
43
40
|
/* TODO: Expose as a public property (check naming) */
|
|
@@ -3,20 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
7
|
|
|
7
|
-
declare function DialogResizableMixin<T extends
|
|
8
|
+
export declare function DialogResizableMixin<T extends Constructor<HTMLElement>>(
|
|
8
9
|
base: T
|
|
9
|
-
): T &
|
|
10
|
+
): T & Constructor<DialogResizableMixinClass>;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
new (...args: any[]): DialogResizableMixin;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface DialogResizableMixin {
|
|
12
|
+
export declare class DialogResizableMixinClass {
|
|
16
13
|
/**
|
|
17
14
|
* Set to true to enable resizing the dialog by dragging the corners and edges.
|
|
18
15
|
*/
|
|
19
16
|
resizable: boolean;
|
|
20
17
|
}
|
|
21
|
-
|
|
22
|
-
export { DialogResizableMixin, DialogResizableMixinConstructor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
2
|
+
import { eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
|
|
3
3
|
|
|
4
4
|
registerStyles(
|
|
5
5
|
'vaadin-dialog-overlay',
|
package/src/vaadin-dialog.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
|
7
6
|
import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
|
|
8
7
|
import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
|
|
8
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
10
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
11
11
|
import { OverlayElement } from '@vaadin/vaadin-overlay/src/vaadin-overlay.js';
|
|
12
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
13
|
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
13
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
14
14
|
import { DialogDraggableMixin } from './vaadin-dialog-draggable-mixin.js';
|
|
15
15
|
import { DialogResizableMixin } from './vaadin-dialog-resizable-mixin.js';
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
3
2
|
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
3
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
4
|
|
|
5
5
|
const dialogOverlay = css`
|
|
6
6
|
/* Optical centering */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
|
-
import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
|
|
3
1
|
import '@vaadin/vaadin-material-styles/shadow.js';
|
|
2
|
+
import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
|
|
3
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
4
|
|
|
5
5
|
const dialogOverlay = css`
|
|
6
6
|
[part='overlay'] {
|