@vaadin/app-layout 22.0.0-beta1 → 22.0.1
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/README.md +29 -28
- package/package.json +9 -9
- package/src/detect-ios-navbar.js +8 -1
- package/src/safe-area-inset.js +4 -13
- package/src/vaadin-app-layout.d.ts +0 -1
- package/src/vaadin-app-layout.js +6 -8
- package/theme/lumo/vaadin-app-layout-styles.js +1 -1
- package/theme/lumo/vaadin-drawer-toggle-styles.js +2 -2
- package/theme/material/vaadin-app-layout-styles.js +1 -1
- package/theme/material/vaadin-drawer-toggle-styles.js +2 -2
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaadin/app-layout
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
|
5
|
-
[API documentation ↗](https://vaadin.com/components/vaadin-app-layout/html-api)
|
|
3
|
+
A web component for building common application layouts.
|
|
6
4
|
|
|
7
|
-
[
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/app-layout)
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/@vaadin/app-layout)
|
|
10
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-app-layout)
|
|
11
8
|
[](https://discord.gg/PHmkCKC)
|
|
12
9
|
|
|
13
10
|
```html
|
|
@@ -32,47 +29,50 @@
|
|
|
32
29
|
</vaadin-app-layout>
|
|
33
30
|
```
|
|
34
31
|
|
|
35
|
-
[<img src="https://raw.githubusercontent.com/vaadin/
|
|
32
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/app-layout/screenshot.png" width="900" alt="Screenshot of vaadin-app-layout">](https://vaadin.com/docs/latest/ds/components/app-layout)
|
|
36
33
|
|
|
37
|
-
[<img src="https://raw.githubusercontent.com/vaadin/
|
|
34
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/app-layout/screenshot-mobile.png" width="350" alt="Screenshot of vaadin-app-layout on mobile">](https://vaadin.com/docs/latest/ds/components/app-layout)
|
|
38
35
|
|
|
39
36
|
## Installation
|
|
40
37
|
|
|
41
|
-
Install
|
|
38
|
+
Install the component:
|
|
42
39
|
|
|
43
40
|
```sh
|
|
44
|
-
npm i @vaadin/app-layout
|
|
41
|
+
npm i @vaadin/app-layout
|
|
45
42
|
```
|
|
46
43
|
|
|
47
|
-
Once installed, import
|
|
44
|
+
Once installed, import the components in your application:
|
|
48
45
|
|
|
49
46
|
```js
|
|
50
|
-
import '@vaadin/app-layout
|
|
47
|
+
import '@vaadin/app-layout';
|
|
51
48
|
import '@vaadin/app-layout/vaadin-drawer-toggle.js';
|
|
52
49
|
```
|
|
53
50
|
|
|
54
|
-
##
|
|
51
|
+
## Themes
|
|
55
52
|
|
|
56
|
-
Vaadin components
|
|
53
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
54
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/app-layout/vaadin-app-layout.js) of the package uses the Lumo theme.
|
|
57
55
|
|
|
58
|
-
To use the Material theme, import the
|
|
56
|
+
To use the Material theme, import the components from the `theme/material` folder:
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
`theme/lumo/vaadin-app-layout.js`
|
|
65
|
-
`theme/lumo/vaadin-drawer-toggle.js`
|
|
58
|
+
```js
|
|
59
|
+
import '@vaadin/app-layout/theme/material/vaadin-app-layout.js';
|
|
60
|
+
import '@vaadin/app-layout/theme/material/vaadin-drawer-toggle.js';
|
|
61
|
+
```
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
You can also import the Lumo version of the components explicitly:
|
|
68
64
|
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
```js
|
|
66
|
+
import '@vaadin/app-layout/theme/lumo/vaadin-app-layout.js';
|
|
67
|
+
import '@vaadin/app-layout/theme/lumo/vaadin-drawer-toggle.js';
|
|
68
|
+
```
|
|
71
69
|
|
|
72
|
-
-
|
|
70
|
+
Finally, you can import the un-themed components from the `src` folder to get a minimal starting point:
|
|
73
71
|
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
```js
|
|
73
|
+
import '@vaadin/app-layout/src/vaadin-app-layout.js';
|
|
74
|
+
import '@vaadin/app-layout/src/vaadin-drawer-toggle.js';
|
|
75
|
+
```
|
|
76
76
|
|
|
77
77
|
## Contributing
|
|
78
78
|
|
|
@@ -82,4 +82,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
|
|
|
82
82
|
|
|
83
83
|
Apache License 2.0
|
|
84
84
|
|
|
85
|
-
Vaadin collects development time
|
|
85
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
86
|
+
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/app-layout",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@polymer/iron-resizable-behavior": "^3.0.0",
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/button": "22.0.
|
|
38
|
-
"@vaadin/component-base": "22.0.
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "22.0.
|
|
40
|
-
"@vaadin/vaadin-material-styles": "22.0.
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "22.0.
|
|
37
|
+
"@vaadin/button": "^22.0.1",
|
|
38
|
+
"@vaadin/component-base": "^22.0.1",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.1",
|
|
40
|
+
"@vaadin/vaadin-material-styles": "^22.0.1",
|
|
41
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@esm-bundle/chai": "^4.3.4",
|
|
45
|
-
"@vaadin/tabs": "22.0.
|
|
46
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
45
|
+
"@vaadin/tabs": "^22.0.1",
|
|
46
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
47
47
|
"sinon": "^9.2.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
|
|
50
50
|
}
|
package/src/detect-ios-navbar.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
|
|
7
|
+
|
|
1
8
|
export const _detectIosNavbar = function () {
|
|
2
9
|
/* c8 ignore next 11 */
|
|
3
|
-
if (
|
|
10
|
+
if (isIOS) {
|
|
4
11
|
const innerHeight = window.innerHeight;
|
|
5
12
|
const innerWidth = window.innerWidth;
|
|
6
13
|
const landscape = innerWidth > innerHeight;
|
package/src/safe-area-inset.js
CHANGED
|
@@ -4,19 +4,10 @@ $_documentContainer.innerHTML = `
|
|
|
4
4
|
<style>
|
|
5
5
|
/* Use units so that the values can be used in calc() */
|
|
6
6
|
html {
|
|
7
|
-
--safe-area-inset-top:
|
|
8
|
-
--safe-area-inset-right:
|
|
9
|
-
--safe-area-inset-bottom:
|
|
10
|
-
--safe-area-inset-left:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@supports (padding-left: env(safe-area-inset-left)) {
|
|
14
|
-
html {
|
|
15
|
-
--safe-area-inset-top: env(safe-area-inset-top, 0px);
|
|
16
|
-
--safe-area-inset-right: env(safe-area-inset-right, 0px);
|
|
17
|
-
--safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
|
|
18
|
-
--safe-area-inset-left: env(safe-area-inset-left, 0px);
|
|
19
|
-
}
|
|
7
|
+
--safe-area-inset-top: env(safe-area-inset-top, 0px);
|
|
8
|
+
--safe-area-inset-right: env(safe-area-inset-right, 0px);
|
|
9
|
+
--safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
|
|
10
|
+
--safe-area-inset-left: env(safe-area-inset-left, 0px);
|
|
20
11
|
}
|
|
21
12
|
</style>
|
|
22
13
|
`;
|
|
@@ -72,7 +72,6 @@ export type AppLayoutEventMap = HTMLElementEventMap & AppLayoutCustomEventMap;
|
|
|
72
72
|
* --------------|---------------------------------------------------------|
|
|
73
73
|
* `navbar` | Container for the navigation bar
|
|
74
74
|
* `drawer` | Container for the drawer area
|
|
75
|
-
* `content` | Container for page content.
|
|
76
75
|
*
|
|
77
76
|
* See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
|
|
78
77
|
*
|
package/src/vaadin-app-layout.js
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
9
|
-
import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
|
|
6
|
+
import './safe-area-inset.js';
|
|
7
|
+
import './detect-ios-navbar.js';
|
|
10
8
|
import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
|
|
9
|
+
import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
|
|
10
|
+
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
11
|
+
import { afterNextRender, beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
12
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
11
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import './safe-area-inset.js';
|
|
14
|
-
import './detect-ios-navbar.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.
|
|
@@ -54,7 +54,6 @@ import './detect-ios-navbar.js';
|
|
|
54
54
|
* --------------|---------------------------------------------------------|
|
|
55
55
|
* `navbar` | Container for the navigation bar
|
|
56
56
|
* `drawer` | Container for the drawer area
|
|
57
|
-
* `content` | Container for page content.
|
|
58
57
|
*
|
|
59
58
|
* See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
|
|
60
59
|
*
|
|
@@ -148,7 +147,6 @@ class AppLayout extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizable
|
|
|
148
147
|
|
|
149
148
|
:host(:not([no-scroll])) [content] {
|
|
150
149
|
overflow: auto;
|
|
151
|
-
-webkit-overflow-scrolling: touch;
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
[content] {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
2
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
4
3
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
4
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
5
|
|
|
6
6
|
registerStyles(
|
|
7
7
|
'vaadin-app-layout',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
|
-
import { button } from '@vaadin/button/theme/lumo/vaadin-button-styles.js';
|
|
3
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
4
|
|
|
5
5
|
const drawerToggle = css`
|
|
6
6
|
:host {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
3
2
|
import '@vaadin/vaadin-material-styles/shadow.js';
|
|
4
3
|
import '@vaadin/vaadin-material-styles/typography.js';
|
|
4
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
5
|
|
|
6
6
|
registerStyles(
|
|
7
7
|
'vaadin-app-layout',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
|
-
import { button } from '@vaadin/button/theme/material/vaadin-button-styles.js';
|
|
3
1
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
+
import { button } from '@vaadin/button/theme/material/vaadin-button-styles.js';
|
|
3
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
4
|
|
|
5
5
|
const drawerToggle = css`
|
|
6
6
|
:host {
|