@vaadin/text-field 24.0.0-beta1 → 24.0.0-beta3
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 +11 -8
- package/src/vaadin-text-field-mixin.d.ts +60 -0
- package/src/vaadin-text-field-mixin.js +76 -0
- package/src/vaadin-text-field.d.ts +2 -13
- package/src/vaadin-text-field.js +3 -35
- package/web-types.json +73 -73
- package/web-types.lit.json +29 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/text-field",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-beta3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
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",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -34,13 +36,14 @@
|
|
|
34
36
|
"web-component"
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
39
|
+
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
37
40
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "24.0.0-
|
|
39
|
-
"@vaadin/field-base": "24.0.0-
|
|
40
|
-
"@vaadin/input-container": "24.0.0-
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "24.0.0-
|
|
42
|
-
"@vaadin/vaadin-material-styles": "24.0.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "24.0.0-
|
|
41
|
+
"@vaadin/component-base": "24.0.0-beta3",
|
|
42
|
+
"@vaadin/field-base": "24.0.0-beta3",
|
|
43
|
+
"@vaadin/input-container": "24.0.0-beta3",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "24.0.0-beta3",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "24.0.0-beta3",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "24.0.0-beta3"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
49
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -51,5 +54,5 @@
|
|
|
51
54
|
"web-types.json",
|
|
52
55
|
"web-types.lit.json"
|
|
53
56
|
],
|
|
54
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "4daeac63327393aacd9cfaa5abeb031ea86b14a5"
|
|
55
58
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
8
|
+
import type { DelegateFocusMixinClass } from '@vaadin/component-base/src/delegate-focus-mixin.js';
|
|
9
|
+
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
10
|
+
import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
11
|
+
import type { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
|
|
12
|
+
import type { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
|
|
13
|
+
import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
|
|
14
|
+
import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
|
|
15
|
+
import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
|
|
16
|
+
import type { InputFieldMixinClass } from '@vaadin/field-base/src/input-field-mixin.js';
|
|
17
|
+
import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
|
|
18
|
+
import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
|
|
19
|
+
import type { SlotStylesMixinClass } from '@vaadin/field-base/src/slot-styles-mixin.js';
|
|
20
|
+
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A mixin providing common text field functionality.
|
|
24
|
+
*/
|
|
25
|
+
export declare function TextFieldMixin<T extends Constructor<HTMLElement>>(
|
|
26
|
+
base: T,
|
|
27
|
+
): Constructor<ControllerMixinClass> &
|
|
28
|
+
Constructor<DelegateFocusMixinClass> &
|
|
29
|
+
Constructor<DelegateStateMixinClass> &
|
|
30
|
+
Constructor<DisabledMixinClass> &
|
|
31
|
+
Constructor<FieldMixinClass> &
|
|
32
|
+
Constructor<FocusMixinClass> &
|
|
33
|
+
Constructor<InputConstraintsMixinClass> &
|
|
34
|
+
Constructor<InputControlMixinClass> &
|
|
35
|
+
Constructor<InputFieldMixinClass> &
|
|
36
|
+
Constructor<InputMixinClass> &
|
|
37
|
+
Constructor<KeyboardMixinClass> &
|
|
38
|
+
Constructor<LabelMixinClass> &
|
|
39
|
+
Constructor<SlotStylesMixinClass> &
|
|
40
|
+
Constructor<TexFieldMixinClass> &
|
|
41
|
+
Constructor<ValidateMixinClass> &
|
|
42
|
+
T;
|
|
43
|
+
|
|
44
|
+
export declare class TexFieldMixinClass {
|
|
45
|
+
/**
|
|
46
|
+
* Maximum number of characters (in Unicode code points) that the user can enter.
|
|
47
|
+
*/
|
|
48
|
+
maxlength: number | null | undefined;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Minimum number of characters (in Unicode code points) that the user can enter.
|
|
52
|
+
*/
|
|
53
|
+
minlength: number | null | undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A regular expression that the value is checked against.
|
|
57
|
+
* The pattern must match the entire value, not just some subset.
|
|
58
|
+
*/
|
|
59
|
+
pattern: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { InputController } from '@vaadin/field-base/src/input-controller.js';
|
|
7
|
+
import { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';
|
|
8
|
+
import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A mixin providing common text field functionality.
|
|
12
|
+
*
|
|
13
|
+
* @polymerMixin
|
|
14
|
+
* @mixes InputFieldMixin
|
|
15
|
+
*/
|
|
16
|
+
export const TextFieldMixin = (superClass) =>
|
|
17
|
+
class TextFieldMixinClass extends InputFieldMixin(superClass) {
|
|
18
|
+
static get properties() {
|
|
19
|
+
return {
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of characters (in Unicode code points) that the user can enter.
|
|
22
|
+
*/
|
|
23
|
+
maxlength: {
|
|
24
|
+
type: Number,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Minimum number of characters (in Unicode code points) that the user can enter.
|
|
29
|
+
*/
|
|
30
|
+
minlength: {
|
|
31
|
+
type: Number,
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A regular expression that the value is checked against.
|
|
36
|
+
* The pattern must match the entire value, not just some subset.
|
|
37
|
+
*/
|
|
38
|
+
pattern: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static get delegateAttrs() {
|
|
45
|
+
return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static get constraints() {
|
|
49
|
+
return [...super.constraints, 'maxlength', 'minlength', 'pattern'];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
constructor() {
|
|
53
|
+
super();
|
|
54
|
+
this._setType('text');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @protected */
|
|
58
|
+
get clearElement() {
|
|
59
|
+
return this.$.clearButton;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** @protected */
|
|
63
|
+
ready() {
|
|
64
|
+
super.ready();
|
|
65
|
+
|
|
66
|
+
this.addController(
|
|
67
|
+
new InputController(this, (input) => {
|
|
68
|
+
this._setInputElement(input);
|
|
69
|
+
this._setFocusElement(input);
|
|
70
|
+
this.stateTarget = input;
|
|
71
|
+
this.ariaTarget = input;
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
|
-
import { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';
|
|
8
|
-
import { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';
|
|
9
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
+
import { TextFieldMixin } from './vaadin-text-field-mixin.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Fired when the user commits a value change.
|
|
@@ -105,17 +104,7 @@ export interface TextFieldEventMap extends HTMLElementEventMap, TextFieldCustomE
|
|
|
105
104
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
106
105
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
107
106
|
*/
|
|
108
|
-
declare class TextField extends
|
|
109
|
-
/**
|
|
110
|
-
* Maximum number of characters (in Unicode code points) that the user can enter.
|
|
111
|
-
*/
|
|
112
|
-
maxlength: number | null | undefined;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Minimum number of characters (in Unicode code points) that the user can enter.
|
|
116
|
-
*/
|
|
117
|
-
minlength: number | null | undefined;
|
|
118
|
-
|
|
107
|
+
declare class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(HTMLElement))) {
|
|
119
108
|
addEventListener<K extends keyof TextFieldEventMap>(
|
|
120
109
|
type: K,
|
|
121
110
|
listener: (this: TextField, ev: TextFieldEventMap[K]) => void,
|
package/src/vaadin-text-field.js
CHANGED
|
@@ -7,12 +7,9 @@ import '@vaadin/input-container/src/vaadin-input-container.js';
|
|
|
7
7
|
import { html, PolymerElement } from '@polymer/polymer';
|
|
8
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
9
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
10
|
-
import { InputController } from '@vaadin/field-base/src/input-controller.js';
|
|
11
|
-
import { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';
|
|
12
|
-
import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
|
|
13
|
-
import { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';
|
|
14
10
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
15
11
|
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
+
import { TextFieldMixin } from './vaadin-text-field-mixin.js';
|
|
16
13
|
|
|
17
14
|
registerStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-field-styles' });
|
|
18
15
|
|
|
@@ -82,10 +79,9 @@ registerStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-f
|
|
|
82
79
|
* @extends HTMLElement
|
|
83
80
|
* @mixes ElementMixin
|
|
84
81
|
* @mixes ThemableMixin
|
|
85
|
-
* @mixes
|
|
86
|
-
* @mixes InputFieldMixin
|
|
82
|
+
* @mixes TextFieldMixin
|
|
87
83
|
*/
|
|
88
|
-
export class TextField extends
|
|
84
|
+
export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {
|
|
89
85
|
static get is() {
|
|
90
86
|
return 'vaadin-text-field';
|
|
91
87
|
}
|
|
@@ -147,38 +143,10 @@ export class TextField extends PatternMixin(InputFieldMixin(ThemableMixin(Elemen
|
|
|
147
143
|
};
|
|
148
144
|
}
|
|
149
145
|
|
|
150
|
-
static get delegateAttrs() {
|
|
151
|
-
return [...super.delegateAttrs, 'maxlength', 'minlength'];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
static get constraints() {
|
|
155
|
-
return [...super.constraints, 'maxlength', 'minlength'];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
constructor() {
|
|
159
|
-
super();
|
|
160
|
-
this._setType('text');
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/** @protected */
|
|
164
|
-
get clearElement() {
|
|
165
|
-
return this.$.clearButton;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
146
|
/** @protected */
|
|
169
147
|
ready() {
|
|
170
148
|
super.ready();
|
|
171
149
|
|
|
172
|
-
this.addController(
|
|
173
|
-
new InputController(this, (input) => {
|
|
174
|
-
this._setInputElement(input);
|
|
175
|
-
this._setFocusElement(input);
|
|
176
|
-
this.stateTarget = input;
|
|
177
|
-
this.ariaTarget = input;
|
|
178
|
-
}),
|
|
179
|
-
);
|
|
180
|
-
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
181
|
-
|
|
182
150
|
this._tooltipController = new TooltipController(this);
|
|
183
151
|
this._tooltipController.setPosition('top');
|
|
184
152
|
this.addController(this._tooltipController);
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/text-field",
|
|
4
|
-
"version": "24.0.0-
|
|
4
|
+
"version": "24.0.0-beta3",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"description": "`<vaadin-text-field>` is a web component that allows the user to input and edit text.\n\n```html\n<vaadin-text-field label=\"First Name\"></vaadin-text-field>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-field>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-field label=\"Email address\">\n <div slot=\"prefix\">Sent to:</div>\n <div slot=\"suffix\">@vaadin.com</div>\n</vaadin-text-field>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and suffix\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------|------------\n`disabled` | Set to a disabled text field | :host\n`has-value` | Set when the element has a value | :host\n`has-label` | Set when the element has a label | :host\n`has-helper` | Set when the element has helper text or slot | :host\n`has-error-message` | Set when the element has an error message | :host\n`invalid` | Set when the element is invalid | :host\n`input-prevented` | Temporarily set when invalid input is prevented | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set to a readonly text field | :host\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
|
-
"name": "
|
|
15
|
-
"description": "
|
|
14
|
+
"name": "disabled",
|
|
15
|
+
"description": "If true, the user cannot interact with this element.",
|
|
16
16
|
"value": {
|
|
17
17
|
"type": [
|
|
18
|
-
"
|
|
18
|
+
"boolean",
|
|
19
19
|
"null",
|
|
20
20
|
"undefined"
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
"name": "
|
|
26
|
-
"description": "
|
|
25
|
+
"name": "autofocus",
|
|
26
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
27
27
|
"value": {
|
|
28
28
|
"type": [
|
|
29
29
|
"boolean",
|
|
@@ -33,30 +33,30 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"name": "
|
|
37
|
-
"description": "
|
|
36
|
+
"name": "label",
|
|
37
|
+
"description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
|
|
38
38
|
"value": {
|
|
39
39
|
"type": [
|
|
40
|
-
"
|
|
40
|
+
"string",
|
|
41
41
|
"null",
|
|
42
42
|
"undefined"
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
"name": "
|
|
48
|
-
"description": "
|
|
47
|
+
"name": "invalid",
|
|
48
|
+
"description": "Set to true when the field is invalid.",
|
|
49
49
|
"value": {
|
|
50
50
|
"type": [
|
|
51
|
-
"
|
|
51
|
+
"boolean",
|
|
52
52
|
"null",
|
|
53
53
|
"undefined"
|
|
54
54
|
]
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
"name": "
|
|
59
|
-
"description": "
|
|
58
|
+
"name": "required",
|
|
59
|
+
"description": "Specifies that the user must fill in a value.",
|
|
60
60
|
"value": {
|
|
61
61
|
"type": [
|
|
62
62
|
"boolean",
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
"name": "
|
|
70
|
-
"description": "
|
|
69
|
+
"name": "error-message",
|
|
70
|
+
"description": "Error to show when the field is invalid.",
|
|
71
71
|
"value": {
|
|
72
72
|
"type": [
|
|
73
|
-
"
|
|
73
|
+
"string",
|
|
74
74
|
"null",
|
|
75
75
|
"undefined"
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
|
-
"name": "
|
|
81
|
-
"description": "
|
|
80
|
+
"name": "helper-text",
|
|
81
|
+
"description": "String used for the helper text.",
|
|
82
82
|
"value": {
|
|
83
83
|
"type": [
|
|
84
84
|
"string",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"name": "
|
|
92
|
-
"description": "
|
|
91
|
+
"name": "value",
|
|
92
|
+
"description": "The value of the field.",
|
|
93
93
|
"value": {
|
|
94
94
|
"type": [
|
|
95
95
|
"string",
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
"name": "
|
|
103
|
-
"description": "
|
|
102
|
+
"name": "clear-button-visible",
|
|
103
|
+
"description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
|
|
104
104
|
"value": {
|
|
105
105
|
"type": [
|
|
106
|
-
"
|
|
106
|
+
"boolean",
|
|
107
107
|
"null",
|
|
108
108
|
"undefined"
|
|
109
109
|
]
|
|
@@ -131,17 +131,6 @@
|
|
|
131
131
|
]
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
-
{
|
|
135
|
-
"name": "clear-button-visible",
|
|
136
|
-
"description": "Set to true to display the clear icon which clears the input.",
|
|
137
|
-
"value": {
|
|
138
|
-
"type": [
|
|
139
|
-
"boolean",
|
|
140
|
-
"null",
|
|
141
|
-
"undefined"
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
134
|
{
|
|
146
135
|
"name": "name",
|
|
147
136
|
"description": "The name of this field.",
|
|
@@ -241,6 +230,17 @@
|
|
|
241
230
|
]
|
|
242
231
|
}
|
|
243
232
|
},
|
|
233
|
+
{
|
|
234
|
+
"name": "pattern",
|
|
235
|
+
"description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
|
|
236
|
+
"value": {
|
|
237
|
+
"type": [
|
|
238
|
+
"string",
|
|
239
|
+
"null",
|
|
240
|
+
"undefined"
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
244
|
{
|
|
245
245
|
"name": "theme",
|
|
246
246
|
"description": "The theme variants to apply to the component.",
|
|
@@ -256,19 +256,19 @@
|
|
|
256
256
|
"js": {
|
|
257
257
|
"properties": [
|
|
258
258
|
{
|
|
259
|
-
"name": "
|
|
260
|
-
"description": "
|
|
259
|
+
"name": "disabled",
|
|
260
|
+
"description": "If true, the user cannot interact with this element.",
|
|
261
261
|
"value": {
|
|
262
262
|
"type": [
|
|
263
|
-
"
|
|
263
|
+
"boolean",
|
|
264
264
|
"null",
|
|
265
265
|
"undefined"
|
|
266
266
|
]
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
|
-
"name": "
|
|
271
|
-
"description": "
|
|
270
|
+
"name": "autofocus",
|
|
271
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
272
272
|
"value": {
|
|
273
273
|
"type": [
|
|
274
274
|
"boolean",
|
|
@@ -278,30 +278,30 @@
|
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
|
-
"name": "
|
|
282
|
-
"description": "
|
|
281
|
+
"name": "label",
|
|
282
|
+
"description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
|
|
283
283
|
"value": {
|
|
284
284
|
"type": [
|
|
285
|
-
"
|
|
285
|
+
"string",
|
|
286
286
|
"null",
|
|
287
287
|
"undefined"
|
|
288
288
|
]
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
|
-
"name": "
|
|
293
|
-
"description": "
|
|
292
|
+
"name": "invalid",
|
|
293
|
+
"description": "Set to true when the field is invalid.",
|
|
294
294
|
"value": {
|
|
295
295
|
"type": [
|
|
296
|
-
"
|
|
296
|
+
"boolean",
|
|
297
297
|
"null",
|
|
298
298
|
"undefined"
|
|
299
299
|
]
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
|
-
"name": "
|
|
304
|
-
"description": "
|
|
303
|
+
"name": "required",
|
|
304
|
+
"description": "Specifies that the user must fill in a value.",
|
|
305
305
|
"value": {
|
|
306
306
|
"type": [
|
|
307
307
|
"boolean",
|
|
@@ -311,19 +311,19 @@
|
|
|
311
311
|
}
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
|
-
"name": "
|
|
315
|
-
"description": "
|
|
314
|
+
"name": "errorMessage",
|
|
315
|
+
"description": "Error to show when the field is invalid.",
|
|
316
316
|
"value": {
|
|
317
317
|
"type": [
|
|
318
|
-
"
|
|
318
|
+
"string",
|
|
319
319
|
"null",
|
|
320
320
|
"undefined"
|
|
321
321
|
]
|
|
322
322
|
}
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
|
-
"name": "
|
|
326
|
-
"description": "
|
|
325
|
+
"name": "helperText",
|
|
326
|
+
"description": "String used for the helper text.",
|
|
327
327
|
"value": {
|
|
328
328
|
"type": [
|
|
329
329
|
"string",
|
|
@@ -333,8 +333,8 @@
|
|
|
333
333
|
}
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
|
-
"name": "
|
|
337
|
-
"description": "
|
|
336
|
+
"name": "value",
|
|
337
|
+
"description": "The value of the field.",
|
|
338
338
|
"value": {
|
|
339
339
|
"type": [
|
|
340
340
|
"string",
|
|
@@ -344,11 +344,11 @@
|
|
|
344
344
|
}
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
|
-
"name": "
|
|
348
|
-
"description": "
|
|
347
|
+
"name": "clearButtonVisible",
|
|
348
|
+
"description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
|
|
349
349
|
"value": {
|
|
350
350
|
"type": [
|
|
351
|
-
"
|
|
351
|
+
"boolean",
|
|
352
352
|
"null",
|
|
353
353
|
"undefined"
|
|
354
354
|
]
|
|
@@ -376,17 +376,6 @@
|
|
|
376
376
|
]
|
|
377
377
|
}
|
|
378
378
|
},
|
|
379
|
-
{
|
|
380
|
-
"name": "clearButtonVisible",
|
|
381
|
-
"description": "Set to true to display the clear icon which clears the input.",
|
|
382
|
-
"value": {
|
|
383
|
-
"type": [
|
|
384
|
-
"boolean",
|
|
385
|
-
"null",
|
|
386
|
-
"undefined"
|
|
387
|
-
]
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
379
|
{
|
|
391
380
|
"name": "name",
|
|
392
381
|
"description": "The name of this field.",
|
|
@@ -485,6 +474,17 @@
|
|
|
485
474
|
"undefined"
|
|
486
475
|
]
|
|
487
476
|
}
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "pattern",
|
|
480
|
+
"description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
|
|
481
|
+
"value": {
|
|
482
|
+
"type": [
|
|
483
|
+
"string",
|
|
484
|
+
"null",
|
|
485
|
+
"undefined"
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
488
|
}
|
|
489
489
|
],
|
|
490
490
|
"events": [
|
|
@@ -500,13 +500,13 @@
|
|
|
500
500
|
"name": "input",
|
|
501
501
|
"description": "Fired when the value is changed by the user: on every typing keystroke,\nand the value is cleared using the clear button."
|
|
502
502
|
},
|
|
503
|
-
{
|
|
504
|
-
"name": "value-changed",
|
|
505
|
-
"description": "Fired when the `value` property changes."
|
|
506
|
-
},
|
|
507
503
|
{
|
|
508
504
|
"name": "invalid-changed",
|
|
509
505
|
"description": "Fired when the `invalid` property changes."
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"name": "value-changed",
|
|
509
|
+
"description": "Fired when the `value` property changes."
|
|
510
510
|
}
|
|
511
511
|
]
|
|
512
512
|
}
|
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/text-field",
|
|
4
|
-
"version": "24.0.0-
|
|
4
|
+
"version": "24.0.0-beta3",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -19,20 +19,6 @@
|
|
|
19
19
|
"description": "`<vaadin-text-field>` is a web component that allows the user to input and edit text.\n\n```html\n<vaadin-text-field label=\"First Name\"></vaadin-text-field>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-field>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-field label=\"Email address\">\n <div slot=\"prefix\">Sent to:</div>\n <div slot=\"suffix\">@vaadin.com</div>\n</vaadin-text-field>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and suffix\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------|------------\n`disabled` | Set to a disabled text field | :host\n`has-value` | Set when the element has a value | :host\n`has-label` | Set when the element has a label | :host\n`has-helper` | Set when the element has helper text or slot | :host\n`has-error-message` | Set when the element has an error message | :host\n`invalid` | Set when the element is invalid | :host\n`input-prevented` | Temporarily set when invalid input is prevented | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set to a readonly text field | :host\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
|
-
{
|
|
23
|
-
"name": "?invalid",
|
|
24
|
-
"description": "Set to true when the field is invalid.",
|
|
25
|
-
"value": {
|
|
26
|
-
"kind": "expression"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "?required",
|
|
31
|
-
"description": "Specifies that the user must fill in a value.",
|
|
32
|
-
"value": {
|
|
33
|
-
"kind": "expression"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
22
|
{
|
|
37
23
|
"name": "?disabled",
|
|
38
24
|
"description": "If true, the user cannot interact with this element.",
|
|
@@ -48,36 +34,36 @@
|
|
|
48
34
|
}
|
|
49
35
|
},
|
|
50
36
|
{
|
|
51
|
-
"name": "?
|
|
52
|
-
"description": "
|
|
37
|
+
"name": "?invalid",
|
|
38
|
+
"description": "Set to true when the field is invalid.",
|
|
53
39
|
"value": {
|
|
54
40
|
"kind": "expression"
|
|
55
41
|
}
|
|
56
42
|
},
|
|
57
43
|
{
|
|
58
|
-
"name": "?
|
|
59
|
-
"description": "
|
|
44
|
+
"name": "?required",
|
|
45
|
+
"description": "Specifies that the user must fill in a value.",
|
|
60
46
|
"value": {
|
|
61
47
|
"kind": "expression"
|
|
62
48
|
}
|
|
63
49
|
},
|
|
64
50
|
{
|
|
65
|
-
"name": "?
|
|
66
|
-
"description": "
|
|
51
|
+
"name": "?clearButtonVisible",
|
|
52
|
+
"description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
|
|
67
53
|
"value": {
|
|
68
54
|
"kind": "expression"
|
|
69
55
|
}
|
|
70
56
|
},
|
|
71
57
|
{
|
|
72
|
-
"name": "
|
|
73
|
-
"description": "
|
|
58
|
+
"name": "?autoselect",
|
|
59
|
+
"description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
|
|
74
60
|
"value": {
|
|
75
61
|
"kind": "expression"
|
|
76
62
|
}
|
|
77
63
|
},
|
|
78
64
|
{
|
|
79
|
-
"name": "
|
|
80
|
-
"description": "
|
|
65
|
+
"name": "?readonly",
|
|
66
|
+
"description": "When present, it specifies that the field is read-only.",
|
|
81
67
|
"value": {
|
|
82
68
|
"kind": "expression"
|
|
83
69
|
}
|
|
@@ -103,6 +89,13 @@
|
|
|
103
89
|
"kind": "expression"
|
|
104
90
|
}
|
|
105
91
|
},
|
|
92
|
+
{
|
|
93
|
+
"name": ".value",
|
|
94
|
+
"description": "The value of the field.",
|
|
95
|
+
"value": {
|
|
96
|
+
"kind": "expression"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
106
99
|
{
|
|
107
100
|
"name": ".allowedCharPattern",
|
|
108
101
|
"description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
|
|
@@ -166,6 +159,13 @@
|
|
|
166
159
|
"kind": "expression"
|
|
167
160
|
}
|
|
168
161
|
},
|
|
162
|
+
{
|
|
163
|
+
"name": ".pattern",
|
|
164
|
+
"description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
|
|
165
|
+
"value": {
|
|
166
|
+
"kind": "expression"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
169
|
{
|
|
170
170
|
"name": "@validated",
|
|
171
171
|
"description": "Fired whenever the field is validated.",
|
|
@@ -188,15 +188,15 @@
|
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
|
-
"name": "@
|
|
192
|
-
"description": "Fired when the `
|
|
191
|
+
"name": "@invalid-changed",
|
|
192
|
+
"description": "Fired when the `invalid` property changes.",
|
|
193
193
|
"value": {
|
|
194
194
|
"kind": "expression"
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
|
-
"name": "@
|
|
199
|
-
"description": "Fired when the `
|
|
198
|
+
"name": "@value-changed",
|
|
199
|
+
"description": "Fired when the `value` property changes.",
|
|
200
200
|
"value": {
|
|
201
201
|
"kind": "expression"
|
|
202
202
|
}
|