@vaadin/app-layout 25.3.0-dev.3a3c2d7d2a → 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.
@@ -287,34 +287,6 @@
287
287
  "name": "primary-section-changed"
288
288
  }
289
289
  ],
290
- "mixins": [
291
- {
292
- "name": "AppLayoutMixin",
293
- "module": "src/vaadin-app-layout-mixin.js"
294
- },
295
- {
296
- "name": "ElementMixin",
297
- "package": "@vaadin/component-base/src/element-mixin.js"
298
- },
299
- {
300
- "name": "ThemableMixin",
301
- "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
302
- },
303
- {
304
- "name": "PolylitMixin",
305
- "package": "@vaadin/component-base/src/polylit-mixin.js"
306
- },
307
- {
308
- "name": "LumoInjectionMixin",
309
- "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
310
- }
311
- ],
312
- "superclass": {
313
- "name": "LitElement",
314
- "package": "lit"
315
- },
316
- "tagName": "vaadin-app-layout",
317
- "customElement": true,
318
290
  "attributes": [
319
291
  {
320
292
  "name": "close-drawer-on",
@@ -375,8 +347,43 @@
375
347
  "name": "AppLayoutMixin",
376
348
  "module": "src/vaadin-app-layout-mixin.js"
377
349
  }
350
+ },
351
+ {
352
+ "type": {
353
+ "text": "string"
354
+ },
355
+ "description": "The theme variants to apply to the component.",
356
+ "name": "theme"
378
357
  }
379
- ]
358
+ ],
359
+ "mixins": [
360
+ {
361
+ "name": "AppLayoutMixin",
362
+ "module": "src/vaadin-app-layout-mixin.js"
363
+ },
364
+ {
365
+ "name": "ElementMixin",
366
+ "package": "@vaadin/component-base/src/element-mixin.js"
367
+ },
368
+ {
369
+ "name": "ThemableMixin",
370
+ "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
371
+ },
372
+ {
373
+ "name": "PolylitMixin",
374
+ "package": "@vaadin/component-base/src/polylit-mixin.js"
375
+ },
376
+ {
377
+ "name": "LumoInjectionMixin",
378
+ "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
379
+ }
380
+ ],
381
+ "superclass": {
382
+ "name": "LitElement",
383
+ "package": "lit"
384
+ },
385
+ "tagName": "vaadin-app-layout",
386
+ "customElement": true
380
387
  }
381
388
  ],
382
389
  "exports": [
@@ -442,6 +449,13 @@
442
449
  "name": "DisabledMixin",
443
450
  "package": "@vaadin/a11y-base/src/disabled-mixin.js"
444
451
  }
452
+ },
453
+ {
454
+ "type": {
455
+ "text": "string"
456
+ },
457
+ "description": "The theme variants to apply to the component.",
458
+ "name": "theme"
445
459
  }
446
460
  ],
447
461
  "mixins": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/app-layout",
3
- "version": "25.3.0-dev.3a3c2d7d2a",
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.3a3c2d7d2a",
39
- "@vaadin/button": "25.3.0-dev.3a3c2d7d2a",
40
- "@vaadin/component-base": "25.3.0-dev.3a3c2d7d2a",
41
- "@vaadin/vaadin-themable-mixin": "25.3.0-dev.3a3c2d7d2a",
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.3a3c2d7d2a",
46
- "@vaadin/chai-plugins": "25.3.0-dev.3a3c2d7d2a",
47
- "@vaadin/test-runner-commands": "25.3.0-dev.3a3c2d7d2a",
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.3a3c2d7d2a",
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": "ac506ca7800c23e05da55863c56bcedf12812d37"
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
  });
@@ -169,22 +181,28 @@ export const AppLayoutMixin = (superclass) =>
169
181
  super.disconnectedCallback();
170
182
  this.__resizeObserver.disconnect();
171
183
  this.removeEventListener('drawer-toggle-click', this.__drawerToggleClickListener);
172
- window.removeEventListener('close-overlay-drawer', this.__drawerToggleClickListener);
184
+ window.removeEventListener('close-overlay-drawer', this.__closeOverlayDrawerListener);
173
185
  window.removeEventListener('keydown', this.__onDrawerKeyDown);
174
186
  }
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 */
@@ -448,7 +468,9 @@ export const AppLayoutMixin = (superclass) =>
448
468
  }
449
469
 
450
470
  /** @private */
451
- _onBackdropClick() {
471
+ _onBackdropClick(event) {
472
+ // End the ghost click window on the first click (see `_onBackdropTouchend`).
473
+ event.currentTarget.style.removeProperty('pointer-events');
452
474
  this._close();
453
475
  }
454
476
 
@@ -458,6 +480,18 @@ export const AppLayoutMixin = (superclass) =>
458
480
  // on clickable element behind the backdrop
459
481
  event.preventDefault();
460
482
 
483
+ // On iOS home screen (standalone) apps, `preventDefault()` on `touchend`
484
+ // does not reliably suppress the synthesized "ghost" click, which occurs
485
+ // on medium-length taps only. Keep the invisible backdrop hit-testable for
486
+ // a short while after closing, so that if a ghost click occurs it lands on
487
+ // the backdrop instead of the element behind it.
488
+ if (navigator.standalone) {
489
+ const backdrop = event.currentTarget;
490
+ backdrop.style.pointerEvents = 'auto';
491
+ // The ghost click arrives shortly after `touchend`.
492
+ setTimeout(() => backdrop.style.removeProperty('pointer-events'), 400);
493
+ }
494
+
461
495
  this._close();
462
496
  }
463
497
 
@@ -489,17 +523,11 @@ export const AppLayoutMixin = (superclass) =>
489
523
  });
490
524
  }
491
525
 
492
- if (this.$.navbarTop.querySelector('[name=navbar]').assignedNodes().length === 0) {
493
- this.$.navbarTop.setAttribute('hidden', '');
494
- } else {
495
- this.$.navbarTop.removeAttribute('hidden');
496
- }
526
+ const hasNavbar = this.$.navbarTop.querySelector('[name=navbar]').assignedNodes().length > 0;
527
+ this.$.navbarTop.toggleAttribute('hidden', !hasNavbar);
497
528
 
498
- if (this.$.navbarBottom.querySelector('[name=navbar-bottom]').assignedNodes().length === 0) {
499
- this.$.navbarBottom.setAttribute('hidden', '');
500
- } else {
501
- this.$.navbarBottom.removeAttribute('hidden');
502
- }
529
+ const hasNavbarBottom = this.$.navbarBottom.querySelector('[name=navbar-bottom]').assignedNodes().length > 0;
530
+ this.$.navbarBottom.toggleAttribute('hidden', !hasNavbarBottom);
503
531
  }
504
532
 
505
533
  /** @protected */
@@ -524,4 +552,15 @@ export const AppLayoutMixin = (superclass) =>
524
552
  this.__resizeObserver.unobserve(element);
525
553
  this.__resizeObserver.observe(element);
526
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
+ }
527
566
  };
@@ -127,6 +127,7 @@ import { AppLayoutMixin } from './vaadin-app-layout-mixin.js';
127
127
  * @fires {CustomEvent} overlay-changed - Fired when the `overlay` property changes.
128
128
  * @fires {CustomEvent} primary-section-changed - Fired when the `primarySection` property changes.
129
129
  *
130
+ * @attr {string} theme - The theme variants to apply to the component.
130
131
  * @customElement vaadin-app-layout
131
132
  * @extends HTMLElement
132
133
  */
@@ -55,6 +55,7 @@ import { drawerToggle } from './styles/vaadin-drawer-toggle-base-styles.js';
55
55
  *
56
56
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
57
57
  *
58
+ * @attr {string} theme - The theme variants to apply to the component.
58
59
  * @customElement vaadin-drawer-toggle
59
60
  * @extends HTMLElement
60
61
  */
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.3a3c2d7d2a",
4
+ "version": "25.3.0-rc1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -42,9 +42,7 @@
42
42
  "description": "The theme variants to apply to the component.",
43
43
  "value": {
44
44
  "type": [
45
- "string",
46
- "null",
47
- "undefined"
45
+ "string"
48
46
  ]
49
47
  }
50
48
  }
@@ -131,9 +129,7 @@
131
129
  "description": "The theme variants to apply to the component.",
132
130
  "value": {
133
131
  "type": [
134
- "string",
135
- "null",
136
- "undefined"
132
+ "string"
137
133
  ]
138
134
  }
139
135
  }
@@ -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.3a3c2d7d2a",
4
+ "version": "25.3.0-rc1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {