@vaadin/app-layout 24.2.0-alpha1 → 24.2.0-alpha3
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 +9 -9
- package/src/vaadin-app-layout.js +29 -3
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/app-layout",
|
|
3
|
-
"version": "24.2.0-
|
|
3
|
+
"version": "24.2.0-alpha3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.2.0-
|
|
40
|
-
"@vaadin/button": "24.2.0-
|
|
41
|
-
"@vaadin/component-base": "24.2.0-
|
|
42
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0-
|
|
43
|
-
"@vaadin/vaadin-material-styles": "24.2.0-
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.2.0-alpha3",
|
|
40
|
+
"@vaadin/button": "24.2.0-alpha3",
|
|
41
|
+
"@vaadin/component-base": "24.2.0-alpha3",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "24.2.0-alpha3",
|
|
43
|
+
"@vaadin/vaadin-material-styles": "24.2.0-alpha3",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "24.2.0-alpha3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@esm-bundle/chai": "^4.3.4",
|
|
48
|
-
"@vaadin/tabs": "24.2.0-
|
|
48
|
+
"@vaadin/tabs": "24.2.0-alpha3",
|
|
49
49
|
"@vaadin/testing-helpers": "^0.4.2",
|
|
50
50
|
"sinon": "^13.0.2"
|
|
51
51
|
},
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"web-types.json",
|
|
54
54
|
"web-types.lit.json"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "e5d1e1ed2d01b56d5922e18a3fcb7cd306351954"
|
|
57
57
|
}
|
package/src/vaadin-app-layout.js
CHANGED
|
@@ -276,7 +276,7 @@ class AppLayout extends ElementMixin(ThemableMixin(ControllerMixin(PolymerElemen
|
|
|
276
276
|
<slot name="navbar"></slot>
|
|
277
277
|
</div>
|
|
278
278
|
<div part="backdrop" on-click="_onBackdropClick" on-touchend="_onBackdropTouchend"></div>
|
|
279
|
-
<div part="drawer" id="drawer"
|
|
279
|
+
<div part="drawer" id="drawer">
|
|
280
280
|
<slot name="drawer" id="drawerSlot"></slot>
|
|
281
281
|
</div>
|
|
282
282
|
<div content>
|
|
@@ -399,6 +399,7 @@ class AppLayout extends ElementMixin(ThemableMixin(ControllerMixin(PolymerElemen
|
|
|
399
399
|
// TODO(jouni): might want to debounce
|
|
400
400
|
this.__boundResizeListener = this._resize.bind(this);
|
|
401
401
|
this.__drawerToggleClickListener = this._drawerToggleClick.bind(this);
|
|
402
|
+
this.__onDrawerKeyDown = this.__onDrawerKeyDown.bind(this);
|
|
402
403
|
this.__closeOverlayDrawerListener = this.__closeOverlayDrawer.bind(this);
|
|
403
404
|
this.__trapFocusInDrawer = this.__trapFocusInDrawer.bind(this);
|
|
404
405
|
this.__releaseFocusFromDrawer = this.__releaseFocusFromDrawer.bind(this);
|
|
@@ -440,14 +441,20 @@ class AppLayout extends ElementMixin(ThemableMixin(ControllerMixin(PolymerElemen
|
|
|
440
441
|
|
|
441
442
|
this._navbarSizeObserver = new ResizeObserver(() => {
|
|
442
443
|
requestAnimationFrame(() => {
|
|
443
|
-
|
|
444
|
-
|
|
444
|
+
// Prevent updating offset size multiple times
|
|
445
|
+
// during the drawer open / close transition.
|
|
446
|
+
if (this.__isDrawerAnimating) {
|
|
447
|
+
this.__updateOffsetSizePending = true;
|
|
448
|
+
} else {
|
|
449
|
+
this._updateOffsetSize();
|
|
450
|
+
}
|
|
445
451
|
});
|
|
446
452
|
});
|
|
447
453
|
this._navbarSizeObserver.observe(this.$.navbarTop);
|
|
448
454
|
this._navbarSizeObserver.observe(this.$.navbarBottom);
|
|
449
455
|
|
|
450
456
|
window.addEventListener('close-overlay-drawer', this.__closeOverlayDrawerListener);
|
|
457
|
+
window.addEventListener('keydown', this.__onDrawerKeyDown);
|
|
451
458
|
}
|
|
452
459
|
|
|
453
460
|
/** @protected */
|
|
@@ -455,6 +462,24 @@ class AppLayout extends ElementMixin(ThemableMixin(ControllerMixin(PolymerElemen
|
|
|
455
462
|
super.ready();
|
|
456
463
|
this.addController(this.__focusTrapController);
|
|
457
464
|
this.__setAriaExpanded();
|
|
465
|
+
|
|
466
|
+
this.$.drawer.addEventListener('transitionstart', () => {
|
|
467
|
+
this.__isDrawerAnimating = true;
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
this.$.drawer.addEventListener('transitionend', () => {
|
|
471
|
+
// Update offset size after drawer animation.
|
|
472
|
+
if (this.__updateOffsetSizePending) {
|
|
473
|
+
this.__updateOffsetSizePending = false;
|
|
474
|
+
this._updateOffsetSize();
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Delay resetting the flag until animation frame
|
|
478
|
+
// to avoid updating offset size again on resize.
|
|
479
|
+
requestAnimationFrame(() => {
|
|
480
|
+
this.__isDrawerAnimating = false;
|
|
481
|
+
});
|
|
482
|
+
});
|
|
458
483
|
}
|
|
459
484
|
|
|
460
485
|
/** @protected */
|
|
@@ -474,6 +499,7 @@ class AppLayout extends ElementMixin(ThemableMixin(ControllerMixin(PolymerElemen
|
|
|
474
499
|
window.removeEventListener('resize', this.__boundResizeListener);
|
|
475
500
|
this.removeEventListener('drawer-toggle-click', this.__drawerToggleClickListener);
|
|
476
501
|
window.removeEventListener('close-overlay-drawer', this.__drawerToggleClickListener);
|
|
502
|
+
window.removeEventListener('keydown', this.__onDrawerKeyDown);
|
|
477
503
|
}
|
|
478
504
|
|
|
479
505
|
/**
|
package/web-types.json
CHANGED