@vaadin/field-base 25.0.0-alpha1 → 25.0.0-alpha10
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 +7 -7
- package/src/input-control-mixin.js +16 -2
- package/src/input-field-mixin.d.ts +0 -9
- package/src/styles/checkable-core-styles.d.ts +8 -0
- package/src/styles/checkable-core-styles.js +64 -0
- package/src/styles/field-core-styles.js +2 -0
- package/src/styles/group-core-styles.d.ts +8 -0
- package/src/styles/group-core-styles.js +37 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-base",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
36
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
37
|
-
"@vaadin/component-base": "25.0.0-
|
|
36
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
37
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
38
38
|
"lit": "^3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
42
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
43
|
-
"@vaadin/testing-helpers": "^
|
|
41
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
44
44
|
"sinon": "^18.0.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
47
47
|
}
|
|
@@ -103,13 +103,27 @@ export const InputControlMixin = (superclass) =>
|
|
|
103
103
|
|
|
104
104
|
/** @protected */
|
|
105
105
|
get slotStyles() {
|
|
106
|
-
|
|
106
|
+
const tag = this.localName;
|
|
107
|
+
|
|
107
108
|
return [
|
|
108
109
|
`
|
|
109
|
-
|
|
110
|
+
/* Needed for Safari, where ::slotted(...)::placeholder does not work */
|
|
111
|
+
${tag} > :is(input[slot='input'], textarea[slot='textarea'])::placeholder {
|
|
110
112
|
font: inherit;
|
|
111
113
|
color: inherit;
|
|
112
114
|
}
|
|
115
|
+
|
|
116
|
+
/* Override built-in autofill styles */
|
|
117
|
+
${tag} > input[slot='input']:autofill {
|
|
118
|
+
-webkit-text-fill-color: var(--vaadin-input-field-autofill-color, black);
|
|
119
|
+
background-clip: text;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${tag}:has(> input[slot='input']:autofill) {
|
|
123
|
+
--vaadin-input-field-background: var(--vaadin-input-field-autofill-background, lightyellow);
|
|
124
|
+
--vaadin-input-field-value-color: var(--vaadin-input-field-autofill-color, black);
|
|
125
|
+
--vaadin-input-field-button-color: var(--vaadin-input-field-autofill-color, black);
|
|
126
|
+
}
|
|
113
127
|
`,
|
|
114
128
|
];
|
|
115
129
|
}
|
|
@@ -47,15 +47,6 @@ export declare class InputFieldMixinClass {
|
|
|
47
47
|
*/
|
|
48
48
|
autocomplete: string | undefined;
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* This is a property supported by Safari that is used to control whether
|
|
52
|
-
* autocorrection should be enabled when the user is entering/editing the text.
|
|
53
|
-
* Possible values are:
|
|
54
|
-
* on: Enable autocorrection.
|
|
55
|
-
* off: Disable autocorrection.
|
|
56
|
-
*/
|
|
57
|
-
autocorrect: 'off' | 'on' | undefined;
|
|
58
|
-
|
|
59
50
|
/**
|
|
60
51
|
* This is a property supported by Safari and Chrome that is used to control whether
|
|
61
52
|
* autocapitalization should be enabled when the user is entering/editing the text.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import type { CSSResult } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const checkable: (part: string, propName?: string) => CSSResult;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css, unsafeCSS } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const checkable = (part, propName = part) => css`
|
|
9
|
+
:host {
|
|
10
|
+
display: inline-block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([disabled]) {
|
|
18
|
+
-webkit-tap-highlight-color: transparent;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.vaadin-${unsafeCSS(propName)}-container {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: auto 1fr;
|
|
24
|
+
align-items: baseline;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[part='${unsafeCSS(part)}'],
|
|
28
|
+
::slotted(input),
|
|
29
|
+
[part='label'],
|
|
30
|
+
::slotted(label) {
|
|
31
|
+
grid-row: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[part='${unsafeCSS(part)}'],
|
|
35
|
+
::slotted(input) {
|
|
36
|
+
grid-column: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Control container (checkbox, radio button) */
|
|
40
|
+
[part='${unsafeCSS(part)}'] {
|
|
41
|
+
width: var(--vaadin-${unsafeCSS(propName)}-size, 1em);
|
|
42
|
+
height: var(--vaadin-${unsafeCSS(propName)}-size, 1em);
|
|
43
|
+
--_input-border-width: var(--vaadin-input-field-border-width, 0);
|
|
44
|
+
--_input-border-color: var(--vaadin-input-field-border-color, transparent);
|
|
45
|
+
box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[part='${unsafeCSS(part)}']::before {
|
|
49
|
+
display: block;
|
|
50
|
+
content: '\\202F';
|
|
51
|
+
line-height: var(--vaadin-${unsafeCSS(propName)}-size, 1em);
|
|
52
|
+
contain: paint;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* visually hidden */
|
|
56
|
+
::slotted(input) {
|
|
57
|
+
cursor: inherit;
|
|
58
|
+
margin: 0;
|
|
59
|
+
align-self: stretch;
|
|
60
|
+
appearance: none;
|
|
61
|
+
width: initial;
|
|
62
|
+
height: initial;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 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 group = () => css`
|
|
9
|
+
:host {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host::before {
|
|
14
|
+
content: '\\2003';
|
|
15
|
+
width: 0;
|
|
16
|
+
display: inline-block;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([hidden]) {
|
|
20
|
+
display: none !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.vaadin-group-field-container {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[part='group-field'] {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host(:not([has-label])) [part='label'] {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
`;
|