@vaadin/app-layout 25.0.0-alpha1 → 25.0.0-alpha11
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 +10 -11
- package/src/safe-area-inset.js +6 -0
- package/src/{vaadin-app-layout-styles.js → styles/vaadin-app-layout-base-styles.js} +44 -18
- package/src/styles/vaadin-drawer-toggle-base-styles.js +27 -0
- package/src/vaadin-app-layout-mixin.js +29 -6
- package/src/vaadin-app-layout.d.ts +1 -1
- package/src/vaadin-app-layout.js +4 -3
- package/src/vaadin-drawer-toggle.d.ts +1 -1
- package/src/vaadin-drawer-toggle.js +5 -4
- package/vaadin-app-layout.js +1 -1
- package/vaadin-drawer-toggle.js +1 -1
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
- package/src/vaadin-drawer-toggle-styles.js +0 -43
- package/theme/lumo/vaadin-app-layout-styles.d.ts +0 -3
- package/theme/lumo/vaadin-app-layout-styles.js +0 -56
- package/theme/lumo/vaadin-app-layout.d.ts +0 -2
- package/theme/lumo/vaadin-app-layout.js +0 -2
- package/theme/lumo/vaadin-drawer-toggle-styles.d.ts +0 -1
- package/theme/lumo/vaadin-drawer-toggle-styles.js +0 -36
- package/theme/lumo/vaadin-drawer-toggle.d.ts +0 -2
- package/theme/lumo/vaadin-drawer-toggle.js +0 -2
- /package/src/{vaadin-app-layout-styles.d.ts → styles/vaadin-app-layout-base-styles.d.ts} +0 -0
- /package/src/{vaadin-drawer-toggle-styles.d.ts → styles/vaadin-drawer-toggle-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/app-layout",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"theme",
|
|
25
24
|
"vaadin-*.d.ts",
|
|
26
25
|
"vaadin-*.js",
|
|
27
26
|
"web-types.json",
|
|
@@ -35,22 +34,22 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/button": "25.0.0-
|
|
40
|
-
"@vaadin/component-base": "25.0.0-
|
|
41
|
-
"@vaadin/vaadin-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha11",
|
|
38
|
+
"@vaadin/button": "25.0.0-alpha11",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-alpha11",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha11",
|
|
43
41
|
"lit": "^3.0.0"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
47
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
48
|
-
"@vaadin/testing-helpers": "^
|
|
44
|
+
"@vaadin/chai-plugins": "25.0.0-alpha11",
|
|
45
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha11",
|
|
46
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha11",
|
|
49
48
|
"sinon": "^18.0.0"
|
|
50
49
|
},
|
|
51
50
|
"web-types": [
|
|
52
51
|
"web-types.json",
|
|
53
52
|
"web-types.lit.json"
|
|
54
53
|
],
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "abfd315ba5a7484a613e0768635a4e8fe945a44b"
|
|
56
55
|
}
|
package/src/safe-area-inset.js
CHANGED
|
@@ -3,16 +3,17 @@
|
|
|
3
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
|
-
import
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
7
8
|
|
|
8
9
|
export const appLayoutStyles = css`
|
|
9
10
|
:host {
|
|
10
11
|
display: block;
|
|
11
12
|
box-sizing: border-box;
|
|
12
13
|
height: 100%;
|
|
13
|
-
--vaadin-app-layout-transition:
|
|
14
|
-
transition: padding var(--vaadin-app-layout-transition);
|
|
15
|
-
--_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width,
|
|
14
|
+
--vaadin-app-layout-transition-duration: 0s;
|
|
15
|
+
transition: padding var(--vaadin-app-layout-transition-duration);
|
|
16
|
+
--_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, auto);
|
|
16
17
|
--vaadin-app-layout-touch-optimized: false;
|
|
17
18
|
--vaadin-app-layout-navbar-offset-top: var(--_vaadin-app-layout-navbar-offset-size);
|
|
18
19
|
--vaadin-app-layout-navbar-offset-bottom: var(--_vaadin-app-layout-navbar-offset-size-bottom);
|
|
@@ -25,8 +26,10 @@ export const appLayoutStyles = css`
|
|
|
25
26
|
display: none !important;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
:
|
|
29
|
-
|
|
29
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
30
|
+
:host(:not([no-anim])) {
|
|
31
|
+
--vaadin-app-layout-transition-duration: 200ms;
|
|
32
|
+
}
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
:host([drawer-opened]) {
|
|
@@ -58,11 +61,21 @@ export const appLayoutStyles = css`
|
|
|
58
61
|
align-items: center;
|
|
59
62
|
top: 0;
|
|
60
63
|
inset-inline: 0;
|
|
61
|
-
transition: inset-inline-start var(--vaadin-app-layout-transition);
|
|
62
|
-
padding-top: var(--safe-area-inset-top);
|
|
63
|
-
padding-
|
|
64
|
-
padding-
|
|
64
|
+
transition: inset-inline-start var(--vaadin-app-layout-transition-duration);
|
|
65
|
+
padding-top: max(var(--vaadin-app-layout-navbar-padding-top, var(--vaadin-padding)), var(--safe-area-inset-top));
|
|
66
|
+
padding-bottom: var(--vaadin-app-layout-navbar-padding-bottom, var(--vaadin-padding));
|
|
67
|
+
padding-inline-start: max(
|
|
68
|
+
var(--vaadin-app-layout-navbar-padding-inline-start, var(--vaadin-padding)),
|
|
69
|
+
var(--safe-area-inset-left)
|
|
70
|
+
);
|
|
71
|
+
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
|
|
72
|
+
padding-inline-end: max(
|
|
73
|
+
var(--vaadin-app-layout-navbar-padding-inline-end, var(--vaadin-padding)),
|
|
74
|
+
var(--safe-area-inset-right)
|
|
75
|
+
);
|
|
65
76
|
z-index: 1;
|
|
77
|
+
gap: var(--vaadin-app-layout-navbar-gap, var(--vaadin-gap-container-inline));
|
|
78
|
+
background: var(--vaadin-app-layout-navbar-background, var(--vaadin-background-container));
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
:host([primary-section='drawer'][drawer-opened]:not([overlay])) [part='navbar'] {
|
|
@@ -76,18 +89,23 @@ export const appLayoutStyles = css`
|
|
|
76
89
|
[part='navbar'][bottom] {
|
|
77
90
|
top: auto;
|
|
78
91
|
bottom: 0;
|
|
79
|
-
padding-
|
|
92
|
+
padding-top: var(--vaadin-app-layout-navbar-padding-top, var(--vaadin-padding));
|
|
93
|
+
padding-bottom: max(
|
|
94
|
+
var(--vaadin-app-layout-navbar-padding-bottom, var(--vaadin-padding)),
|
|
95
|
+
var(--safe-area-inset-bottom)
|
|
96
|
+
);
|
|
80
97
|
}
|
|
81
98
|
|
|
82
99
|
[part='drawer'] {
|
|
83
100
|
overflow: auto;
|
|
101
|
+
overscroll-behavior: contain;
|
|
84
102
|
position: fixed;
|
|
85
103
|
top: var(--vaadin-app-layout-navbar-offset-top, 0);
|
|
86
104
|
bottom: var(--vaadin-app-layout-navbar-offset-bottom, var(--vaadin-viewport-offset-bottom, 0));
|
|
87
105
|
inset-inline: var(--vaadin-app-layout-navbar-offset-left, 0) auto;
|
|
88
106
|
transition:
|
|
89
|
-
transform var(--vaadin-app-layout-transition),
|
|
90
|
-
visibility var(--vaadin-app-layout-transition);
|
|
107
|
+
transform var(--vaadin-app-layout-transition-duration),
|
|
108
|
+
visibility var(--vaadin-app-layout-transition-duration);
|
|
91
109
|
transform: translateX(-100%);
|
|
92
110
|
max-width: 90%;
|
|
93
111
|
width: var(--_vaadin-app-layout-drawer-width);
|
|
@@ -98,6 +116,7 @@ export const appLayoutStyles = css`
|
|
|
98
116
|
visibility: hidden;
|
|
99
117
|
display: flex;
|
|
100
118
|
flex-direction: column;
|
|
119
|
+
background: var(--vaadin-app-layout-drawer-background, transparent);
|
|
101
120
|
}
|
|
102
121
|
|
|
103
122
|
:host([drawer-opened]) [part='drawer'] {
|
|
@@ -108,25 +127,26 @@ export const appLayoutStyles = css`
|
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
[part='backdrop'] {
|
|
111
|
-
background
|
|
112
|
-
opacity: 0.3;
|
|
130
|
+
background: var(--vaadin-overlay-backdrop-background, rgba(0, 0, 0, 0.5));
|
|
113
131
|
}
|
|
114
132
|
|
|
115
133
|
:host(:not([drawer-opened])) [part='backdrop'] {
|
|
116
|
-
opacity: 0;
|
|
134
|
+
opacity: 0 !important;
|
|
117
135
|
}
|
|
118
136
|
|
|
119
137
|
:host([overlay]) [part='backdrop'] {
|
|
120
138
|
position: fixed;
|
|
121
139
|
inset: 0;
|
|
122
140
|
pointer-events: none;
|
|
123
|
-
transition: opacity var(--vaadin-app-layout-transition);
|
|
141
|
+
transition: opacity var(--vaadin-app-layout-transition-duration);
|
|
124
142
|
-webkit-tap-highlight-color: transparent;
|
|
125
143
|
}
|
|
126
144
|
|
|
127
145
|
:host([overlay]) [part='drawer'] {
|
|
128
146
|
top: 0;
|
|
129
147
|
bottom: 0;
|
|
148
|
+
box-shadow: var(--vaadin-overlay-box-shadow, 0 8px 24px -4px rgba(0, 0, 0, 0.3));
|
|
149
|
+
background: var(--vaadin-app-layout-drawer-background, var(--vaadin-background-color));
|
|
130
150
|
}
|
|
131
151
|
|
|
132
152
|
:host([overlay]) [part='drawer'],
|
|
@@ -154,7 +174,7 @@ export const appLayoutStyles = css`
|
|
|
154
174
|
@media (max-width: 800px), (max-height: 600px) {
|
|
155
175
|
:host {
|
|
156
176
|
--vaadin-app-layout-drawer-overlay: true;
|
|
157
|
-
--_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width,
|
|
177
|
+
--_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, 320px);
|
|
158
178
|
}
|
|
159
179
|
}
|
|
160
180
|
|
|
@@ -163,4 +183,10 @@ export const appLayoutStyles = css`
|
|
|
163
183
|
flex: 1;
|
|
164
184
|
overscroll-behavior: contain;
|
|
165
185
|
}
|
|
186
|
+
|
|
187
|
+
@media (forced-colors: active) {
|
|
188
|
+
:host([overlay]) [part='drawer'] {
|
|
189
|
+
border: 3px solid;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
166
192
|
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 '@vaadin/component-base/src/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const drawerToggle = css`
|
|
10
|
+
[part='icon'] {
|
|
11
|
+
background: currentColor;
|
|
12
|
+
display: block;
|
|
13
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
14
|
+
mask-image: var(--_vaadin-icon-menu);
|
|
15
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[hidden] {
|
|
19
|
+
display: none !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (forced-colors: active) {
|
|
23
|
+
[part='icon'] {
|
|
24
|
+
background: CanvasText;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
@@ -69,6 +69,7 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
69
69
|
readOnly: true,
|
|
70
70
|
value: false,
|
|
71
71
|
reflectToAttribute: true,
|
|
72
|
+
observer: '__overlayChanged',
|
|
72
73
|
sync: true,
|
|
73
74
|
},
|
|
74
75
|
|
|
@@ -166,6 +167,7 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
166
167
|
});
|
|
167
168
|
this._navbarSizeObserver.observe(this.$.navbarTop);
|
|
168
169
|
this._navbarSizeObserver.observe(this.$.navbarBottom);
|
|
170
|
+
this._navbarSizeObserver.observe(this.$.drawer);
|
|
169
171
|
|
|
170
172
|
window.addEventListener('close-overlay-drawer', this.__closeOverlayDrawerListener);
|
|
171
173
|
window.addEventListener('keydown', this.__onDrawerKeyDown);
|
|
@@ -246,6 +248,22 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
246
248
|
this.__setAriaExpanded();
|
|
247
249
|
}
|
|
248
250
|
|
|
251
|
+
/**
|
|
252
|
+
* A callback for the `overlay` property observer.
|
|
253
|
+
*
|
|
254
|
+
* When layout resizes while in the overlay mode, drawer opened state
|
|
255
|
+
* is not changed, but focus trap needs to be removed.
|
|
256
|
+
*
|
|
257
|
+
* @param {boolean} overlay
|
|
258
|
+
* @param {boolean} oldOverlay
|
|
259
|
+
* @private
|
|
260
|
+
*/
|
|
261
|
+
__overlayChanged(_overlay, oldOverlay) {
|
|
262
|
+
if (oldOverlay) {
|
|
263
|
+
this.__restoreFocus();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
249
267
|
/**
|
|
250
268
|
* A callback for the `i18n` property observer.
|
|
251
269
|
*
|
|
@@ -362,8 +380,8 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
362
380
|
/**
|
|
363
381
|
* Returns a promise that resolves when the drawer opening/closing CSS transition ends.
|
|
364
382
|
*
|
|
365
|
-
* The method relies on the `--vaadin-app-layout-transition` CSS variable to detect whether
|
|
366
|
-
* the drawer has a CSS transition that needs to be awaited. If the CSS variable equals `
|
|
383
|
+
* The method relies on the `--vaadin-app-layout-transition-duration` CSS variable to detect whether
|
|
384
|
+
* the drawer has a CSS transition that needs to be awaited. If the CSS variable equals `0s`,
|
|
367
385
|
* the promise resolves immediately.
|
|
368
386
|
*
|
|
369
387
|
* @return {Promise}
|
|
@@ -371,7 +389,7 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
371
389
|
*/
|
|
372
390
|
__drawerTransitionComplete() {
|
|
373
391
|
return new Promise((resolve) => {
|
|
374
|
-
if (this._getCustomPropertyValue('--vaadin-app-layout-transition') === '
|
|
392
|
+
if (this._getCustomPropertyValue('--vaadin-app-layout-transition-duration') === '0s') {
|
|
375
393
|
resolve();
|
|
376
394
|
return;
|
|
377
395
|
}
|
|
@@ -408,9 +426,7 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
408
426
|
return;
|
|
409
427
|
}
|
|
410
428
|
|
|
411
|
-
this.
|
|
412
|
-
this.__focusTrapController.releaseFocus();
|
|
413
|
-
this.$.drawer.removeAttribute('tabindex');
|
|
429
|
+
this.__restoreFocus();
|
|
414
430
|
|
|
415
431
|
// Move focus to the drawer toggle when closing the drawer.
|
|
416
432
|
const toggle = this.querySelector('vaadin-drawer-toggle');
|
|
@@ -420,6 +436,13 @@ export const AppLayoutMixin = (superclass) =>
|
|
|
420
436
|
}
|
|
421
437
|
}
|
|
422
438
|
|
|
439
|
+
/** @private */
|
|
440
|
+
__restoreFocus() {
|
|
441
|
+
this.__ariaModalController.close();
|
|
442
|
+
this.__focusTrapController.releaseFocus();
|
|
443
|
+
this.$.drawer.removeAttribute('tabindex');
|
|
444
|
+
}
|
|
445
|
+
|
|
423
446
|
/**
|
|
424
447
|
* Closes the drawer on Escape press if it has been opened in the overlay mode.
|
|
425
448
|
*
|
|
@@ -37,7 +37,7 @@ export type AppLayoutEventMap = AppLayoutCustomEventMap & HTMLElementEventMap;
|
|
|
37
37
|
/**
|
|
38
38
|
* `<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.
|
|
39
39
|
*
|
|
40
|
-
* ```
|
|
40
|
+
* ```html
|
|
41
41
|
* <vaadin-app-layout primary-section="navbar|drawer">
|
|
42
42
|
* <vaadin-drawer-toggle slot="navbar [touch-optimized]"></vaadin-drawer-toggle>
|
|
43
43
|
* <h3 slot="navbar [touch-optimized]">Company Name</h3>
|
package/src/vaadin-app-layout.js
CHANGED
|
@@ -9,14 +9,15 @@ import { html, LitElement } from 'lit';
|
|
|
9
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
11
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
+
import { appLayoutStyles } from './styles/vaadin-app-layout-base-styles.js';
|
|
13
15
|
import { AppLayoutMixin } from './vaadin-app-layout-mixin.js';
|
|
14
|
-
import { appLayoutStyles } from './vaadin-app-layout-styles.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* `<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.
|
|
18
19
|
*
|
|
19
|
-
* ```
|
|
20
|
+
* ```html
|
|
20
21
|
* <vaadin-app-layout primary-section="navbar|drawer">
|
|
21
22
|
* <vaadin-drawer-toggle slot="navbar [touch-optimized]"></vaadin-drawer-toggle>
|
|
22
23
|
* <h3 slot="navbar [touch-optimized]">Company Name</h3>
|
|
@@ -107,7 +108,7 @@ import { appLayoutStyles } from './vaadin-app-layout-styles.js';
|
|
|
107
108
|
* @mixes ElementMixin
|
|
108
109
|
* @mixes ThemableMixin
|
|
109
110
|
*/
|
|
110
|
-
class AppLayout extends AppLayoutMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
111
|
+
class AppLayout extends AppLayoutMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
111
112
|
static get is() {
|
|
112
113
|
return 'vaadin-app-layout';
|
|
113
114
|
}
|
|
@@ -10,7 +10,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
10
10
|
/**
|
|
11
11
|
* The Drawer Toggle component controls the drawer in App Layout component.
|
|
12
12
|
*
|
|
13
|
-
* ```
|
|
13
|
+
* ```html
|
|
14
14
|
* <vaadin-app-layout>
|
|
15
15
|
* <vaadin-drawer-toggle slot="navbar">Toggle drawer</vaadin-drawer-toggle>
|
|
16
16
|
* </vaadin-app-layout>
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, LitElement } from 'lit';
|
|
7
|
-
import { buttonStyles } from '@vaadin/button/src/vaadin-button-
|
|
7
|
+
import { buttonStyles } from '@vaadin/button/src/styles/vaadin-button-base-styles.js';
|
|
8
8
|
import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
|
|
9
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
10
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
11
11
|
import { isEmptyTextNode } from '@vaadin/component-base/src/dom-utils.js';
|
|
12
12
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
13
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
13
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
-
import { drawerToggle } from './vaadin-drawer-toggle-styles.js';
|
|
15
|
+
import { drawerToggle } from './styles/vaadin-drawer-toggle-base-styles.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* The Drawer Toggle component controls the drawer in App Layout component.
|
|
18
19
|
*
|
|
19
|
-
* ```
|
|
20
|
+
* ```html
|
|
20
21
|
* <vaadin-app-layout>
|
|
21
22
|
* <vaadin-drawer-toggle slot="navbar">Toggle drawer</vaadin-drawer-toggle>
|
|
22
23
|
* </vaadin-app-layout>
|
|
@@ -28,7 +29,7 @@ import { drawerToggle } from './vaadin-drawer-toggle-styles.js';
|
|
|
28
29
|
* @mixes DirMixin
|
|
29
30
|
* @mixes ThemableMixin
|
|
30
31
|
*/
|
|
31
|
-
class DrawerToggle extends ButtonMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
32
|
+
class DrawerToggle extends ButtonMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
32
33
|
static get is() {
|
|
33
34
|
return 'vaadin-drawer-toggle';
|
|
34
35
|
}
|
package/vaadin-app-layout.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-app-layout.js';
|
|
2
2
|
export * from './src/vaadin-app-layout.js';
|
package/vaadin-drawer-toggle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-drawer-toggle.js';
|
|
2
2
|
export * from './src/vaadin-drawer-toggle.js';
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/app-layout",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-app-layout",
|
|
11
|
-
"description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n
|
|
11
|
+
"description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n```html\n<vaadin-app-layout primary-section=\"navbar|drawer\">\n <vaadin-drawer-toggle slot=\"navbar [touch-optimized]\"></vaadin-drawer-toggle>\n <h3 slot=\"navbar [touch-optimized]\">Company Name</h3>\n <vaadin-tabs orientation=\"vertical\" slot=\"drawer\">\n <vaadin-tab>Menu item 1</vaadin-tab>\n </vaadin-tabs>\n <!-- Everything else will be the page content -->\n <div>\n <h3>Page title</h3>\n <p>Page content</p>\n </div>\n</vaadin-app-layout>\n```\n\nFor best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).\n\nThe page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:\n```\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\nThis causes the viewport to be scaled to fill the device display.\nTo ensure that important content is displayed, use the provided css variables.\n```\n--safe-area-inset-top\n--safe-area-inset-right\n--safe-area-inset-bottom\n--safe-area-inset-left\n```\n\n### Styling\n\nThe following Shadow DOM parts of the `<vaadin-app-layout>` are available for styling:\n\nPart name | Description\n--------------|---------------------------------------------------------|\n`backdrop` | Backdrop covering the layout when drawer is open as an overlay\n`navbar` | Container for the navigation bar\n`drawer` | Container for the drawer area\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Component's slots\n\nThe following slots are available to be set\n\nSlot name | Description\n-------------------|---------------------------------------------------|\nno name | Default container for the page content\n`navbar ` | Container for the top navbar area\n`drawer` | Container for an application menu\n`touch-optimized` | Container for the bottom navbar area (only visible for mobile devices)\n\n#### Touch optimized\n\nApp Layout has a pseudo-slot `touch-optimized` in order to give more control of the presentation of\nelements with `slot[navbar]`. Internally, when the user is interacting with App Layout from a\ntouchscreen device, the component will search for elements with `slot[navbar touch-optimized]` and move\nthem to the bottom of the page.\n\n### Navigation\n\nAs the drawer opens as an overlay in small devices, it makes sense to close it once a navigation happens.\nIf you are using Vaadin Router, this will happen automatically unless you change the `closeDrawerOn` event name.\n\nIn order to do so, there are two options:\n- If the `vaadin-app-layout` instance is available, then `drawerOpened` can be set to `false`\n- If not, a custom event `close-overlay-drawer` can be dispatched either by calling\n `window.dispatchEvent(new CustomEvent('close-overlay-drawer'))` or by calling\n `AppLayout.dispatchCloseOverlayDrawerEvent()`\n\n### Scrolling areas\n\nBy default, the component will act with the \"body scrolling\", so on mobile (iOS Safari and Android Chrome),\nthe toolbars will collapse when a scroll happens.\n\nTo use the \"content scrolling\", in case of the content of the page relies on a pre-defined height (for instance,\nit has a `height:100%`), then the developer can set `height: 100%` to both `html` and `body`.\nThat will make the `[content]` element of app layout scrollable.\nOn this case, the toolbars on mobile device won't collapse.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "i18n",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
"name": "vaadin-drawer-toggle",
|
|
122
|
-
"description": "The Drawer Toggle component controls the drawer in App Layout component.\n\n
|
|
122
|
+
"description": "The Drawer Toggle component controls the drawer in App Layout component.\n\n```html\n<vaadin-app-layout>\n <vaadin-drawer-toggle slot=\"navbar\">Toggle drawer</vaadin-drawer-toggle>\n</vaadin-app-layout>\n```",
|
|
123
123
|
"attributes": [
|
|
124
124
|
{
|
|
125
125
|
"name": "disabled",
|
package/web-types.lit.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.0.0-
|
|
4
|
+
"version": "25.0.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-app-layout",
|
|
19
|
-
"description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n
|
|
19
|
+
"description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n```html\n<vaadin-app-layout primary-section=\"navbar|drawer\">\n <vaadin-drawer-toggle slot=\"navbar [touch-optimized]\"></vaadin-drawer-toggle>\n <h3 slot=\"navbar [touch-optimized]\">Company Name</h3>\n <vaadin-tabs orientation=\"vertical\" slot=\"drawer\">\n <vaadin-tab>Menu item 1</vaadin-tab>\n </vaadin-tabs>\n <!-- Everything else will be the page content -->\n <div>\n <h3>Page title</h3>\n <p>Page content</p>\n </div>\n</vaadin-app-layout>\n```\n\nFor best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).\n\nThe page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:\n```\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\nThis causes the viewport to be scaled to fill the device display.\nTo ensure that important content is displayed, use the provided css variables.\n```\n--safe-area-inset-top\n--safe-area-inset-right\n--safe-area-inset-bottom\n--safe-area-inset-left\n```\n\n### Styling\n\nThe following Shadow DOM parts of the `<vaadin-app-layout>` are available for styling:\n\nPart name | Description\n--------------|---------------------------------------------------------|\n`backdrop` | Backdrop covering the layout when drawer is open as an overlay\n`navbar` | Container for the navigation bar\n`drawer` | Container for the drawer area\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Component's slots\n\nThe following slots are available to be set\n\nSlot name | Description\n-------------------|---------------------------------------------------|\nno name | Default container for the page content\n`navbar ` | Container for the top navbar area\n`drawer` | Container for an application menu\n`touch-optimized` | Container for the bottom navbar area (only visible for mobile devices)\n\n#### Touch optimized\n\nApp Layout has a pseudo-slot `touch-optimized` in order to give more control of the presentation of\nelements with `slot[navbar]`. Internally, when the user is interacting with App Layout from a\ntouchscreen device, the component will search for elements with `slot[navbar touch-optimized]` and move\nthem to the bottom of the page.\n\n### Navigation\n\nAs the drawer opens as an overlay in small devices, it makes sense to close it once a navigation happens.\nIf you are using Vaadin Router, this will happen automatically unless you change the `closeDrawerOn` event name.\n\nIn order to do so, there are two options:\n- If the `vaadin-app-layout` instance is available, then `drawerOpened` can be set to `false`\n- If not, a custom event `close-overlay-drawer` can be dispatched either by calling\n `window.dispatchEvent(new CustomEvent('close-overlay-drawer'))` or by calling\n `AppLayout.dispatchCloseOverlayDrawerEvent()`\n\n### Scrolling areas\n\nBy default, the component will act with the \"body scrolling\", so on mobile (iOS Safari and Android Chrome),\nthe toolbars will collapse when a scroll happens.\n\nTo use the \"content scrolling\", in case of the content of the page relies on a pre-defined height (for instance,\nit has a `height:100%`), then the developer can set `height: 100%` to both `html` and `body`.\nThat will make the `[content]` element of app layout scrollable.\nOn this case, the toolbars on mobile device won't collapse.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "vaadin-drawer-toggle",
|
|
82
|
-
"description": "The Drawer Toggle component controls the drawer in App Layout component.\n\n
|
|
82
|
+
"description": "The Drawer Toggle component controls the drawer in App Layout component.\n\n```html\n<vaadin-app-layout>\n <vaadin-drawer-toggle slot=\"navbar\">Toggle drawer</vaadin-drawer-toggle>\n</vaadin-app-layout>\n```",
|
|
83
83
|
"extension": true,
|
|
84
84
|
"attributes": [
|
|
85
85
|
{
|
|
@@ -1,43 +0,0 @@
|
|
|
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 { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
export const drawerToggle = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
cursor: default;
|
|
14
|
-
position: relative;
|
|
15
|
-
outline: none;
|
|
16
|
-
height: 24px;
|
|
17
|
-
width: 24px;
|
|
18
|
-
padding: 4px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[part='icon'],
|
|
22
|
-
[part='icon']::after,
|
|
23
|
-
[part='icon']::before {
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 8px;
|
|
26
|
-
height: 3px;
|
|
27
|
-
width: 24px;
|
|
28
|
-
background-color: #000;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
[part='icon']::after,
|
|
32
|
-
[part='icon']::before {
|
|
33
|
-
content: '';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part='icon']::after {
|
|
37
|
-
top: 6px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[part='icon']::before {
|
|
41
|
-
top: 12px;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
4
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
|
-
|
|
6
|
-
registerStyles(
|
|
7
|
-
'vaadin-app-layout',
|
|
8
|
-
css`
|
|
9
|
-
[part='navbar'],
|
|
10
|
-
[part='drawer'] {
|
|
11
|
-
background-color: var(--lumo-base-color);
|
|
12
|
-
background-clip: padding-box;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
[part='navbar'] {
|
|
16
|
-
min-height: var(--lumo-size-xl);
|
|
17
|
-
border-bottom: 1px solid var(--lumo-contrast-10pct);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part='navbar'][bottom] {
|
|
21
|
-
border-bottom: none;
|
|
22
|
-
border-top: 1px solid var(--lumo-contrast-10pct);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[part='drawer'] {
|
|
26
|
-
border-inline-end: 1px solid var(--lumo-contrast-10pct);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([overlay]) [part='drawer'] {
|
|
30
|
-
border-inline-end: none;
|
|
31
|
-
box-shadow: var(--lumo-box-shadow-s);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([primary-section='navbar']) [part='navbar'] {
|
|
35
|
-
border: none;
|
|
36
|
-
background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([primary-section='drawer']:not([overlay])) [part='drawer'] {
|
|
40
|
-
background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[part='backdrop'] {
|
|
44
|
-
background-color: var(--lumo-shade-20pct);
|
|
45
|
-
opacity: 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[part] ::slotted(h2),
|
|
49
|
-
[part] ::slotted(h3),
|
|
50
|
-
[part] ::slotted(h4) {
|
|
51
|
-
margin-top: var(--lumo-space-xs) !important;
|
|
52
|
-
margin-bottom: var(--lumo-space-xs) !important;
|
|
53
|
-
}
|
|
54
|
-
`,
|
|
55
|
-
{ moduleId: 'lumo-app-layout' },
|
|
56
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
2
|
-
import { button } from '@vaadin/button/theme/lumo/vaadin-button-styles.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
const drawerToggle = css`
|
|
6
|
-
:host {
|
|
7
|
-
width: var(--lumo-size-l);
|
|
8
|
-
height: var(--lumo-size-l);
|
|
9
|
-
min-width: auto;
|
|
10
|
-
margin: 0 var(--lumo-space-s);
|
|
11
|
-
padding: 0;
|
|
12
|
-
background: transparent;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
[part='icon'],
|
|
16
|
-
[part='icon']::after,
|
|
17
|
-
[part='icon']::before {
|
|
18
|
-
position: inherit;
|
|
19
|
-
height: auto;
|
|
20
|
-
width: auto;
|
|
21
|
-
background: transparent;
|
|
22
|
-
top: auto;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[part='icon']::before {
|
|
26
|
-
font-family: lumo-icons;
|
|
27
|
-
font-size: var(--lumo-icon-size-m);
|
|
28
|
-
content: var(--lumo-icons-menu);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:host([slot~='navbar']) {
|
|
32
|
-
color: var(--lumo-secondary-text-color);
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
registerStyles('vaadin-drawer-toggle', [button, drawerToggle], { moduleId: 'lumo-drawer-toggle' });
|
|
File without changes
|
/package/src/{vaadin-drawer-toggle-styles.d.ts → styles/vaadin-drawer-toggle-base-styles.d.ts}
RENAMED
|
File without changes
|