@vaadin/app-layout 25.3.0-beta1 → 25.3.0-beta3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/app-layout",
3
- "version": "25.3.0-beta1",
3
+ "version": "25.3.0-beta3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,18 +35,18 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.3.0-beta1",
39
- "@vaadin/button": "25.3.0-beta1",
40
- "@vaadin/component-base": "25.3.0-beta1",
41
- "@vaadin/vaadin-themable-mixin": "25.3.0-beta1",
38
+ "@vaadin/a11y-base": "25.3.0-beta3",
39
+ "@vaadin/button": "25.3.0-beta3",
40
+ "@vaadin/component-base": "25.3.0-beta3",
41
+ "@vaadin/vaadin-themable-mixin": "25.3.0-beta3",
42
42
  "lit": "^3.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@vaadin/aura": "25.3.0-beta1",
46
- "@vaadin/chai-plugins": "25.3.0-beta1",
47
- "@vaadin/test-runner-commands": "25.3.0-beta1",
45
+ "@vaadin/aura": "25.3.0-beta3",
46
+ "@vaadin/chai-plugins": "25.3.0-beta3",
47
+ "@vaadin/test-runner-commands": "25.3.0-beta3",
48
48
  "@vaadin/testing-helpers": "^2.0.0",
49
- "@vaadin/vaadin-lumo-styles": "25.3.0-beta1",
49
+ "@vaadin/vaadin-lumo-styles": "25.3.0-beta3",
50
50
  "sinon": "^22.0.0"
51
51
  },
52
52
  "customElements": "custom-elements.json",
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "295432e44a6967e1aff36462b2e3e1d0e64eb8cc"
57
+ "gitHead": "1ea43188e1297f6898cbf9d3610b85a7a2cca6f0"
58
58
  }
@@ -155,6 +155,16 @@ export const AppLayoutMixin = (superclass) =>
155
155
  this.__setAriaExpanded();
156
156
 
157
157
  this.__updateDrawerSize();
158
+ this._blockAnimationUntilAfterNextRender();
159
+
160
+ const { overlayMode, touchOptimized } = this.__readCSSState();
161
+ this.__setOverlayMode(overlayMode);
162
+ this.__setTouchOptimized(touchOptimized);
163
+
164
+ const { drawerOffsetSize, navbarTopOffsetSize, navbarBottomOffsetSize } = this.__readCSSState();
165
+ this.__setDrawerOffsetSize(drawerOffsetSize);
166
+ this.__setNavbarTopOffsetSize(navbarTopOffsetSize);
167
+ this.__setNavbarBottomOffsetSize(navbarBottomOffsetSize);
158
168
 
159
169
  this.$.drawer.addEventListener('transitionstart', () => {
160
170
  this.__isDrawerAnimating = true;
@@ -177,16 +187,22 @@ export const AppLayoutMixin = (superclass) =>
177
187
 
178
188
  /** @private */
179
189
  __onNavbarSlotChange() {
180
- this.__scheduleResize(this.$.navbarTop);
181
- this.__scheduleResize(this.$.navbarBottom);
190
+ const { touchOptimized } = this.__readCSSState();
191
+ this.__setTouchOptimized(touchOptimized);
182
192
  this.toggleAttribute('has-navbar', !!this.querySelector('[slot="navbar"]'));
193
+
194
+ const { navbarTopOffsetSize, navbarBottomOffsetSize } = this.__readCSSState();
195
+ this.__setNavbarTopOffsetSize(navbarTopOffsetSize);
196
+ this.__setNavbarBottomOffsetSize(navbarBottomOffsetSize);
183
197
  }
184
198
 
185
199
  /** @private */
186
200
  __onDrawerSlotChange() {
187
- this.__scheduleResize(this.$.drawer);
188
201
  this.__updateDrawerSize();
189
202
  this.toggleAttribute('has-drawer', !!this.querySelector('[slot="drawer"]'));
203
+
204
+ const { drawerOffsetSize } = this.__readCSSState();
205
+ this.__setDrawerOffsetSize(drawerOffsetSize);
190
206
  }
191
207
 
192
208
  /** @private */
@@ -196,12 +212,8 @@ export const AppLayoutMixin = (superclass) =>
196
212
  const isHostResized = entries.some(({ target }) => target === this);
197
213
  const isNavbarResized = entries.some(({ target }) => [this.$.navbarTop, this.$.navbarBottom].includes(target));
198
214
 
199
- const overlayMode = this._getCustomPropertyValue('--vaadin-app-layout-drawer-overlay') === 'true';
200
- const touchOptimized = this._getCustomPropertyValue('--vaadin-app-layout-touch-optimized') === 'true';
201
-
202
- const drawerRect = this.$.drawer.getBoundingClientRect();
203
- const navbarTopRect = this.$.navbarTop.getBoundingClientRect();
204
- const navbarBottomRect = this.$.navbarBottom.getBoundingClientRect();
215
+ const { overlayMode, touchOptimized, drawerOffsetSize, navbarTopOffsetSize, navbarBottomOffsetSize } =
216
+ this.__readCSSState();
205
217
 
206
218
  const isDrawerAnimating = this.__isDrawerAnimating;
207
219
 
@@ -216,11 +228,9 @@ export const AppLayoutMixin = (superclass) =>
216
228
  }
217
229
 
218
230
  if (!isDrawerAnimating) {
219
- this.__setOffsetSize({
220
- drawerRect,
221
- navbarTopRect,
222
- navbarBottomRect,
223
- });
231
+ this.__setDrawerOffsetSize(drawerOffsetSize);
232
+ this.__setNavbarTopOffsetSize(navbarTopOffsetSize);
233
+ this.__setNavbarBottomOffsetSize(navbarBottomOffsetSize);
224
234
  }
225
235
  });
226
236
  }
@@ -327,10 +337,18 @@ export const AppLayoutMixin = (superclass) =>
327
337
  }
328
338
 
329
339
  /** @private */
330
- __setOffsetSize({ drawerRect, navbarTopRect, navbarBottomRect }) {
331
- this.style.setProperty('--_vaadin-app-layout-drawer-offset-size', `${drawerRect.width}px`);
332
- this.style.setProperty('--_vaadin-app-layout-navbar-offset-size', `${navbarTopRect.height}px`);
333
- this.style.setProperty('--_vaadin-app-layout-navbar-offset-size-bottom', `${navbarBottomRect.height}px`);
340
+ __setDrawerOffsetSize(offsetSize) {
341
+ this.style.setProperty('--_vaadin-app-layout-drawer-offset-size', `${offsetSize}px`);
342
+ }
343
+
344
+ /** @private */
345
+ __setNavbarTopOffsetSize(offsetSize) {
346
+ this.style.setProperty('--_vaadin-app-layout-navbar-offset-size', `${offsetSize}px`);
347
+ }
348
+
349
+ /** @private */
350
+ __setNavbarBottomOffsetSize(offsetSize) {
351
+ this.style.setProperty('--_vaadin-app-layout-navbar-offset-size-bottom', `${offsetSize}px`);
334
352
  }
335
353
 
336
354
  /** @private */
@@ -534,4 +552,15 @@ export const AppLayoutMixin = (superclass) =>
534
552
  this.__resizeObserver.unobserve(element);
535
553
  this.__resizeObserver.observe(element);
536
554
  }
555
+
556
+ /** @private */
557
+ __readCSSState() {
558
+ return {
559
+ overlayMode: this._getCustomPropertyValue('--vaadin-app-layout-drawer-overlay') === 'true',
560
+ touchOptimized: this._getCustomPropertyValue('--vaadin-app-layout-touch-optimized') === 'true',
561
+ drawerOffsetSize: this.$.drawer.getBoundingClientRect().width,
562
+ navbarTopOffsetSize: this.$.navbarTop.getBoundingClientRect().height,
563
+ navbarBottomOffsetSize: this.$.navbarBottom.getBoundingClientRect().height,
564
+ };
565
+ }
537
566
  };
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "25.3.0-beta1",
4
+ "version": "25.3.0-beta3",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "25.3.0-beta1",
4
+ "version": "25.3.0-beta3",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {