@vaadin/vaadin-overlay 22.0.0-alpha6 → 22.0.0-beta1

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,10 +1,29 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-overlay",
3
- "version": "22.0.0-alpha6",
3
+ "version": "22.0.0-beta1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "vaadin-overlay",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/vaadin/web-components.git",
12
+ "directory": "packages/vaadin-overlay"
13
+ },
14
+ "author": "Vaadin Ltd",
15
+ "homepage": "https://vaadin.com/components",
16
+ "bugs": {
17
+ "url": "https://github.com/vaadin/vaadin-overlay/issues"
18
+ },
5
19
  "main": "vaadin-overlay.js",
6
20
  "module": "vaadin-overlay.js",
7
- "repository": "vaadin/vaadin-overlay",
21
+ "files": [
22
+ "src",
23
+ "theme",
24
+ "vaadin-*.d.ts",
25
+ "vaadin-*.js"
26
+ ],
8
27
  "keywords": [
9
28
  "Vaadin",
10
29
  "vaadin-overlay",
@@ -13,37 +32,22 @@
13
32
  "web-component",
14
33
  "polymer"
15
34
  ],
16
- "author": "Vaadin Ltd",
17
- "license": "Apache-2.0",
18
- "bugs": {
19
- "url": "https://github.com/vaadin/vaadin-overlay/issues"
20
- },
21
- "homepage": "https://vaadin.com/components",
22
- "files": [
23
- "vaadin-*.d.ts",
24
- "vaadin-*.js",
25
- "src",
26
- "theme"
27
- ],
28
35
  "dependencies": {
29
36
  "@polymer/polymer": "^3.0.0",
30
- "@vaadin/vaadin-element-mixin": "^22.0.0-alpha6",
31
- "@vaadin/vaadin-lumo-styles": "^22.0.0-alpha6",
32
- "@vaadin/vaadin-material-styles": "^22.0.0-alpha6",
33
- "@vaadin/vaadin-themable-mixin": "^22.0.0-alpha6"
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-themable-mixin": "22.0.0-beta1"
34
41
  },
35
42
  "devDependencies": {
36
43
  "@esm-bundle/chai": "^4.3.4",
37
44
  "@polymer/iron-overlay-behavior": "^3.0.0",
38
- "@vaadin/button": "^22.0.0-alpha6",
39
- "@vaadin/radio-group": "^22.0.0-alpha6",
45
+ "@vaadin/button": "22.0.0-beta1",
46
+ "@vaadin/radio-group": "22.0.0-beta1",
40
47
  "@vaadin/testing-helpers": "^0.3.0",
41
- "@vaadin/vaadin-text-field": "^22.0.0-alpha6",
42
- "lit": "^2.0.0-rc.1",
48
+ "@vaadin/text-field": "22.0.0-beta1",
49
+ "lit": "^2.0.0",
43
50
  "sinon": "^9.2.1"
44
51
  },
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
- "gitHead": "4b136b1c7da8942960e7255f40c27859125b3a45"
52
+ "gitHead": "4cf8a9d0504994200c610e44b3676114fef49c1e"
49
53
  }
@@ -107,7 +107,7 @@ export const PositionMixin = (superClass) =>
107
107
  this.__margins[propName] = parseInt(computedStyle[propName], 10);
108
108
  });
109
109
  }
110
- this.__isRTL = computedStyle.direction === 'rtl';
110
+ this.setAttribute('dir', computedStyle.direction);
111
111
 
112
112
  this._updatePosition();
113
113
  // Schedule another position update (to cover virtual keyboard opening for example)
@@ -115,6 +115,10 @@ export const PositionMixin = (superClass) =>
115
115
  }
116
116
  }
117
117
 
118
+ get __isRTL() {
119
+ return this.getAttribute('dir') === 'rtl';
120
+ }
121
+
118
122
  __positionSettingsChanged() {
119
123
  this._updatePosition();
120
124
  }
@@ -160,6 +164,12 @@ export const PositionMixin = (superClass) =>
160
164
 
161
165
  // Apply the positioning properties to the overlay
162
166
  Object.assign(this.style, verticalProps, horizontalProps);
167
+
168
+ this.toggleAttribute('bottom-aligned', !shouldAlignStartVertically);
169
+ this.toggleAttribute('top-aligned', shouldAlignStartVertically);
170
+
171
+ this.toggleAttribute('end-aligned', !flexStart);
172
+ this.toggleAttribute('start-aligned', flexStart);
163
173
  }
164
174
 
165
175
  __shouldAlignStartHorizontally(targetRect, rtl) {
@@ -1,8 +1,23 @@
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 { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
1
7
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
2
8
 
3
- import { DirMixin } from '@vaadin/vaadin-element-mixin/vaadin-dir-mixin.js';
9
+ export type OverlayRenderer = (root: HTMLElement, owner: HTMLElement, model?: object) => void;
10
+
11
+ /**
12
+ * Fired when the `opened` property changes.
13
+ */
14
+ export type OverlayOpenedChangedEvent = CustomEvent<{ value: boolean }>;
4
15
 
5
- import { OverlayEventMap, OverlayRenderer } from './interfaces';
16
+ export interface OverlayElementEventMap {
17
+ 'opened-changed': OverlayOpenedChangedEvent;
18
+ }
19
+
20
+ export type OverlayEventMap = HTMLElementEventMap & OverlayElementEventMap;
6
21
 
7
22
  /**
8
23
  * `<vaadin-overlay>` is a Web Component for creating overlays. The content of the overlay
@@ -209,13 +224,6 @@ declare class OverlayElement extends ThemableMixin(DirMixin(HTMLElement)) {
209
224
  */
210
225
  requestContentUpdate(): void;
211
226
 
212
- /**
213
- * Manually invoke existing renderer.
214
- *
215
- * @deprecated Since Vaadin 21, `render()` is deprecated. Please use `requestContentUpdate()` instead.
216
- */
217
- render(): void;
218
-
219
227
  _isFocused(element: Element | null): boolean;
220
228
 
221
229
  _focusedIndex(elements: Array<Element | null> | null): number;
@@ -7,8 +7,8 @@ import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
7
7
  import { templatize } from '@polymer/polymer/lib/utils/templatize.js';
8
8
  import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
9
9
  import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
10
+ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { DirMixin } from '@vaadin/vaadin-element-mixin/vaadin-dir-mixin.js';
12
12
  import { FocusablesHelper } from './vaadin-focusables-helper.js';
13
13
 
14
14
  /**
@@ -457,17 +457,6 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
457
457
  }
458
458
  }
459
459
 
460
- /**
461
- * Manually invoke existing renderer.
462
- *
463
- * @deprecated Since Vaadin 21, `render()` is deprecated. Please use `requestContentUpdate()` instead.
464
- */
465
- render() {
466
- console.warn('WARNING: Since Vaadin 21, render() is deprecated. Please use requestContentUpdate() instead.');
467
-
468
- this.requestContentUpdate();
469
- }
470
-
471
460
  /** @private */
472
461
  _ironOverlayCanceled(event) {
473
462
  event.preventDefault();
@@ -1,2 +1 @@
1
1
  export * from './src/vaadin-overlay.js';
2
- export * from './src/interfaces';
@@ -1,12 +0,0 @@
1
- export type OverlayRenderer = (root: HTMLElement, owner: HTMLElement, model?: object) => void;
2
-
3
- /**
4
- * Fired when the `opened` property changes.
5
- */
6
- export type OverlayOpenedChangedEvent = CustomEvent<{ value: boolean }>;
7
-
8
- export interface OverlayElementEventMap {
9
- 'opened-changed': OverlayOpenedChangedEvent;
10
- }
11
-
12
- export type OverlayEventMap = HTMLElementEventMap & OverlayElementEventMap;