@vaadin/custom-field 25.0.0-alpha2 → 25.0.0-alpha20
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 +20 -21
- package/src/styles/vaadin-custom-field-base-styles.js +20 -0
- package/src/vaadin-custom-field-mixin.js +10 -7
- package/src/vaadin-custom-field.d.ts +10 -19
- package/src/vaadin-custom-field.js +13 -11
- package/vaadin-custom-field.js +1 -1
- package/web-types.json +4 -4
- package/web-types.lit.json +3 -3
- package/src/vaadin-custom-field-styles.js +0 -34
- package/theme/lumo/vaadin-custom-field-styles.d.ts +0 -11
- package/theme/lumo/vaadin-custom-field-styles.js +0 -97
- package/theme/lumo/vaadin-custom-field.d.ts +0 -7
- package/theme/lumo/vaadin-custom-field.js +0 -7
- /package/src/{vaadin-custom-field-styles.d.ts → styles/vaadin-custom-field-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/custom-field",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha20",
|
|
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,32 +34,32 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/component-base": "25.0.0-
|
|
40
|
-
"@vaadin/field-base": "25.0.0-
|
|
41
|
-
"@vaadin/vaadin-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha20",
|
|
38
|
+
"@vaadin/component-base": "25.0.0-alpha20",
|
|
39
|
+
"@vaadin/field-base": "25.0.0-alpha20",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha20",
|
|
43
41
|
"lit": "^3.0.0"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
47
|
-
"@vaadin/combo-box": "25.0.0-
|
|
48
|
-
"@vaadin/date-picker": "25.0.0-
|
|
49
|
-
"@vaadin/email-field": "25.0.0-
|
|
50
|
-
"@vaadin/form-layout": "25.0.0-
|
|
51
|
-
"@vaadin/number-field": "25.0.0-
|
|
52
|
-
"@vaadin/password-field": "25.0.0-
|
|
53
|
-
"@vaadin/select": "25.0.0-
|
|
54
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
44
|
+
"@vaadin/chai-plugins": "25.0.0-alpha20",
|
|
45
|
+
"@vaadin/combo-box": "25.0.0-alpha20",
|
|
46
|
+
"@vaadin/date-picker": "25.0.0-alpha20",
|
|
47
|
+
"@vaadin/email-field": "25.0.0-alpha20",
|
|
48
|
+
"@vaadin/form-layout": "25.0.0-alpha20",
|
|
49
|
+
"@vaadin/number-field": "25.0.0-alpha20",
|
|
50
|
+
"@vaadin/password-field": "25.0.0-alpha20",
|
|
51
|
+
"@vaadin/select": "25.0.0-alpha20",
|
|
52
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha20",
|
|
55
53
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
56
|
-
"@vaadin/text-area": "25.0.0-
|
|
57
|
-
"@vaadin/text-field": "25.0.0-
|
|
58
|
-
"@vaadin/time-picker": "25.0.0-
|
|
59
|
-
"
|
|
54
|
+
"@vaadin/text-area": "25.0.0-alpha20",
|
|
55
|
+
"@vaadin/text-field": "25.0.0-alpha20",
|
|
56
|
+
"@vaadin/time-picker": "25.0.0-alpha20",
|
|
57
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha20",
|
|
58
|
+
"sinon": "^21.0.0"
|
|
60
59
|
},
|
|
61
60
|
"web-types": [
|
|
62
61
|
"web-types.json",
|
|
63
62
|
"web-types.lit.json"
|
|
64
63
|
],
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c948aae591a30b432f3784000d4677674cae56e0"
|
|
66
65
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 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
|
+
import { container } from '@vaadin/field-base/src/styles/container-base-styles.js';
|
|
8
|
+
import { field } from '@vaadin/field-base/src/styles/field-base-styles.js';
|
|
9
|
+
|
|
10
|
+
const customField = css`
|
|
11
|
+
.vaadin-custom-field-container {
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.inputs-wrapper {
|
|
16
|
+
flex: none;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const customFieldStyles = [field, container, customField];
|
|
@@ -144,10 +144,14 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
/**
|
|
148
|
-
|
|
147
|
+
/**
|
|
148
|
+
* @param {FocusOptions=} options
|
|
149
|
+
* @protected
|
|
150
|
+
* @override
|
|
151
|
+
*/
|
|
152
|
+
focus(options) {
|
|
149
153
|
if (this.inputs && this.inputs[0]) {
|
|
150
|
-
this.inputs[0].focus();
|
|
154
|
+
this.inputs[0].focus(options);
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
|
|
@@ -220,11 +224,10 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
220
224
|
(inputs.indexOf(e.target) < inputs.length - 1 && !e.shiftKey) ||
|
|
221
225
|
(inputs.indexOf(e.target) > 0 && e.shiftKey)
|
|
222
226
|
) {
|
|
223
|
-
|
|
224
|
-
} else {
|
|
225
|
-
// FIXME(yuriy): remove this workaround when value should not be updated before focusout
|
|
226
|
-
this.__setValue();
|
|
227
|
+
return;
|
|
227
228
|
}
|
|
229
|
+
// FIXME(yuriy): remove this workaround when value should not be updated before focusout
|
|
230
|
+
this.__setValue();
|
|
228
231
|
}
|
|
229
232
|
}
|
|
230
233
|
|
|
@@ -31,21 +31,11 @@ export type CustomFieldValueChangedEvent = CustomEvent<{ value: string }>;
|
|
|
31
31
|
*/
|
|
32
32
|
export type CustomFieldValidatedEvent = CustomEvent<{ valid: boolean }>;
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* Fired on Tab keydown triggered from the internal inputs, meaning focus will not leave the inputs.
|
|
36
|
-
* @deprecated
|
|
37
|
-
*/
|
|
38
|
-
export type CustomFieldInternalTabEvent = Event & {
|
|
39
|
-
target: CustomField;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
34
|
export interface CustomFieldCustomEventMap {
|
|
43
35
|
'invalid-changed': CustomFieldInvalidChangedEvent;
|
|
44
36
|
|
|
45
37
|
'value-changed': CustomFieldValueChangedEvent;
|
|
46
38
|
|
|
47
|
-
'internal-tab': CustomFieldInternalTabEvent;
|
|
48
|
-
|
|
49
39
|
validated: CustomFieldValidatedEvent;
|
|
50
40
|
}
|
|
51
41
|
|
|
@@ -56,7 +46,7 @@ export interface CustomFieldEventMap extends HTMLElementEventMap, CustomFieldCus
|
|
|
56
46
|
/**
|
|
57
47
|
* `<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.
|
|
58
48
|
*
|
|
59
|
-
* ```
|
|
49
|
+
* ```html
|
|
60
50
|
* <vaadin-custom-field label="Appointment time">
|
|
61
51
|
* <vaadin-date-picker></vaadin-date-picker>
|
|
62
52
|
* <vaadin-time-picker></vaadin-time-picker>
|
|
@@ -77,14 +67,15 @@ export interface CustomFieldEventMap extends HTMLElementEventMap, CustomFieldCus
|
|
|
77
67
|
*
|
|
78
68
|
* The following state attributes are available for styling:
|
|
79
69
|
*
|
|
80
|
-
* Attribute | Description
|
|
81
|
-
*
|
|
82
|
-
* `invalid` | Set when the element is invalid
|
|
83
|
-
* `focused` | Set when the element is focused
|
|
84
|
-
* `has-label` | Set when the element has a label
|
|
85
|
-
* `has-value` | Set when the element has a value
|
|
86
|
-
* `has-helper` | Set when the element has helper text
|
|
87
|
-
* `has-error-message` | Set when the element has an error message
|
|
70
|
+
* Attribute | Description
|
|
71
|
+
* --------------------|--------------------------------
|
|
72
|
+
* `invalid` | Set when the element is invalid
|
|
73
|
+
* `focused` | Set when the element is focused
|
|
74
|
+
* `has-label` | Set when the element has a label
|
|
75
|
+
* `has-value` | Set when the element has a value
|
|
76
|
+
* `has-helper` | Set when the element has helper text
|
|
77
|
+
* `has-error-message` | Set when the element has an error message
|
|
78
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
88
79
|
*
|
|
89
80
|
* You may also manually set `disabled` or `readonly` attribute on this component to make the label
|
|
90
81
|
* part look visually the same as on a `<vaadin-text-field>` when it is disabled or readonly.
|
|
@@ -7,14 +7,15 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-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';
|
|
12
|
+
import { customFieldStyles } from './styles/vaadin-custom-field-base-styles.js';
|
|
11
13
|
import { CustomFieldMixin } from './vaadin-custom-field-mixin.js';
|
|
12
|
-
import { customFieldStyles } from './vaadin-custom-field-styles.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* `<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.
|
|
16
17
|
*
|
|
17
|
-
* ```
|
|
18
|
+
* ```html
|
|
18
19
|
* <vaadin-custom-field label="Appointment time">
|
|
19
20
|
* <vaadin-date-picker></vaadin-date-picker>
|
|
20
21
|
* <vaadin-time-picker></vaadin-time-picker>
|
|
@@ -35,14 +36,15 @@ import { customFieldStyles } from './vaadin-custom-field-styles.js';
|
|
|
35
36
|
*
|
|
36
37
|
* The following state attributes are available for styling:
|
|
37
38
|
*
|
|
38
|
-
* Attribute | Description
|
|
39
|
-
*
|
|
40
|
-
* `invalid` | Set when the element is invalid
|
|
41
|
-
* `focused` | Set when the element is focused
|
|
42
|
-
* `has-label` | Set when the element has a label
|
|
43
|
-
* `has-value` | Set when the element has a value
|
|
44
|
-
* `has-helper` | Set when the element has helper text
|
|
45
|
-
* `has-error-message` | Set when the element has an error message
|
|
39
|
+
* Attribute | Description
|
|
40
|
+
* --------------------|--------------------------------
|
|
41
|
+
* `invalid` | Set when the element is invalid
|
|
42
|
+
* `focused` | Set when the element is focused
|
|
43
|
+
* `has-label` | Set when the element has a label
|
|
44
|
+
* `has-value` | Set when the element has a value
|
|
45
|
+
* `has-helper` | Set when the element has helper text
|
|
46
|
+
* `has-error-message` | Set when the element has an error message
|
|
47
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
46
48
|
*
|
|
47
49
|
* You may also manually set `disabled` or `readonly` attribute on this component to make the label
|
|
48
50
|
* part look visually the same as on a `<vaadin-text-field>` when it is disabled or readonly.
|
|
@@ -60,7 +62,7 @@ import { customFieldStyles } from './vaadin-custom-field-styles.js';
|
|
|
60
62
|
* @mixes ElementMixin
|
|
61
63
|
* @mixes ThemableMixin
|
|
62
64
|
*/
|
|
63
|
-
class CustomField extends CustomFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
65
|
+
class CustomField extends CustomFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
64
66
|
static get is() {
|
|
65
67
|
return 'vaadin-custom-field';
|
|
66
68
|
}
|
package/vaadin-custom-field.js
CHANGED
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/custom-field",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha20",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-custom-field",
|
|
11
|
-
"description": "`<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.\n\n
|
|
11
|
+
"description": "`<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.\n\n```html\n<vaadin-custom-field label=\"Appointment time\">\n <vaadin-date-picker></vaadin-date-picker>\n <vaadin-time-picker></vaadin-time-picker>\n</vaadin-custom-field>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n`input-fields` | The slotted input elements wrapper\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|--------------------------------\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nYou may also manually set `disabled` or `readonly` attribute on this component to make the label\npart look visually the same as on a `<vaadin-text-field>` when it is disabled or readonly.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "label",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
"name": "value",
|
|
114
|
-
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
114
|
+
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
115
115
|
"value": {
|
|
116
116
|
"type": [
|
|
117
117
|
"string",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
"name": "value",
|
|
238
|
-
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
238
|
+
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
239
239
|
"value": {
|
|
240
240
|
"type": [
|
|
241
241
|
"string",
|
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/custom-field",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha20",
|
|
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-custom-field",
|
|
19
|
-
"description": "`<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.\n\n
|
|
19
|
+
"description": "`<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.\n\n```html\n<vaadin-custom-field label=\"Appointment time\">\n <vaadin-date-picker></vaadin-date-picker>\n <vaadin-time-picker></vaadin-time-picker>\n</vaadin-custom-field>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n`input-fields` | The slotted input elements wrapper\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|--------------------------------\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nYou may also manually set `disabled` or `readonly` attribute on this component to make the label\npart look visually the same as on a `<vaadin-text-field>` when it is disabled or readonly.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"name": ".value",
|
|
87
|
-
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
87
|
+
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
88
88
|
"value": {
|
|
89
89
|
"kind": "expression"
|
|
90
90
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2019 - 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 customFieldStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host::before {
|
|
14
|
-
content: '\\2003';
|
|
15
|
-
width: 0;
|
|
16
|
-
display: inline-block;
|
|
17
|
-
/* Size and position this element on the same vertical position as the input-field element
|
|
18
|
-
to make vertical align for the host element work as expected */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:host([hidden]) {
|
|
22
|
-
display: none !important;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.vaadin-custom-field-container {
|
|
26
|
-
width: 100%;
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.inputs-wrapper {
|
|
32
|
-
flex: none;
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
7
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
8
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
9
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
10
|
-
declare const customField: import("lit").CSSResult;
|
|
11
|
-
export { customField };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
7
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
8
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
9
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
10
|
-
import { helper } from '@vaadin/vaadin-lumo-styles/mixins/helper.js';
|
|
11
|
-
import { requiredField } from '@vaadin/vaadin-lumo-styles/mixins/required-field.js';
|
|
12
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
|
|
14
|
-
const customField = css`
|
|
15
|
-
:host {
|
|
16
|
-
--lumo-text-field-size: var(--lumo-size-m);
|
|
17
|
-
color: var(--lumo-body-text-color);
|
|
18
|
-
font-size: var(--lumo-font-size-m);
|
|
19
|
-
/* align with text-field height + vertical paddings */
|
|
20
|
-
line-height: calc(var(--lumo-text-field-size) + 2 * var(--lumo-space-xs));
|
|
21
|
-
font-family: var(--lumo-font-family);
|
|
22
|
-
-webkit-font-smoothing: antialiased;
|
|
23
|
-
-moz-osx-font-smoothing: grayscale;
|
|
24
|
-
-webkit-tap-highlight-color: transparent;
|
|
25
|
-
padding: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
:host::before {
|
|
29
|
-
margin-top: var(--lumo-space-xs);
|
|
30
|
-
height: var(--lumo-text-field-size);
|
|
31
|
-
box-sizing: border-box;
|
|
32
|
-
display: inline-flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* align with text-field label */
|
|
37
|
-
:host([has-label]) [part='label'] {
|
|
38
|
-
padding-bottom: calc(0.5em - var(--lumo-space-xs));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:host(:not([has-label])) [part='label'],
|
|
42
|
-
:host(:not([has-label]))::before {
|
|
43
|
-
display: none;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* align with text-field error message */
|
|
47
|
-
:host([has-error-message]) [part='error-message']::before {
|
|
48
|
-
height: calc(0.4em - var(--lumo-space-xs));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:host([focused]:not([readonly]):not([disabled])) [part='label'] {
|
|
52
|
-
color: var(--lumo-primary-text-color);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
:host(:hover:not([readonly]):not([disabled]):not([focused])) [part='label'],
|
|
56
|
-
:host(:hover:not([readonly]):not([disabled]):not([focused])) [part='helper-text'] {
|
|
57
|
-
color: var(--lumo-body-text-color);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Touch device adjustment */
|
|
61
|
-
@media (pointer: coarse) {
|
|
62
|
-
:host(:hover:not([readonly]):not([disabled]):not([focused])) [part='label'] {
|
|
63
|
-
color: var(--lumo-secondary-text-color);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Disabled */
|
|
68
|
-
:host([disabled]) [part='label'] {
|
|
69
|
-
color: var(--lumo-disabled-text-color);
|
|
70
|
-
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* Small theme */
|
|
74
|
-
:host([theme~='small']) {
|
|
75
|
-
font-size: var(--lumo-font-size-s);
|
|
76
|
-
--lumo-text-field-size: var(--lumo-size-s);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:host([theme~='small'][has-label]) [part='label'] {
|
|
80
|
-
font-size: var(--lumo-font-size-xs);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
:host([theme~='small'][has-label]) [part='error-message'] {
|
|
84
|
-
font-size: var(--lumo-font-size-xxs);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* When custom-field is used with components without outer margin */
|
|
88
|
-
:host([theme~='whitespace'][has-label]) [part='label'] {
|
|
89
|
-
padding-bottom: 0.5em;
|
|
90
|
-
}
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
registerStyles('vaadin-custom-field', [requiredField, helper, customField], {
|
|
94
|
-
moduleId: 'lumo-custom-field',
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
export { customField };
|
/package/src/{vaadin-custom-field-styles.d.ts → styles/vaadin-custom-field-base-styles.d.ts}
RENAMED
|
File without changes
|