@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 CHANGED
@@ -1,13 +1,10 @@
1
- # <vaadin-dialog>
1
+ # @vaadin/dialog
2
2
 
3
- [Live Demo ↗](https://vaadin.com/components/vaadin-dialog/html-examples/dialog-basic-demos)
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
- [<vaadin-dialog>](https://vaadin.com/components/vaadin-dialog) is a Web Component for customized modal dialogs, part of the [Vaadin components](https://vaadin.com/components).
5
+ [Documentation + Live Demo ](https://vaadin.com/docs/latest/ds/components/dialog)
8
6
 
9
7
  [![npm version](https://badgen.net/npm/v/@vaadin/dialog)](https://www.npmjs.com/package/@vaadin/dialog)
10
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-dialog)
11
8
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](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/vaadin-dialog/master/screenshot.png" width="264" alt="Screenshot of vaadin-dialog">](https://vaadin.com/components/vaadin-dialog)
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 `vaadin-dialog`:
25
+ Install the component:
29
26
 
30
27
  ```sh
31
- npm i @vaadin/dialog --save
28
+ npm i @vaadin/dialog
32
29
  ```
33
30
 
34
- Once installed, import it in your application:
31
+ Once installed, import the component in your application:
35
32
 
36
33
  ```js
37
- import '@vaadin/dialog/vaadin-dialog.js';
34
+ import '@vaadin/dialog';
38
35
  ```
39
36
 
40
- ## Getting started
37
+ ## Themes
41
38
 
42
- Vaadin components use the Lumo theme by default.
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 correspondent file from the `theme/material` folder.
42
+ To use the Material theme, import the component from the `theme/material` folder:
45
43
 
46
- ## Entry points
47
-
48
- - The component with the Lumo theme:
49
-
50
- `theme/lumo/vaadin-dialog.js`
44
+ ```js
45
+ import '@vaadin/dialog/theme/material/vaadin-dialog.js';
46
+ ```
51
47
 
52
- - The component with the Material theme:
48
+ You can also import the Lumo version of the component explicitly:
53
49
 
54
- `theme/material/vaadin-dialog.js`
50
+ ```js
51
+ import '@vaadin/dialog/theme/lumo/vaadin-dialog.js';
52
+ ```
55
53
 
56
- - Alias for `theme/lumo/vaadin-dialog.js`:
54
+ Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
57
55
 
58
- `vaadin-dialog.js`
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 usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
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.0-beta1",
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.0-beta1",
38
- "@vaadin/vaadin-lumo-styles": "22.0.0-beta1",
39
- "@vaadin/vaadin-material-styles": "22.0.0-beta1",
40
- "@vaadin/vaadin-overlay": "22.0.0-beta1",
41
- "@vaadin/vaadin-themable-mixin": "22.0.0-beta1"
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.0-beta1",
46
- "@vaadin/testing-helpers": "^0.3.0",
47
- "@vaadin/text-area": "22.0.0-beta1",
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": "4cf8a9d0504994200c610e44b3676114fef49c1e"
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 new (...args: any[]) => {}>(
8
+ export declare function DialogDraggableMixin<T extends Constructor<HTMLElement>>(
8
9
  base: T
9
- ): T & DialogDraggableMixinConstructor;
10
+ ): T & Constructor<DialogDraggableMixinClass>;
10
11
 
11
- interface DialogDraggableMixinConstructor {
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
- import { getMouseOrFirstTouchEvent, eventInWindow } from './vaadin-dialog-utils.js';
2
-
3
- const TOUCH_DEVICE = (() => {
4
- try {
5
- document.createEvent('TouchEvent');
6
- return true;
7
- } catch (e) {
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: TOUCH_DEVICE
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 new (...args: any[]) => {}>(
8
+ export declare function DialogResizableMixin<T extends Constructor<HTMLElement>>(
8
9
  base: T
9
- ): T & DialogResizableMixinConstructor;
10
+ ): T & Constructor<DialogResizableMixinClass>;
10
11
 
11
- interface DialogResizableMixinConstructor {
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 { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import { getMouseOrFirstTouchEvent, eventInWindow } from './vaadin-dialog-utils.js';
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',
@@ -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'] {