@vaadin/text-field 24.4.0-dev.b3e1d14600 → 24.5.0-alpha1

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/README.md CHANGED
@@ -5,7 +5,6 @@ A web component that allows the user to input and edit text.
5
5
  [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/text-field)
6
6
 
7
7
  [![npm version](https://badgen.net/npm/v/@vaadin/text-field)](https://www.npmjs.com/package/@vaadin/text-field)
8
- [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
9
8
 
10
9
  ```html
11
10
  <vaadin-text-field label="Street Address"></vaadin-text-field>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/text-field",
3
- "version": "24.4.0-dev.b3e1d14600",
3
+ "version": "24.5.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,13 +36,13 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/a11y-base": "24.4.0-dev.b3e1d14600",
40
- "@vaadin/component-base": "24.4.0-dev.b3e1d14600",
41
- "@vaadin/field-base": "24.4.0-dev.b3e1d14600",
42
- "@vaadin/input-container": "24.4.0-dev.b3e1d14600",
43
- "@vaadin/vaadin-lumo-styles": "24.4.0-dev.b3e1d14600",
44
- "@vaadin/vaadin-material-styles": "24.4.0-dev.b3e1d14600",
45
- "@vaadin/vaadin-themable-mixin": "24.4.0-dev.b3e1d14600",
39
+ "@vaadin/a11y-base": "24.5.0-alpha1",
40
+ "@vaadin/component-base": "24.5.0-alpha1",
41
+ "@vaadin/field-base": "24.5.0-alpha1",
42
+ "@vaadin/input-container": "24.5.0-alpha1",
43
+ "@vaadin/vaadin-lumo-styles": "24.5.0-alpha1",
44
+ "@vaadin/vaadin-material-styles": "24.5.0-alpha1",
45
+ "@vaadin/vaadin-themable-mixin": "24.5.0-alpha1",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "502d4f5b03f770a83d270d98078cde230254dd0e"
57
+ "gitHead": "57806caac5468532a3b4e3dbdda730cd0fca193a"
58
58
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2021 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  export * from './vaadin-text-field.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2021 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/input-container/src/vaadin-lit-input-container.js';
7
- import { css, html, LitElement } from 'lit';
7
+ import { html, LitElement } from 'lit';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
10
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
@@ -18,7 +18,7 @@ import { TextFieldMixin } from './vaadin-text-field-mixin.js';
18
18
  *
19
19
  * ## Disclaimer
20
20
  *
21
- * This component is an experiment not intended for publishing to npm.
21
+ * This component is an experiment and not yet a part of Vaadin platform.
22
22
  * There is no ETA regarding specific Vaadin version where it'll land.
23
23
  * Feel free to try this code in your apps as per Apache 2.0 license.
24
24
  */
@@ -28,14 +28,7 @@ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(Polylit
28
28
  }
29
29
 
30
30
  static get styles() {
31
- return [
32
- inputFieldShared,
33
- css`
34
- [part='input-field'] {
35
- flex-grow: 0;
36
- }
37
- `,
38
- ];
31
+ return [inputFieldShared];
39
32
  }
40
33
 
41
34
  /** @protected */
@@ -56,8 +49,7 @@ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(Polylit
56
49
  >
57
50
  <slot name="prefix" slot="prefix"></slot>
58
51
  <slot name="input"></slot>
59
- <slot name="suffix" slot="suffix"></slot>
60
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
52
+ ${this._renderSuffix()}
61
53
  </vaadin-input-container>
62
54
 
63
55
  <div part="helper-text">
@@ -82,6 +74,14 @@ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(Polylit
82
74
  this._tooltipController.setAriaTarget(this.inputElement);
83
75
  this.addController(this._tooltipController);
84
76
  }
77
+
78
+ /** @protected */
79
+ _renderSuffix() {
80
+ return html`
81
+ <slot name="suffix" slot="suffix"></slot>
82
+ <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
83
+ `;
84
+ }
85
85
  }
86
86
 
87
87
  defineCustomElement(TextField);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2021 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2021 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { InputController } from '@vaadin/field-base/src/input-controller.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
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';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/input-container/src/vaadin-input-container.js';
@@ -90,12 +90,6 @@ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(Polymer
90
90
 
91
91
  static get template() {
92
92
  return html`
93
- <style>
94
- [part='input-field'] {
95
- flex-grow: 0;
96
- }
97
- </style>
98
-
99
93
  <div class="vaadin-field-container">
100
94
  <div part="label">
101
95
  <slot name="label"></slot>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './vaadin-text-field-styles.js';
7
+ import '../../src/vaadin-lit-text-field.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-text-field-styles.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2024 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/theme/lumo/vaadin-input-container-styles.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './vaadin-text-field-styles.js';
7
+ import '../../src/vaadin-text-field.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-text-field-styles.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './vaadin-text-field-styles.js';
7
+ import '../../src/vaadin-lit-text-field.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-text-field-styles.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2024 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/theme/material/vaadin-input-container-styles.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/input-container/theme/material/vaadin-input-container-styles.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './vaadin-text-field-styles.js';
7
+ import '../../src/vaadin-text-field.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-text-field-styles.js';
package/web-types.json ADDED
@@ -0,0 +1,561 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/text-field",
4
+ "version": "24.5.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-text-field",
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/styling-components) documentation.",
12
+ "attributes": [
13
+ {
14
+ "name": "disabled",
15
+ "description": "If true, the user cannot interact with this element.",
16
+ "value": {
17
+ "type": [
18
+ "boolean",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "autofocus",
26
+ "description": "Specify that this control should have input focus when the page loads.",
27
+ "value": {
28
+ "type": [
29
+ "boolean",
30
+ "null",
31
+ "undefined"
32
+ ]
33
+ }
34
+ },
35
+ {
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
+ "value": {
39
+ "type": [
40
+ "string",
41
+ "null",
42
+ "undefined"
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "name": "invalid",
48
+ "description": "Set to true when the field is invalid.",
49
+ "value": {
50
+ "type": [
51
+ "boolean",
52
+ "null",
53
+ "undefined"
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "name": "required",
59
+ "description": "Specifies that the user must fill in a value.",
60
+ "value": {
61
+ "type": [
62
+ "boolean",
63
+ "null",
64
+ "undefined"
65
+ ]
66
+ }
67
+ },
68
+ {
69
+ "name": "error-message",
70
+ "description": "Error to show when the field is invalid.",
71
+ "value": {
72
+ "type": [
73
+ "string",
74
+ "null",
75
+ "undefined"
76
+ ]
77
+ }
78
+ },
79
+ {
80
+ "name": "helper-text",
81
+ "description": "String used for the helper text.",
82
+ "value": {
83
+ "type": [
84
+ "string",
85
+ "null",
86
+ "undefined"
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "name": "accessible-name",
92
+ "description": "String used to label the component to screen reader users.",
93
+ "value": {
94
+ "type": [
95
+ "string",
96
+ "null",
97
+ "undefined"
98
+ ]
99
+ }
100
+ },
101
+ {
102
+ "name": "accessible-name-ref",
103
+ "description": "Id of the element used as label of the component to screen reader users.",
104
+ "value": {
105
+ "type": [
106
+ "string",
107
+ "null",
108
+ "undefined"
109
+ ]
110
+ }
111
+ },
112
+ {
113
+ "name": "value",
114
+ "description": "The value of the field.",
115
+ "value": {
116
+ "type": [
117
+ "string",
118
+ "null",
119
+ "undefined"
120
+ ]
121
+ }
122
+ },
123
+ {
124
+ "name": "clear-button-visible",
125
+ "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.",
126
+ "value": {
127
+ "type": [
128
+ "boolean",
129
+ "null",
130
+ "undefined"
131
+ ]
132
+ }
133
+ },
134
+ {
135
+ "name": "allowed-char-pattern",
136
+ "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-]\"`",
137
+ "value": {
138
+ "type": [
139
+ "string",
140
+ "null",
141
+ "undefined"
142
+ ]
143
+ }
144
+ },
145
+ {
146
+ "name": "autoselect",
147
+ "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
148
+ "value": {
149
+ "type": [
150
+ "boolean",
151
+ "null",
152
+ "undefined"
153
+ ]
154
+ }
155
+ },
156
+ {
157
+ "name": "name",
158
+ "description": "The name of this field.",
159
+ "value": {
160
+ "type": [
161
+ "string",
162
+ "null",
163
+ "undefined"
164
+ ]
165
+ }
166
+ },
167
+ {
168
+ "name": "placeholder",
169
+ "description": "A hint to the user of what can be entered in the field.",
170
+ "value": {
171
+ "type": [
172
+ "string",
173
+ "null",
174
+ "undefined"
175
+ ]
176
+ }
177
+ },
178
+ {
179
+ "name": "readonly",
180
+ "description": "When present, it specifies that the field is read-only.",
181
+ "value": {
182
+ "type": [
183
+ "boolean",
184
+ "null",
185
+ "undefined"
186
+ ]
187
+ }
188
+ },
189
+ {
190
+ "name": "title",
191
+ "description": "The text usually displayed in a tooltip popup when the mouse is over the field.",
192
+ "value": {
193
+ "type": [
194
+ "string",
195
+ "null",
196
+ "undefined"
197
+ ]
198
+ }
199
+ },
200
+ {
201
+ "name": "autocomplete",
202
+ "description": "Whether the value of the control can be automatically completed by the browser.\nList of available options at:\nhttps://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete",
203
+ "value": {
204
+ "type": [
205
+ "string",
206
+ "null",
207
+ "undefined"
208
+ ]
209
+ }
210
+ },
211
+ {
212
+ "name": "autocorrect",
213
+ "description": "This is a property supported by Safari that is used to control whether\nautocorrection should be enabled when the user is entering/editing the text.\nPossible values are:\non: Enable autocorrection.\noff: Disable autocorrection.",
214
+ "value": {
215
+ "type": [
216
+ "string",
217
+ "null",
218
+ "undefined"
219
+ ]
220
+ }
221
+ },
222
+ {
223
+ "name": "autocapitalize",
224
+ "description": "This is a property supported by Safari and Chrome that is used to control whether\nautocapitalization should be enabled when the user is entering/editing the text.\nPossible values are:\ncharacters: Characters capitalization.\nwords: Words capitalization.\nsentences: Sentences capitalization.\nnone: No capitalization.",
225
+ "value": {
226
+ "type": [
227
+ "string",
228
+ "null",
229
+ "undefined"
230
+ ]
231
+ }
232
+ },
233
+ {
234
+ "name": "maxlength",
235
+ "description": "Maximum number of characters (in Unicode code points) that the user can enter.",
236
+ "value": {
237
+ "type": [
238
+ "number",
239
+ "null",
240
+ "undefined"
241
+ ]
242
+ }
243
+ },
244
+ {
245
+ "name": "minlength",
246
+ "description": "Minimum number of characters (in Unicode code points) that the user can enter.",
247
+ "value": {
248
+ "type": [
249
+ "number",
250
+ "null",
251
+ "undefined"
252
+ ]
253
+ }
254
+ },
255
+ {
256
+ "name": "pattern",
257
+ "description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
258
+ "value": {
259
+ "type": [
260
+ "string",
261
+ "null",
262
+ "undefined"
263
+ ]
264
+ }
265
+ },
266
+ {
267
+ "name": "theme",
268
+ "description": "The theme variants to apply to the component.",
269
+ "value": {
270
+ "type": [
271
+ "string",
272
+ "null",
273
+ "undefined"
274
+ ]
275
+ }
276
+ }
277
+ ],
278
+ "js": {
279
+ "properties": [
280
+ {
281
+ "name": "disabled",
282
+ "description": "If true, the user cannot interact with this element.",
283
+ "value": {
284
+ "type": [
285
+ "boolean",
286
+ "null",
287
+ "undefined"
288
+ ]
289
+ }
290
+ },
291
+ {
292
+ "name": "autofocus",
293
+ "description": "Specify that this control should have input focus when the page loads.",
294
+ "value": {
295
+ "type": [
296
+ "boolean",
297
+ "null",
298
+ "undefined"
299
+ ]
300
+ }
301
+ },
302
+ {
303
+ "name": "label",
304
+ "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
305
+ "value": {
306
+ "type": [
307
+ "string",
308
+ "null",
309
+ "undefined"
310
+ ]
311
+ }
312
+ },
313
+ {
314
+ "name": "invalid",
315
+ "description": "Set to true when the field is invalid.",
316
+ "value": {
317
+ "type": [
318
+ "boolean",
319
+ "null",
320
+ "undefined"
321
+ ]
322
+ }
323
+ },
324
+ {
325
+ "name": "required",
326
+ "description": "Specifies that the user must fill in a value.",
327
+ "value": {
328
+ "type": [
329
+ "boolean",
330
+ "null",
331
+ "undefined"
332
+ ]
333
+ }
334
+ },
335
+ {
336
+ "name": "errorMessage",
337
+ "description": "Error to show when the field is invalid.",
338
+ "value": {
339
+ "type": [
340
+ "string",
341
+ "null",
342
+ "undefined"
343
+ ]
344
+ }
345
+ },
346
+ {
347
+ "name": "helperText",
348
+ "description": "String used for the helper text.",
349
+ "value": {
350
+ "type": [
351
+ "string",
352
+ "null",
353
+ "undefined"
354
+ ]
355
+ }
356
+ },
357
+ {
358
+ "name": "accessibleName",
359
+ "description": "String used to label the component to screen reader users.",
360
+ "value": {
361
+ "type": [
362
+ "string",
363
+ "null",
364
+ "undefined"
365
+ ]
366
+ }
367
+ },
368
+ {
369
+ "name": "accessibleNameRef",
370
+ "description": "Id of the element used as label of the component to screen reader users.",
371
+ "value": {
372
+ "type": [
373
+ "string",
374
+ "null",
375
+ "undefined"
376
+ ]
377
+ }
378
+ },
379
+ {
380
+ "name": "value",
381
+ "description": "The value of the field.",
382
+ "value": {
383
+ "type": [
384
+ "string",
385
+ "null",
386
+ "undefined"
387
+ ]
388
+ }
389
+ },
390
+ {
391
+ "name": "clearButtonVisible",
392
+ "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.",
393
+ "value": {
394
+ "type": [
395
+ "boolean",
396
+ "null",
397
+ "undefined"
398
+ ]
399
+ }
400
+ },
401
+ {
402
+ "name": "allowedCharPattern",
403
+ "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-]\"`",
404
+ "value": {
405
+ "type": [
406
+ "string",
407
+ "null",
408
+ "undefined"
409
+ ]
410
+ }
411
+ },
412
+ {
413
+ "name": "autoselect",
414
+ "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
415
+ "value": {
416
+ "type": [
417
+ "boolean",
418
+ "null",
419
+ "undefined"
420
+ ]
421
+ }
422
+ },
423
+ {
424
+ "name": "name",
425
+ "description": "The name of this field.",
426
+ "value": {
427
+ "type": [
428
+ "string",
429
+ "null",
430
+ "undefined"
431
+ ]
432
+ }
433
+ },
434
+ {
435
+ "name": "placeholder",
436
+ "description": "A hint to the user of what can be entered in the field.",
437
+ "value": {
438
+ "type": [
439
+ "string",
440
+ "null",
441
+ "undefined"
442
+ ]
443
+ }
444
+ },
445
+ {
446
+ "name": "readonly",
447
+ "description": "When present, it specifies that the field is read-only.",
448
+ "value": {
449
+ "type": [
450
+ "boolean",
451
+ "null",
452
+ "undefined"
453
+ ]
454
+ }
455
+ },
456
+ {
457
+ "name": "title",
458
+ "description": "The text usually displayed in a tooltip popup when the mouse is over the field.",
459
+ "value": {
460
+ "type": [
461
+ "string",
462
+ "null",
463
+ "undefined"
464
+ ]
465
+ }
466
+ },
467
+ {
468
+ "name": "autocomplete",
469
+ "description": "Whether the value of the control can be automatically completed by the browser.\nList of available options at:\nhttps://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete",
470
+ "value": {
471
+ "type": [
472
+ "string",
473
+ "null",
474
+ "undefined"
475
+ ]
476
+ }
477
+ },
478
+ {
479
+ "name": "autocorrect",
480
+ "description": "This is a property supported by Safari that is used to control whether\nautocorrection should be enabled when the user is entering/editing the text.\nPossible values are:\non: Enable autocorrection.\noff: Disable autocorrection.",
481
+ "value": {
482
+ "type": [
483
+ "string",
484
+ "null",
485
+ "undefined"
486
+ ]
487
+ }
488
+ },
489
+ {
490
+ "name": "autocapitalize",
491
+ "description": "This is a property supported by Safari and Chrome that is used to control whether\nautocapitalization should be enabled when the user is entering/editing the text.\nPossible values are:\ncharacters: Characters capitalization.\nwords: Words capitalization.\nsentences: Sentences capitalization.\nnone: No capitalization.",
492
+ "value": {
493
+ "type": [
494
+ "string",
495
+ "null",
496
+ "undefined"
497
+ ]
498
+ }
499
+ },
500
+ {
501
+ "name": "maxlength",
502
+ "description": "Maximum number of characters (in Unicode code points) that the user can enter.",
503
+ "value": {
504
+ "type": [
505
+ "number",
506
+ "null",
507
+ "undefined"
508
+ ]
509
+ }
510
+ },
511
+ {
512
+ "name": "minlength",
513
+ "description": "Minimum number of characters (in Unicode code points) that the user can enter.",
514
+ "value": {
515
+ "type": [
516
+ "number",
517
+ "null",
518
+ "undefined"
519
+ ]
520
+ }
521
+ },
522
+ {
523
+ "name": "pattern",
524
+ "description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
525
+ "value": {
526
+ "type": [
527
+ "string",
528
+ "null",
529
+ "undefined"
530
+ ]
531
+ }
532
+ }
533
+ ],
534
+ "events": [
535
+ {
536
+ "name": "validated",
537
+ "description": "Fired whenever the field is validated."
538
+ },
539
+ {
540
+ "name": "change",
541
+ "description": "Fired when the user commits a value change."
542
+ },
543
+ {
544
+ "name": "input",
545
+ "description": "Fired when the value is changed by the user: on every typing keystroke,\nand the value is cleared using the clear button."
546
+ },
547
+ {
548
+ "name": "invalid-changed",
549
+ "description": "Fired when the `invalid` property changes."
550
+ },
551
+ {
552
+ "name": "value-changed",
553
+ "description": "Fired when the `value` property changes."
554
+ }
555
+ ]
556
+ }
557
+ }
558
+ ]
559
+ }
560
+ }
561
+ }
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/text-field",
4
+ "version": "24.5.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
18
+ "name": "vaadin-text-field",
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/styling-components) documentation.",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": "?disabled",
24
+ "description": "If true, the user cannot interact with this element.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": "?autofocus",
31
+ "description": "Specify that this control should have input focus when the page loads.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "?invalid",
38
+ "description": "Set to true when the field is invalid.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": "?required",
45
+ "description": "Specifies that the user must fill in a value.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
50
+ {
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.",
53
+ "value": {
54
+ "kind": "expression"
55
+ }
56
+ },
57
+ {
58
+ "name": "?autoselect",
59
+ "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
60
+ "value": {
61
+ "kind": "expression"
62
+ }
63
+ },
64
+ {
65
+ "name": "?readonly",
66
+ "description": "When present, it specifies that the field is read-only.",
67
+ "value": {
68
+ "kind": "expression"
69
+ }
70
+ },
71
+ {
72
+ "name": ".label",
73
+ "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
74
+ "value": {
75
+ "kind": "expression"
76
+ }
77
+ },
78
+ {
79
+ "name": ".errorMessage",
80
+ "description": "Error to show when the field is invalid.",
81
+ "value": {
82
+ "kind": "expression"
83
+ }
84
+ },
85
+ {
86
+ "name": ".helperText",
87
+ "description": "String used for the helper text.",
88
+ "value": {
89
+ "kind": "expression"
90
+ }
91
+ },
92
+ {
93
+ "name": ".accessibleName",
94
+ "description": "String used to label the component to screen reader users.",
95
+ "value": {
96
+ "kind": "expression"
97
+ }
98
+ },
99
+ {
100
+ "name": ".accessibleNameRef",
101
+ "description": "Id of the element used as label of the component to screen reader users.",
102
+ "value": {
103
+ "kind": "expression"
104
+ }
105
+ },
106
+ {
107
+ "name": ".value",
108
+ "description": "The value of the field.",
109
+ "value": {
110
+ "kind": "expression"
111
+ }
112
+ },
113
+ {
114
+ "name": ".allowedCharPattern",
115
+ "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-]\"`",
116
+ "value": {
117
+ "kind": "expression"
118
+ }
119
+ },
120
+ {
121
+ "name": ".name",
122
+ "description": "The name of this field.",
123
+ "value": {
124
+ "kind": "expression"
125
+ }
126
+ },
127
+ {
128
+ "name": ".placeholder",
129
+ "description": "A hint to the user of what can be entered in the field.",
130
+ "value": {
131
+ "kind": "expression"
132
+ }
133
+ },
134
+ {
135
+ "name": ".title",
136
+ "description": "The text usually displayed in a tooltip popup when the mouse is over the field.",
137
+ "value": {
138
+ "kind": "expression"
139
+ }
140
+ },
141
+ {
142
+ "name": ".autocomplete",
143
+ "description": "Whether the value of the control can be automatically completed by the browser.\nList of available options at:\nhttps://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete",
144
+ "value": {
145
+ "kind": "expression"
146
+ }
147
+ },
148
+ {
149
+ "name": ".autocorrect",
150
+ "description": "This is a property supported by Safari that is used to control whether\nautocorrection should be enabled when the user is entering/editing the text.\nPossible values are:\non: Enable autocorrection.\noff: Disable autocorrection.",
151
+ "value": {
152
+ "kind": "expression"
153
+ }
154
+ },
155
+ {
156
+ "name": ".autocapitalize",
157
+ "description": "This is a property supported by Safari and Chrome that is used to control whether\nautocapitalization should be enabled when the user is entering/editing the text.\nPossible values are:\ncharacters: Characters capitalization.\nwords: Words capitalization.\nsentences: Sentences capitalization.\nnone: No capitalization.",
158
+ "value": {
159
+ "kind": "expression"
160
+ }
161
+ },
162
+ {
163
+ "name": ".maxlength",
164
+ "description": "Maximum number of characters (in Unicode code points) that the user can enter.",
165
+ "value": {
166
+ "kind": "expression"
167
+ }
168
+ },
169
+ {
170
+ "name": ".minlength",
171
+ "description": "Minimum number of characters (in Unicode code points) that the user can enter.",
172
+ "value": {
173
+ "kind": "expression"
174
+ }
175
+ },
176
+ {
177
+ "name": ".pattern",
178
+ "description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
179
+ "value": {
180
+ "kind": "expression"
181
+ }
182
+ },
183
+ {
184
+ "name": "@validated",
185
+ "description": "Fired whenever the field is validated.",
186
+ "value": {
187
+ "kind": "expression"
188
+ }
189
+ },
190
+ {
191
+ "name": "@change",
192
+ "description": "Fired when the user commits a value change.",
193
+ "value": {
194
+ "kind": "expression"
195
+ }
196
+ },
197
+ {
198
+ "name": "@input",
199
+ "description": "Fired when the value is changed by the user: on every typing keystroke,\nand the value is cleared using the clear button.",
200
+ "value": {
201
+ "kind": "expression"
202
+ }
203
+ },
204
+ {
205
+ "name": "@invalid-changed",
206
+ "description": "Fired when the `invalid` property changes.",
207
+ "value": {
208
+ "kind": "expression"
209
+ }
210
+ },
211
+ {
212
+ "name": "@value-changed",
213
+ "description": "Fired when the `value` property changes.",
214
+ "value": {
215
+ "kind": "expression"
216
+ }
217
+ }
218
+ ]
219
+ }
220
+ ]
221
+ }
222
+ }
223
+ }