@vaadin/app-layout 25.3.0-dev.1fa5a51482 → 25.3.0-rc1

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-dev.1fa5a51482",
3
+ "version": "25.3.0-rc1",
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-dev.1fa5a51482",
39
- "@vaadin/button": "25.3.0-dev.1fa5a51482",
40
- "@vaadin/component-base": "25.3.0-dev.1fa5a51482",
41
- "@vaadin/vaadin-themable-mixin": "25.3.0-dev.1fa5a51482",
38
+ "@vaadin/a11y-base": "25.3.0-rc1",
39
+ "@vaadin/button": "25.3.0-rc1",
40
+ "@vaadin/component-base": "25.3.0-rc1",
41
+ "@vaadin/vaadin-themable-mixin": "25.3.0-rc1",
42
42
  "lit": "^3.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@vaadin/aura": "25.3.0-dev.1fa5a51482",
46
- "@vaadin/chai-plugins": "25.3.0-dev.1fa5a51482",
47
- "@vaadin/test-runner-commands": "25.3.0-dev.1fa5a51482",
45
+ "@vaadin/aura": "25.3.0-rc1",
46
+ "@vaadin/chai-plugins": "25.3.0-rc1",
47
+ "@vaadin/test-runner-commands": "25.3.0-rc1",
48
48
  "@vaadin/testing-helpers": "^2.0.0",
49
- "@vaadin/vaadin-lumo-styles": "25.3.0-dev.1fa5a51482",
49
+ "@vaadin/vaadin-lumo-styles": "25.3.0-rc1",
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": "1cd5964b758ffbce3ddb6248a1997f55f8e0ebf6"
57
+ "gitHead": "d4809590b2f61bd607e376ab3dec84f4bfb059a7"
58
58
  }
@@ -154,6 +154,18 @@ export const AppLayoutMixin = (superclass) =>
154
154
  this.addController(this.__focusTrapController);
155
155
  this.__setAriaExpanded();
156
156
 
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);
168
+
157
169
  this.$.drawer.addEventListener('transitionstart', () => {
158
170
  this.__isDrawerAnimating = true;
159
171
  });
@@ -175,16 +187,22 @@ export const AppLayoutMixin = (superclass) =>
175
187
 
176
188
  /** @private */
177
189
  __onNavbarSlotChange() {
178
- this.__scheduleResize(this.$.navbarTop);
179
- this.__scheduleResize(this.$.navbarBottom);
190
+ const { touchOptimized } = this.__readCSSState();
191
+ this.__setTouchOptimized(touchOptimized);
180
192
  this.toggleAttribute('has-navbar', !!this.querySelector('[slot="navbar"]'));
193
+
194
+ const { navbarTopOffsetSize, navbarBottomOffsetSize } = this.__readCSSState();
195
+ this.__setNavbarTopOffsetSize(navbarTopOffsetSize);
196
+ this.__setNavbarBottomOffsetSize(navbarBottomOffsetSize);
181
197
  }
182
198
 
183
199
  /** @private */
184
200
  __onDrawerSlotChange() {
185
- this.__scheduleResize(this.$.drawer);
186
201
  this.__updateDrawerSize();
187
202
  this.toggleAttribute('has-drawer', !!this.querySelector('[slot="drawer"]'));
203
+
204
+ const { drawerOffsetSize } = this.__readCSSState();
205
+ this.__setDrawerOffsetSize(drawerOffsetSize);
188
206
  }
189
207
 
190
208
  /** @private */
@@ -194,12 +212,8 @@ export const AppLayoutMixin = (superclass) =>
194
212
  const isHostResized = entries.some(({ target }) => target === this);
195
213
  const isNavbarResized = entries.some(({ target }) => [this.$.navbarTop, this.$.navbarBottom].includes(target));
196
214
 
197
- const overlayMode = this._getCustomPropertyValue('--vaadin-app-layout-drawer-overlay') === 'true';
198
- const touchOptimized = this._getCustomPropertyValue('--vaadin-app-layout-touch-optimized') === 'true';
199
-
200
- const drawerRect = this.$.drawer.getBoundingClientRect();
201
- const navbarTopRect = this.$.navbarTop.getBoundingClientRect();
202
- const navbarBottomRect = this.$.navbarBottom.getBoundingClientRect();
215
+ const { overlayMode, touchOptimized, drawerOffsetSize, navbarTopOffsetSize, navbarBottomOffsetSize } =
216
+ this.__readCSSState();
203
217
 
204
218
  const isDrawerAnimating = this.__isDrawerAnimating;
205
219
 
@@ -214,11 +228,9 @@ export const AppLayoutMixin = (superclass) =>
214
228
  }
215
229
 
216
230
  if (!isDrawerAnimating) {
217
- this.__setOffsetSize({
218
- drawerRect,
219
- navbarTopRect,
220
- navbarBottomRect,
221
- });
231
+ this.__setDrawerOffsetSize(drawerOffsetSize);
232
+ this.__setNavbarTopOffsetSize(navbarTopOffsetSize);
233
+ this.__setNavbarBottomOffsetSize(navbarBottomOffsetSize);
222
234
  }
223
235
  });
224
236
  }
@@ -325,10 +337,18 @@ export const AppLayoutMixin = (superclass) =>
325
337
  }
326
338
 
327
339
  /** @private */
328
- __setOffsetSize({ drawerRect, navbarTopRect, navbarBottomRect }) {
329
- this.style.setProperty('--_vaadin-app-layout-drawer-offset-size', `${drawerRect.width}px`);
330
- this.style.setProperty('--_vaadin-app-layout-navbar-offset-size', `${navbarTopRect.height}px`);
331
- 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`);
332
352
  }
333
353
 
334
354
  /** @private */
@@ -503,17 +523,11 @@ export const AppLayoutMixin = (superclass) =>
503
523
  });
504
524
  }
505
525
 
506
- if (this.$.navbarTop.querySelector('[name=navbar]').assignedNodes().length === 0) {
507
- this.$.navbarTop.setAttribute('hidden', '');
508
- } else {
509
- this.$.navbarTop.removeAttribute('hidden');
510
- }
526
+ const hasNavbar = this.$.navbarTop.querySelector('[name=navbar]').assignedNodes().length > 0;
527
+ this.$.navbarTop.toggleAttribute('hidden', !hasNavbar);
511
528
 
512
- if (this.$.navbarBottom.querySelector('[name=navbar-bottom]').assignedNodes().length === 0) {
513
- this.$.navbarBottom.setAttribute('hidden', '');
514
- } else {
515
- this.$.navbarBottom.removeAttribute('hidden');
516
- }
529
+ const hasNavbarBottom = this.$.navbarBottom.querySelector('[name=navbar-bottom]').assignedNodes().length > 0;
530
+ this.$.navbarBottom.toggleAttribute('hidden', !hasNavbarBottom);
517
531
  }
518
532
 
519
533
  /** @protected */
@@ -538,4 +552,15 @@ export const AppLayoutMixin = (superclass) =>
538
552
  this.__resizeObserver.unobserve(element);
539
553
  this.__resizeObserver.observe(element);
540
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
+ }
541
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-dev.1fa5a51482",
4
+ "version": "25.3.0-rc1",
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-dev.1fa5a51482",
4
+ "version": "25.3.0-rc1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {