@vaadin/app-layout 23.3.0-alpha1 → 23.3.0-alpha2

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": "23.3.0-alpha1",
3
+ "version": "23.3.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,15 +36,15 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/button": "23.3.0-alpha1",
40
- "@vaadin/component-base": "23.3.0-alpha1",
41
- "@vaadin/vaadin-lumo-styles": "23.3.0-alpha1",
42
- "@vaadin/vaadin-material-styles": "23.3.0-alpha1",
43
- "@vaadin/vaadin-themable-mixin": "23.3.0-alpha1"
39
+ "@vaadin/button": "23.3.0-alpha2",
40
+ "@vaadin/component-base": "23.3.0-alpha2",
41
+ "@vaadin/vaadin-lumo-styles": "23.3.0-alpha2",
42
+ "@vaadin/vaadin-material-styles": "23.3.0-alpha2",
43
+ "@vaadin/vaadin-themable-mixin": "23.3.0-alpha2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/tabs": "23.3.0-alpha1",
47
+ "@vaadin/tabs": "23.3.0-alpha2",
48
48
  "@vaadin/testing-helpers": "^0.3.2",
49
49
  "sinon": "^13.0.2"
50
50
  },
@@ -52,5 +52,5 @@
52
52
  "web-types.json",
53
53
  "web-types.lit.json"
54
54
  ],
55
- "gitHead": "beabc527d4b1274eb798ff701d406fed45cfe638"
55
+ "gitHead": "ae61027c62ffa7f7d70cfc50e43f333addfc74b6"
56
56
  }
@@ -3,8 +3,10 @@
3
3
  * Copyright (c) 2018 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
6
7
  import { html } from '@polymer/polymer/lib/utils/html-tag.js';
7
8
  import { Button } from '@vaadin/button/src/vaadin-button.js';
9
+ import { isEmptyTextNode } from '@vaadin/component-base/src/dom-utils.js';
8
10
 
9
11
  /**
10
12
  * The Drawer Toggle component controls the drawer in App Layout component.
@@ -56,9 +58,10 @@ class DrawerToggle extends Button {
56
58
  top: 12px;
57
59
  }
58
60
  </style>
59
- <slot>
61
+ <slot id="slot">
60
62
  <div part="icon"></div>
61
63
  </slot>
64
+ <div part="icon" hidden$="[[!_showFallbackIcon]]"></div>
62
65
  <slot name="tooltip"></slot>
63
66
  `;
64
67
  }
@@ -74,6 +77,12 @@ class DrawerToggle extends Button {
74
77
  value: 'Toggle navigation panel',
75
78
  reflectToAttribute: true,
76
79
  },
80
+
81
+ /** @private */
82
+ _showFallbackIcon: {
83
+ type: Boolean,
84
+ value: false,
85
+ },
77
86
  };
78
87
  }
79
88
 
@@ -84,6 +93,23 @@ class DrawerToggle extends Button {
84
93
  this.dispatchEvent(new CustomEvent('drawer-toggle-click', { bubbles: true, composed: true }));
85
94
  });
86
95
  }
96
+
97
+ /** @protected */
98
+ ready() {
99
+ super.ready();
100
+
101
+ this._observer = new FlattenedNodesObserver(this, () => {
102
+ this._toggleFallbackIcon();
103
+ });
104
+ }
105
+
106
+ /** @private */
107
+ _toggleFallbackIcon() {
108
+ const nodes = this.$.slot.assignedNodes();
109
+
110
+ // Show fallback icon if there are 1-2 empty text nodes assigned to the default slot.
111
+ this._showFallbackIcon = nodes.length > 0 && nodes.every((node) => isEmptyTextNode(node));
112
+ }
87
113
  }
88
114
 
89
115
  customElements.define(DrawerToggle.is, DrawerToggle);
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": "23.3.0-alpha1",
4
+ "version": "23.3.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -104,14 +104,6 @@
104
104
  {
105
105
  "name": "overlay-changed",
106
106
  "description": "Fired when the `overlay` property changes."
107
- },
108
- {
109
- "name": "primarySection-changed",
110
- "description": "Fired when the `primarySection` property changes."
111
- },
112
- {
113
- "name": "drawerOpened-changed",
114
- "description": "Fired when the `drawerOpened` property changes."
115
107
  }
116
108
  ]
117
109
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "23.3.0-alpha1",
4
+ "version": "23.3.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -74,20 +74,6 @@
74
74
  "value": {
75
75
  "kind": "expression"
76
76
  }
77
- },
78
- {
79
- "name": "@primarySection-changed",
80
- "description": "Fired when the `primarySection` property changes.",
81
- "value": {
82
- "kind": "expression"
83
- }
84
- },
85
- {
86
- "name": "@drawerOpened-changed",
87
- "description": "Fired when the `drawerOpened` property changes.",
88
- "value": {
89
- "kind": "expression"
90
- }
91
77
  }
92
78
  ]
93
79
  },