@vaadin/input-container 22.0.0-alpha9 → 22.0.0
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
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaadin/input-container
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A web component used internally by Vaadin field components.
|
|
4
|
+
|
|
5
|
+
## Contributing
|
|
6
|
+
|
|
7
|
+
Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
|
4
8
|
|
|
5
9
|
## License
|
|
6
10
|
|
|
7
11
|
Apache License 2.0
|
|
12
|
+
|
|
13
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
14
|
+
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/input-container",
|
|
3
|
-
"version": "22.0.0
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@polymer/polymer": "^3.0.0",
|
|
34
|
-
"@vaadin/component-base": "22.0.0
|
|
35
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0
|
|
36
|
-
"@vaadin/vaadin-material-styles": "22.0.0
|
|
37
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0
|
|
34
|
+
"@vaadin/component-base": "^22.0.0",
|
|
35
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.0",
|
|
36
|
+
"@vaadin/vaadin-material-styles": "^22.0.0",
|
|
37
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@esm-bundle/chai": "^4.3.4",
|
|
41
|
-
"@vaadin/icon": "22.0.0
|
|
42
|
-
"@vaadin/icons": "22.0.0
|
|
43
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
41
|
+
"@vaadin/icon": "^22.0.0",
|
|
42
|
+
"@vaadin/icons": "^22.0.0",
|
|
43
|
+
"@vaadin/testing-helpers": "^0.3.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
|
|
46
46
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
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 {
|
|
6
|
+
import { html, PolymerElement } from '@polymer/polymer';
|
|
7
7
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
8
|
+
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
-
import { css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
10
10
|
|
|
11
11
|
export class InputContainer extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
12
12
|
static get is() {
|
|
@@ -36,18 +36,12 @@ export class InputContainer extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
36
36
|
width: 100%;
|
|
37
37
|
height: 100%;
|
|
38
38
|
outline: none;
|
|
39
|
-
flex: auto;
|
|
40
|
-
white-space: nowrap;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
39
|
margin: 0;
|
|
45
40
|
padding: 0;
|
|
46
41
|
border: 0;
|
|
47
42
|
border-radius: 0;
|
|
48
43
|
min-width: 0;
|
|
49
44
|
font: inherit;
|
|
50
|
-
font-size: 1em;
|
|
51
45
|
line-height: normal;
|
|
52
46
|
color: inherit;
|
|
53
47
|
background-color: transparent;
|
|
@@ -102,6 +96,29 @@ export class InputContainer extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
102
96
|
}
|
|
103
97
|
};
|
|
104
98
|
}
|
|
99
|
+
|
|
100
|
+
/** @protected */
|
|
101
|
+
ready() {
|
|
102
|
+
super.ready();
|
|
103
|
+
|
|
104
|
+
this.addEventListener('pointerdown', (event) => {
|
|
105
|
+
if (event.target === this) {
|
|
106
|
+
// Prevent direct clicks to the input container from blurring the input
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
this.addEventListener('click', (event) => {
|
|
112
|
+
if (event.target === this) {
|
|
113
|
+
// The vaadin-input-container element was directly clicked,
|
|
114
|
+
// focus any focusable child element from the default slot
|
|
115
|
+
this.shadowRoot
|
|
116
|
+
.querySelector('slot:not([name])')
|
|
117
|
+
.assignedNodes({ flatten: true })
|
|
118
|
+
.forEach((node) => node.focus && node.focus());
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
105
122
|
}
|
|
106
123
|
|
|
107
124
|
customElements.define(InputContainer.is, InputContainer);
|
|
@@ -1,8 +1,8 @@
|
|
|
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/sizing.js';
|
|
4
3
|
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
5
4
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
5
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
6
6
|
|
|
7
7
|
registerStyles(
|
|
8
8
|
'vaadin-input-container',
|
|
@@ -11,9 +11,6 @@ registerStyles(
|
|
|
11
11
|
border-radius: var(--lumo-border-radius-m);
|
|
12
12
|
background-color: var(--lumo-contrast-10pct);
|
|
13
13
|
padding: 0 calc(0.375em + var(--lumo-border-radius-m) / 4 - 1px);
|
|
14
|
-
color: var(--lumo-body-text-color);
|
|
15
|
-
font-size: var(--lumo-font-size-m);
|
|
16
|
-
font-family: var(--lumo-font-family);
|
|
17
14
|
font-weight: 500;
|
|
18
15
|
line-height: 1;
|
|
19
16
|
position: relative;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
3
3
|
|
|
4
4
|
registerStyles(
|
|
5
5
|
'vaadin-input-container',
|