@vaadin/input-container 25.0.0-alpha2 → 25.0.0-alpha21
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 -12
- package/src/styles/vaadin-input-container-base-styles.d.ts +8 -0
- package/src/styles/vaadin-input-container-base-styles.js +129 -0
- package/src/vaadin-input-container.js +54 -4
- package/vaadin-input-container.js +1 -1
- package/src/vaadin-input-container-core-styles.js +0 -74
- package/src/vaadin-input-container-mixin.js +0 -62
- package/theme/lumo/vaadin-input-container-styles.d.ts +0 -4
- package/theme/lumo/vaadin-input-container-styles.js +0 -189
- package/theme/lumo/vaadin-input-container.d.ts +0 -2
- package/theme/lumo/vaadin-input-container.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/input-container",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/vaadin-input-container-base-styles.js",
|
|
25
|
-
"theme",
|
|
26
24
|
"vaadin-*.d.ts",
|
|
27
25
|
"vaadin-*.js"
|
|
28
26
|
],
|
|
@@ -32,18 +30,18 @@
|
|
|
32
30
|
"web-component"
|
|
33
31
|
],
|
|
34
32
|
"dependencies": {
|
|
35
|
-
"@vaadin/component-base": "25.0.0-
|
|
36
|
-
"@vaadin/vaadin-
|
|
37
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
33
|
+
"@vaadin/component-base": "25.0.0-alpha21",
|
|
34
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha21",
|
|
38
35
|
"lit": "^3.0.0"
|
|
39
36
|
},
|
|
40
37
|
"devDependencies": {
|
|
41
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
42
|
-
"@vaadin/icon": "25.0.0-
|
|
43
|
-
"@vaadin/icons": "25.0.0-
|
|
44
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
38
|
+
"@vaadin/chai-plugins": "25.0.0-alpha21",
|
|
39
|
+
"@vaadin/icon": "25.0.0-alpha21",
|
|
40
|
+
"@vaadin/icons": "25.0.0-alpha21",
|
|
41
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha21",
|
|
45
42
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
46
|
-
"
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha21",
|
|
44
|
+
"sinon": "^21.0.0"
|
|
47
45
|
},
|
|
48
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "8fb9e9710c01449edf623a1aaac4655cdc11a933"
|
|
49
47
|
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 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 inputContainerStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
--_radius: var(--vaadin-input-field-border-radius, var(--vaadin-radius-m));
|
|
14
|
+
border-radius:
|
|
15
|
+
/* See https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius */
|
|
16
|
+
var(--vaadin-input-field-top-start-radius, var(--_radius))
|
|
17
|
+
var(--vaadin-input-field-top-end-radius, var(--_radius))
|
|
18
|
+
var(--vaadin-input-field-bottom-end-radius, var(--_radius))
|
|
19
|
+
var(--vaadin-input-field-bottom-start-radius, var(--_radius));
|
|
20
|
+
border: var(--vaadin-input-field-border-width, 1px) solid
|
|
21
|
+
var(--vaadin-input-field-border-color, var(--vaadin-border-color));
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
cursor: text;
|
|
24
|
+
padding: var(--vaadin-input-field-padding, var(--vaadin-padding-container));
|
|
25
|
+
gap: var(--vaadin-input-field-gap, var(--vaadin-gap-s));
|
|
26
|
+
background: var(--vaadin-input-field-background, var(--vaadin-background-color));
|
|
27
|
+
color: var(--vaadin-input-field-value-color, var(--vaadin-text-color));
|
|
28
|
+
font-size: var(--vaadin-input-field-value-font-size, inherit);
|
|
29
|
+
line-height: var(--vaadin-input-field-value-line-height, inherit);
|
|
30
|
+
font-weight: var(--vaadin-input-field-value-font-weight, 400);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([dir='rtl']) {
|
|
34
|
+
--_radius: var(--vaadin-input-field-border-radius, var(--vaadin-radius-m));
|
|
35
|
+
border-radius:
|
|
36
|
+
/* Don't use logical props, see https://github.com/vaadin/vaadin-time-picker/issues/145 */
|
|
37
|
+
var(--vaadin-input-field-top-end-radius, var(--_radius))
|
|
38
|
+
var(--vaadin-input-field-top-start-radius, var(--_radius))
|
|
39
|
+
var(--vaadin-input-field-bottom-start-radius, var(--_radius))
|
|
40
|
+
var(--vaadin-input-field-bottom-end-radius, var(--_radius));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([hidden]) {
|
|
44
|
+
display: none !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Reset the native input styles */
|
|
48
|
+
::slotted(:is(input, textarea)) {
|
|
49
|
+
appearance: none;
|
|
50
|
+
align-self: stretch;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
flex: auto;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: auto;
|
|
57
|
+
outline: none;
|
|
58
|
+
margin: 0;
|
|
59
|
+
padding: 0;
|
|
60
|
+
border: 0;
|
|
61
|
+
border-radius: 0;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
font: inherit;
|
|
64
|
+
font-size: 1em;
|
|
65
|
+
color: inherit;
|
|
66
|
+
background: transparent;
|
|
67
|
+
cursor: inherit;
|
|
68
|
+
caret-color: var(--vaadin-input-field-value-color);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
::slotted(*) {
|
|
72
|
+
flex: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
slot[name$='fix'] {
|
|
76
|
+
cursor: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
::slotted(:is(input, textarea))::placeholder {
|
|
80
|
+
/* Use ::slotted(:is(input, textarea):placeholder-shown) to style the placeholder */
|
|
81
|
+
/* because ::slotted(...)::placeholder does not work in Safari. */
|
|
82
|
+
font: inherit;
|
|
83
|
+
color: inherit;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
::slotted(:is(input, textarea):placeholder-shown) {
|
|
87
|
+
color: var(--vaadin-input-field-placeholder-color, var(--vaadin-text-color-secondary));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host(:focus-within) {
|
|
91
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
92
|
+
outline-offset: calc(var(--vaadin-input-field-border-width, 1px) * -1);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([invalid]) {
|
|
96
|
+
--vaadin-input-field-border-color: var(--vaadin-input-field-error-color, var(--vaadin-text-color));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([readonly]) {
|
|
100
|
+
border-style: dashed;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([readonly]:focus-within) {
|
|
104
|
+
outline-style: dashed;
|
|
105
|
+
--vaadin-input-field-border-color: transparent;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([disabled]) {
|
|
109
|
+
--vaadin-input-field-value-color: var(--vaadin-input-field-disabled-text-color, var(--vaadin-text-color-disabled));
|
|
110
|
+
--vaadin-input-field-background: var(
|
|
111
|
+
--vaadin-input-field-disabled-background,
|
|
112
|
+
var(--vaadin-background-container-strong)
|
|
113
|
+
);
|
|
114
|
+
--vaadin-input-field-border-color: transparent;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media (forced-colors: active) {
|
|
118
|
+
:host {
|
|
119
|
+
--vaadin-input-field-background: Field;
|
|
120
|
+
--vaadin-input-field-value-color: FieldText;
|
|
121
|
+
--vaadin-input-field-placeholder-color: GrayText;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([disabled]) {
|
|
125
|
+
--vaadin-input-field-value-color: GrayText;
|
|
126
|
+
--vaadin-icon-color: GrayText;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`;
|
|
@@ -7,18 +7,17 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
10
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
import { inputContainerStyles } from './vaadin-input-container-
|
|
12
|
-
import { InputContainerMixin } from './vaadin-input-container-mixin.js';
|
|
12
|
+
import { inputContainerStyles } from './styles/vaadin-input-container-base-styles.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @customElement
|
|
16
16
|
* @extends HTMLElement
|
|
17
17
|
* @mixes ThemableMixin
|
|
18
18
|
* @mixes DirMixin
|
|
19
|
-
* @mixes InputContainerMixin
|
|
20
19
|
*/
|
|
21
|
-
export class InputContainer extends
|
|
20
|
+
export class InputContainer extends ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
|
|
22
21
|
static get is() {
|
|
23
22
|
return 'vaadin-input-container';
|
|
24
23
|
}
|
|
@@ -27,6 +26,34 @@ export class InputContainer extends InputContainerMixin(ThemableMixin(DirMixin(P
|
|
|
27
26
|
return inputContainerStyles;
|
|
28
27
|
}
|
|
29
28
|
|
|
29
|
+
static get properties() {
|
|
30
|
+
return {
|
|
31
|
+
/**
|
|
32
|
+
* If true, the user cannot interact with this element.
|
|
33
|
+
*/
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
reflectToAttribute: true,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Set to true to make this element read-only.
|
|
41
|
+
*/
|
|
42
|
+
readonly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
reflectToAttribute: true,
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Set to true when the element is invalid.
|
|
49
|
+
*/
|
|
50
|
+
invalid: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
reflectToAttribute: true,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
30
57
|
/** @protected */
|
|
31
58
|
render() {
|
|
32
59
|
return html`
|
|
@@ -35,6 +62,29 @@ export class InputContainer extends InputContainerMixin(ThemableMixin(DirMixin(P
|
|
|
35
62
|
<slot name="suffix"></slot>
|
|
36
63
|
`;
|
|
37
64
|
}
|
|
65
|
+
|
|
66
|
+
/** @protected */
|
|
67
|
+
ready() {
|
|
68
|
+
super.ready();
|
|
69
|
+
|
|
70
|
+
this.addEventListener('pointerdown', (event) => {
|
|
71
|
+
if (event.target === this) {
|
|
72
|
+
// Prevent direct clicks to the input container from blurring the input
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
this.addEventListener('click', (event) => {
|
|
78
|
+
if (event.target === this) {
|
|
79
|
+
// The vaadin-input-container element was directly clicked,
|
|
80
|
+
// focus any focusable child element from the default slot
|
|
81
|
+
this.shadowRoot
|
|
82
|
+
.querySelector('slot:not([name])')
|
|
83
|
+
.assignedNodes({ flatten: true })
|
|
84
|
+
.forEach((node) => node.focus && node.focus());
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
38
88
|
}
|
|
39
89
|
|
|
40
90
|
defineCustomElement(InputContainer);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-input-container.js';
|
|
2
2
|
export * from './src/vaadin-input-container.js';
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 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 'lit';
|
|
7
|
-
|
|
8
|
-
export const inputContainerStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
flex: 0 1 auto;
|
|
13
|
-
border-radius:
|
|
14
|
-
/* See https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius */
|
|
15
|
-
var(--vaadin-input-field-top-start-radius, var(--__border-radius))
|
|
16
|
-
var(--vaadin-input-field-top-end-radius, var(--__border-radius))
|
|
17
|
-
var(--vaadin-input-field-bottom-end-radius, var(--__border-radius))
|
|
18
|
-
var(--vaadin-input-field-bottom-start-radius, var(--__border-radius));
|
|
19
|
-
--_border-radius: var(--vaadin-input-field-border-radius, 0);
|
|
20
|
-
--_input-border-width: var(--vaadin-input-field-border-width, 0px);
|
|
21
|
-
--_input-border-color: var(--vaadin-input-field-border-color, transparent);
|
|
22
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
23
|
-
box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
:host([dir='rtl']) {
|
|
27
|
-
border-radius:
|
|
28
|
-
/* Don't use logical props, see https://github.com/vaadin/vaadin-time-picker/issues/145 */
|
|
29
|
-
var(--vaadin-input-field-top-end-radius, var(--_border-radius))
|
|
30
|
-
var(--vaadin-input-field-top-start-radius, var(--_border-radius))
|
|
31
|
-
var(--vaadin-input-field-bottom-start-radius, var(--_border-radius))
|
|
32
|
-
var(--vaadin-input-field-bottom-end-radius, var(--_border-radius));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host([hidden]) {
|
|
36
|
-
display: none !important;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* Reset the native input styles */
|
|
40
|
-
::slotted(input) {
|
|
41
|
-
-webkit-appearance: none;
|
|
42
|
-
-moz-appearance: none;
|
|
43
|
-
flex: auto;
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
width: 100%;
|
|
47
|
-
height: 100%;
|
|
48
|
-
outline: none;
|
|
49
|
-
margin: 0;
|
|
50
|
-
padding: 0;
|
|
51
|
-
border: 0;
|
|
52
|
-
border-radius: 0;
|
|
53
|
-
min-width: 0;
|
|
54
|
-
font: inherit;
|
|
55
|
-
line-height: normal;
|
|
56
|
-
color: inherit;
|
|
57
|
-
background-color: transparent;
|
|
58
|
-
/* Disable default invalid style in Firefox */
|
|
59
|
-
box-shadow: none;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
::slotted(*) {
|
|
63
|
-
flex: none;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
::slotted(:is(input, textarea))::placeholder {
|
|
67
|
-
/* Use ::slotted(input:placeholder-shown) in themes to style the placeholder. */
|
|
68
|
-
/* because ::slotted(...)::placeholder does not work in Safari. */
|
|
69
|
-
font: inherit;
|
|
70
|
-
color: inherit;
|
|
71
|
-
/* Override default opacity in Firefox */
|
|
72
|
-
opacity: 1;
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @polymerMixin
|
|
9
|
-
*/
|
|
10
|
-
export const InputContainerMixin = (superClass) =>
|
|
11
|
-
class InputContainerMixinClass extends superClass {
|
|
12
|
-
static get properties() {
|
|
13
|
-
return {
|
|
14
|
-
/**
|
|
15
|
-
* If true, the user cannot interact with this element.
|
|
16
|
-
*/
|
|
17
|
-
disabled: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
reflectToAttribute: true,
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Set to true to make this element read-only.
|
|
24
|
-
*/
|
|
25
|
-
readonly: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
reflectToAttribute: true,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Set to true when the element is invalid.
|
|
32
|
-
*/
|
|
33
|
-
invalid: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
reflectToAttribute: true,
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** @protected */
|
|
41
|
-
ready() {
|
|
42
|
-
super.ready();
|
|
43
|
-
|
|
44
|
-
this.addEventListener('pointerdown', (event) => {
|
|
45
|
-
if (event.target === this) {
|
|
46
|
-
// Prevent direct clicks to the input container from blurring the input
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
this.addEventListener('click', (event) => {
|
|
52
|
-
if (event.target === this) {
|
|
53
|
-
// The vaadin-input-container element was directly clicked,
|
|
54
|
-
// focus any focusable child element from the default slot
|
|
55
|
-
this.shadowRoot
|
|
56
|
-
.querySelector('slot:not([name])')
|
|
57
|
-
.assignedNodes({ flatten: true })
|
|
58
|
-
.forEach((node) => node.focus && node.focus());
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
};
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
5
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
6
|
-
|
|
7
|
-
registerStyles(
|
|
8
|
-
'vaadin-input-container',
|
|
9
|
-
css`
|
|
10
|
-
:host {
|
|
11
|
-
background: var(--_background);
|
|
12
|
-
padding: 0 calc(0.375em + var(--_input-container-radius) / 4 - 1px);
|
|
13
|
-
font-weight: var(--vaadin-input-field-value-font-weight, 500);
|
|
14
|
-
line-height: 1;
|
|
15
|
-
position: relative;
|
|
16
|
-
cursor: text;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
border-radius:
|
|
19
|
-
/* See https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#syntax */
|
|
20
|
-
var(--vaadin-input-field-top-start-radius, var(--_input-container-radius))
|
|
21
|
-
var(--vaadin-input-field-top-end-radius, var(--_input-container-radius))
|
|
22
|
-
var(--vaadin-input-field-bottom-end-radius, var(--_input-container-radius))
|
|
23
|
-
var(--vaadin-input-field-bottom-start-radius, var(--_input-container-radius));
|
|
24
|
-
/* Fallback */
|
|
25
|
-
--_input-container-radius: var(--vaadin-input-field-border-radius, var(--lumo-border-radius-m));
|
|
26
|
-
--_input-height: var(--lumo-text-field-size, var(--lumo-size-m));
|
|
27
|
-
/* Default values */
|
|
28
|
-
--_background: var(--vaadin-input-field-background, var(--lumo-contrast-10pct));
|
|
29
|
-
--_hover-highlight: var(--vaadin-input-field-hover-highlight, var(--lumo-contrast-50pct));
|
|
30
|
-
--_input-border-color: var(--vaadin-input-field-border-color, var(--lumo-contrast-50pct));
|
|
31
|
-
--_icon-color: var(--vaadin-input-field-icon-color, var(--lumo-contrast-60pct));
|
|
32
|
-
--_icon-size: var(--vaadin-input-field-icon-size, var(--lumo-icon-size-m));
|
|
33
|
-
--_invalid-background: var(--vaadin-input-field-invalid-background, var(--lumo-error-color-10pct));
|
|
34
|
-
--_invalid-hover-highlight: var(--vaadin-input-field-invalid-hover-highlight, var(--lumo-error-color-50pct));
|
|
35
|
-
--_disabled-background: var(--vaadin-input-field-disabled-background, var(--lumo-contrast-5pct));
|
|
36
|
-
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([dir='rtl']) {
|
|
40
|
-
border-radius:
|
|
41
|
-
/* Don't use logical props, see https://github.com/vaadin/vaadin-time-picker/issues/145 */
|
|
42
|
-
var(--vaadin-input-field-top-end-radius, var(--_input-container-radius))
|
|
43
|
-
var(--vaadin-input-field-top-start-radius, var(--_input-container-radius))
|
|
44
|
-
var(--vaadin-input-field-bottom-start-radius, var(--_input-container-radius))
|
|
45
|
-
var(--vaadin-input-field-bottom-end-radius, var(--_input-container-radius));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Used for hover and activation effects */
|
|
49
|
-
:host::after {
|
|
50
|
-
content: '';
|
|
51
|
-
position: absolute;
|
|
52
|
-
inset: 0;
|
|
53
|
-
border-radius: inherit;
|
|
54
|
-
pointer-events: none;
|
|
55
|
-
background: var(--_hover-highlight);
|
|
56
|
-
opacity: 0;
|
|
57
|
-
transition:
|
|
58
|
-
transform 0.15s,
|
|
59
|
-
opacity 0.2s;
|
|
60
|
-
transform-origin: 100% 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
::slotted(:not([slot$='fix'])) {
|
|
64
|
-
cursor: inherit;
|
|
65
|
-
min-height: var(--vaadin-input-field-height, var(--_input-height));
|
|
66
|
-
padding: 0 0.25em;
|
|
67
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
|
|
68
|
-
-webkit-mask-image: var(--_lumo-text-field-overflow-mask-image);
|
|
69
|
-
mask-image: var(--_lumo-text-field-overflow-mask-image);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Read-only */
|
|
73
|
-
:host([readonly]) {
|
|
74
|
-
color: var(--lumo-secondary-text-color);
|
|
75
|
-
background-color: transparent;
|
|
76
|
-
cursor: default;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:host([readonly])::after {
|
|
80
|
-
background-color: transparent;
|
|
81
|
-
opacity: 1;
|
|
82
|
-
border: var(--vaadin-input-field-readonly-border, 1px dashed var(--lumo-contrast-30pct));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/* Disabled */
|
|
86
|
-
:host([disabled]) {
|
|
87
|
-
background: var(--_disabled-background);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host([disabled]) ::slotted(:not([slot$='fix'])) {
|
|
91
|
-
-webkit-text-fill-color: var(--_disabled-value-color);
|
|
92
|
-
color: var(--_disabled-value-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* Invalid */
|
|
96
|
-
:host([invalid]) {
|
|
97
|
-
background: var(--_invalid-background);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
:host([invalid]:not([readonly]))::after {
|
|
101
|
-
background: var(--_invalid-hover-highlight);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* Slotted icons */
|
|
105
|
-
::slotted(vaadin-icon) {
|
|
106
|
-
color: var(--_icon-color);
|
|
107
|
-
width: var(--_icon-size);
|
|
108
|
-
height: var(--_icon-size);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
|
|
112
|
-
::slotted(vaadin-icon[icon^='vaadin:']) {
|
|
113
|
-
padding: 0.25em;
|
|
114
|
-
box-sizing: border-box !important;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Text align */
|
|
118
|
-
:host([dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
119
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent, #000 1.25em);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
@-moz-document url-prefix() {
|
|
123
|
-
:host([dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
124
|
-
mask-image: var(--_lumo-text-field-overflow-mask-image);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
:host([theme~='align-left']) ::slotted(:not([slot$='fix'])) {
|
|
129
|
-
text-align: start;
|
|
130
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:host([theme~='align-center']) ::slotted(:not([slot$='fix'])) {
|
|
134
|
-
text-align: center;
|
|
135
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
:host([theme~='align-right']) ::slotted(:not([slot$='fix'])) {
|
|
139
|
-
text-align: end;
|
|
140
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@-moz-document url-prefix() {
|
|
144
|
-
/* Firefox is smart enough to align overflowing text to right */
|
|
145
|
-
:host([theme~='align-right']) ::slotted(:not([slot$='fix'])) {
|
|
146
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
@-moz-document url-prefix() {
|
|
151
|
-
/* Firefox is smart enough to align overflowing text to right */
|
|
152
|
-
:host([theme~='align-left']) ::slotted(:not([slot$='fix'])) {
|
|
153
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* RTL specific styles */
|
|
158
|
-
:host([dir='rtl'])::after {
|
|
159
|
-
transform-origin: 0% 0;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
:host([theme~='align-left'][dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
163
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
:host([theme~='align-center'][dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
167
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
:host([theme~='align-right'][dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
171
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
@-moz-document url-prefix() {
|
|
175
|
-
/* Firefox is smart enough to align overflowing text to right */
|
|
176
|
-
:host([theme~='align-right'][dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
177
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
@-moz-document url-prefix() {
|
|
182
|
-
/* Firefox is smart enough to align overflowing text to right */
|
|
183
|
-
:host([theme~='align-left'][dir='rtl']) ::slotted(:not([slot$='fix'])) {
|
|
184
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
`,
|
|
188
|
-
{ moduleId: 'lumo-input-container' },
|
|
189
|
-
);
|