@vaadin/app-layout 24.6.5 → 24.7.0-alpha10

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2018 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { CSSResult } from 'lit';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2018 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2018 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2018 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -0,0 +1 @@
1
+ export * from './vaadin-app-layout.js';
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './detect-ios-navbar.js';
7
+ import './safe-area-inset.js';
8
+ import { html, LitElement } from 'lit';
9
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
+ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
+ import { AppLayoutMixin } from './vaadin-app-layout-mixin.js';
14
+ import { appLayoutStyles } from './vaadin-app-layout-styles.js';
15
+
16
+ /**
17
+ * LitElement based version of `<vaadin-app-layout>` web component.
18
+ *
19
+ * ## Disclaimer
20
+ *
21
+ * This component is an experiment and not yet a part of Vaadin platform.
22
+ * There is no ETA regarding specific Vaadin version where it'll land.
23
+ * Feel free to try this code in your apps as per Apache 2.0 license.
24
+ */
25
+ class AppLayout extends AppLayoutMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
26
+ static get is() {
27
+ return 'vaadin-app-layout';
28
+ }
29
+
30
+ static get styles() {
31
+ return appLayoutStyles;
32
+ }
33
+
34
+ /** @protected */
35
+ render() {
36
+ return html`
37
+ <div part="navbar" id="navbarTop">
38
+ <slot name="navbar" @slotchange="${this._updateTouchOptimizedMode}"></slot>
39
+ </div>
40
+ <div part="backdrop" @click="${this._onBackdropClick}" @touchend="${this._onBackdropTouchend}"></div>
41
+ <div part="drawer" id="drawer">
42
+ <slot name="drawer" id="drawerSlot" @slotchange="${this._updateDrawerSize}"></slot>
43
+ </div>
44
+ <div content>
45
+ <slot></slot>
46
+ </div>
47
+ <div part="navbar" id="navbarBottom" bottom hidden>
48
+ <slot name="navbar-bottom"></slot>
49
+ </div>
50
+ <div hidden>
51
+ <slot id="touchSlot" name="navbar touch-optimized" @slotchange="${this._updateTouchOptimizedMode}"></slot>
52
+ </div>
53
+ `;
54
+ }
55
+ }
56
+
57
+ defineCustomElement(AppLayout);
58
+
59
+ export { AppLayout };
@@ -0,0 +1 @@
1
+ export * from './vaadin-drawer-toggle.js';
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { html, LitElement } from 'lit';
7
+ import { buttonStyles } from '@vaadin/button/src/vaadin-button-base.js';
8
+ import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
9
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
+ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
11
+ import { isEmptyTextNode } from '@vaadin/component-base/src/dom-utils.js';
12
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
13
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
+ import { drawerToggle } from './vaadin-drawer-toggle-styles.js';
15
+
16
+ /**
17
+ * LitElement based version of `<vaadin-drawer-toggle>` web component.
18
+ *
19
+ * ## Disclaimer
20
+ *
21
+ * This component is an experiment and not yet a part of Vaadin platform.
22
+ * There is no ETA regarding specific Vaadin version where it'll land.
23
+ * Feel free to try this code in your apps as per Apache 2.0 license.
24
+ */
25
+ class DrawerToggle extends ButtonMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
26
+ static get is() {
27
+ return 'vaadin-drawer-toggle';
28
+ }
29
+
30
+ static get styles() {
31
+ return [buttonStyles, drawerToggle];
32
+ }
33
+
34
+ static get properties() {
35
+ return {
36
+ ariaLabel: {
37
+ type: String,
38
+ value: 'Toggle navigation panel',
39
+ reflectToAttribute: true,
40
+ sync: true,
41
+ },
42
+
43
+ /** @private */
44
+ _showFallbackIcon: {
45
+ type: Boolean,
46
+ value: false,
47
+ },
48
+ };
49
+ }
50
+
51
+ constructor() {
52
+ super();
53
+
54
+ this.addEventListener('click', () => {
55
+ this.dispatchEvent(new CustomEvent('drawer-toggle-click', { bubbles: true, composed: true }));
56
+ });
57
+ }
58
+
59
+ /** @protected */
60
+ render() {
61
+ return html`
62
+ <slot id="slot" @slotchange="${this._toggleFallbackIcon}">
63
+ <div part="icon"></div>
64
+ </slot>
65
+ <div part="icon" ?hidden="${!this._showFallbackIcon}"></div>
66
+ `;
67
+ }
68
+
69
+ /** @protected */
70
+ ready() {
71
+ super.ready();
72
+
73
+ this._toggleFallbackIcon();
74
+ }
75
+
76
+ /** @private */
77
+ _toggleFallbackIcon() {
78
+ const nodes = this.$.slot.assignedNodes();
79
+
80
+ // Show fallback icon if there are 1-2 empty text nodes assigned to the default slot.
81
+ this._showFallbackIcon = nodes.length > 0 && nodes.every((node) => isEmptyTextNode(node));
82
+ }
83
+ }
84
+
85
+ defineCustomElement(DrawerToggle);
86
+
87
+ export { DrawerToggle };
@@ -0,0 +1,2 @@
1
+ import './vaadin-app-layout-styles.js';
2
+ import '../../src/vaadin-lit-app-layout.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-app-layout-styles.js';
2
+ import '../../src/vaadin-lit-app-layout.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-drawer-toggle-styles.js';
2
+ import '../../src/vaadin-lit-drawer-toggle.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-drawer-toggle-styles.js';
2
+ import '../../src/vaadin-lit-drawer-toggle.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-app-layout-styles.js';
2
+ import '../../src/vaadin-lit-app-layout.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-app-layout-styles.js';
2
+ import '../../src/vaadin-lit-app-layout.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-drawer-toggle-styles.js';
2
+ import '../../src/vaadin-lit-drawer-toggle.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-drawer-toggle-styles.js';
2
+ import '../../src/vaadin-lit-drawer-toggle.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-app-layout.js';
@@ -0,0 +1,2 @@
1
+ import './theme/lumo/vaadin-lit-app-layout.js';
2
+ export * from './src/vaadin-lit-app-layout.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-drawer-toggle.js';
@@ -0,0 +1,2 @@
1
+ import './theme/lumo/vaadin-lit-drawer-toggle.js';
2
+ export * from './src/vaadin-lit-drawer-toggle.js';
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": "24.6.5",
4
+ "version": "24.7.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -53,7 +53,7 @@
53
53
  "properties": [
54
54
  {
55
55
  "name": "i18n",
56
- "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object as follows:\n```js\nappLayout.i18n = {\n ...appLayout.i18n,\n drawer: 'Drawer'\n}\n```\n\nThe object has the following structure and default values:\n```\n{\n drawer: 'Drawer'\n}\n```",
56
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n drawer: 'Drawer'\n}\n```",
57
57
  "value": {
58
58
  "type": [
59
59
  "AppLayoutI18n"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "24.6.5",
4
+ "version": "24.7.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "name": ".i18n",
31
- "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object as follows:\n```js\nappLayout.i18n = {\n ...appLayout.i18n,\n drawer: 'Drawer'\n}\n```\n\nThe object has the following structure and default values:\n```\n{\n drawer: 'Drawer'\n}\n```",
31
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n drawer: 'Drawer'\n}\n```",
32
32
  "value": {
33
33
  "kind": "expression"
34
34
  }