@vaadin/text-field 24.3.0-alpha9 → 24.3.0-beta2
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 +9 -11
- package/src/vaadin-lit-text-field.d.ts +6 -0
- package/src/vaadin-lit-text-field.js +87 -0
- package/theme/lumo/vaadin-lit-text-field.js +7 -0
- package/theme/material/vaadin-lit-text-field.js +7 -0
- package/vaadin-lit-text-field.d.ts +1 -0
- package/vaadin-lit-text-field.js +3 -0
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/text-field",
|
|
3
|
-
"version": "24.3.0-
|
|
3
|
+
"version": "24.3.0-beta2",
|
|
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-lit-text-field.d.ts",
|
|
25
|
-
"!src/vaadin-lit-text-field.js",
|
|
26
24
|
"theme",
|
|
27
25
|
"vaadin-*.d.ts",
|
|
28
26
|
"vaadin-*.js",
|
|
@@ -38,13 +36,13 @@
|
|
|
38
36
|
"dependencies": {
|
|
39
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
38
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/a11y-base": "24.3.0-
|
|
42
|
-
"@vaadin/component-base": "24.3.0-
|
|
43
|
-
"@vaadin/field-base": "24.3.0-
|
|
44
|
-
"@vaadin/input-container": "24.3.0-
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "24.3.0-
|
|
46
|
-
"@vaadin/vaadin-material-styles": "24.3.0-
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "24.3.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.3.0-beta2",
|
|
40
|
+
"@vaadin/component-base": "24.3.0-beta2",
|
|
41
|
+
"@vaadin/field-base": "24.3.0-beta2",
|
|
42
|
+
"@vaadin/input-container": "24.3.0-beta2",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "24.3.0-beta2",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "24.3.0-beta2",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "24.3.0-beta2",
|
|
48
46
|
"lit": "^3.0.0"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
@@ -56,5 +54,5 @@
|
|
|
56
54
|
"web-types.json",
|
|
57
55
|
"web-types.lit.json"
|
|
58
56
|
],
|
|
59
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0bbfb24cb8dcd6e1dca8ecf2269635efac53e4d0"
|
|
60
58
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/input-container/src/vaadin-lit-input-container.js';
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
+
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
12
|
+
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
13
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
+
import { TextFieldMixin } from './vaadin-text-field-mixin.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* LitElement based version of `<vaadin-text-field>` web component.
|
|
18
|
+
*
|
|
19
|
+
* ## Disclaimer
|
|
20
|
+
*
|
|
21
|
+
* This component is an experiment not intended for publishing to npm.
|
|
22
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
23
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
24
|
+
*/
|
|
25
|
+
export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
26
|
+
static get is() {
|
|
27
|
+
return 'vaadin-text-field';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static get styles() {
|
|
31
|
+
return [
|
|
32
|
+
inputFieldShared,
|
|
33
|
+
css`
|
|
34
|
+
[part='input-field'] {
|
|
35
|
+
flex-grow: 0;
|
|
36
|
+
}
|
|
37
|
+
`,
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** @protected */
|
|
42
|
+
render() {
|
|
43
|
+
return html`
|
|
44
|
+
<div class="vaadin-field-container">
|
|
45
|
+
<div part="label">
|
|
46
|
+
<slot name="label"></slot>
|
|
47
|
+
<span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<vaadin-input-container
|
|
51
|
+
part="input-field"
|
|
52
|
+
.readonly="${this.readonly}"
|
|
53
|
+
.disabled="${this.disabled}"
|
|
54
|
+
.invalid="${this.invalid}"
|
|
55
|
+
theme="${this._theme}"
|
|
56
|
+
>
|
|
57
|
+
<slot name="prefix" slot="prefix"></slot>
|
|
58
|
+
<slot name="input"></slot>
|
|
59
|
+
<slot name="suffix" slot="suffix"></slot>
|
|
60
|
+
<div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
|
|
61
|
+
</vaadin-input-container>
|
|
62
|
+
|
|
63
|
+
<div part="helper-text">
|
|
64
|
+
<slot name="helper"></slot>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div part="error-message">
|
|
68
|
+
<slot name="error-message"></slot>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<slot name="tooltip"></slot>
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** @protected */
|
|
77
|
+
ready() {
|
|
78
|
+
super.ready();
|
|
79
|
+
|
|
80
|
+
this._tooltipController = new TooltipController(this);
|
|
81
|
+
this._tooltipController.setPosition('top');
|
|
82
|
+
this._tooltipController.setAriaTarget(this.inputElement);
|
|
83
|
+
this.addController(this._tooltipController);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
defineCustomElement(TextField);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-text-field.js';
|
package/web-types.json
CHANGED