@vaadin/text-area 22.0.0-alpha9 → 22.0.0
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
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
An input field component for multi-line text input.
|
|
4
4
|
|
|
5
|
-
[Live Demo ↗](https://vaadin.com/docs/latest/ds/components/text-area)
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/text-area)
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@vaadin/text-area)
|
|
8
|
+
[](https://discord.gg/PHmkCKC)
|
|
6
9
|
|
|
7
10
|
```html
|
|
8
11
|
<vaadin-text-area label="Comment"></vaadin-text-area>
|
|
@@ -13,7 +16,7 @@ An input field component for multi-line text input.
|
|
|
13
16
|
Install the component:
|
|
14
17
|
|
|
15
18
|
```sh
|
|
16
|
-
npm i @vaadin/text-area
|
|
19
|
+
npm i @vaadin/text-area
|
|
17
20
|
```
|
|
18
21
|
|
|
19
22
|
Once installed, import the component in your application:
|
|
@@ -24,9 +27,8 @@ import '@vaadin/text-area';
|
|
|
24
27
|
|
|
25
28
|
## Themes
|
|
26
29
|
|
|
27
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes),
|
|
28
|
-
|
|
29
|
-
of the package uses Lumo theme.
|
|
30
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
31
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/text-area/vaadin-text-area.js) of the package uses Lumo theme.
|
|
30
32
|
|
|
31
33
|
To use the Material theme, import the component from the `theme/material` folder:
|
|
32
34
|
|
|
@@ -46,9 +48,13 @@ Finally, you can import the un-themed component from the `src` folder to get a m
|
|
|
46
48
|
import '@vaadin/text-area/src/vaadin-text-area.js';
|
|
47
49
|
```
|
|
48
50
|
|
|
51
|
+
## Contributing
|
|
52
|
+
|
|
53
|
+
Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
|
54
|
+
|
|
49
55
|
## License
|
|
50
56
|
|
|
51
57
|
Apache License 2.0
|
|
52
58
|
|
|
53
|
-
Vaadin collects development time
|
|
59
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
54
60
|
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/text-area",
|
|
3
|
-
"version": "22.0.0
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@polymer/polymer": "^3.0.0",
|
|
35
|
-
"@vaadin/component-base": "22.0.0
|
|
36
|
-
"@vaadin/field-base": "22.0.0
|
|
37
|
-
"@vaadin/input-container": "22.0.0
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0
|
|
39
|
-
"@vaadin/vaadin-material-styles": "22.0.0
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0
|
|
35
|
+
"@vaadin/component-base": "^22.0.0",
|
|
36
|
+
"@vaadin/field-base": "^22.0.0",
|
|
37
|
+
"@vaadin/input-container": "^22.0.0",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.0",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "^22.0.0",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
44
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
45
45
|
"sinon": "^9.2.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
|
|
48
48
|
}
|
|
@@ -56,26 +56,8 @@ export interface TextAreaEventMap extends HTMLElementEventMap, TextAreaCustomEve
|
|
|
56
56
|
*
|
|
57
57
|
* The following shadow DOM parts are available for styling:
|
|
58
58
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* `label` | The label element wrapper
|
|
62
|
-
* `input-field` | The element that wraps prefix, textarea and suffix
|
|
63
|
-
* `error-message` | The error message element wrapper
|
|
64
|
-
* `helper-text` | The helper text element wrapper
|
|
65
|
-
*
|
|
66
|
-
* The following state attributes are available for styling:
|
|
67
|
-
*
|
|
68
|
-
* Attribute | Description | Part name
|
|
69
|
-
* --------------------|-------------------------------------------|----------
|
|
70
|
-
* `disabled` | Set when the element is disabled | :host
|
|
71
|
-
* `has-value` | Set when the element has a value | :host
|
|
72
|
-
* `has-label` | Set when the element has a label | :host
|
|
73
|
-
* `has-helper` | Set when the element has helper text | :host
|
|
74
|
-
* `has-error-message` | Set when the element has an error message | :host
|
|
75
|
-
* `invalid` | Set when the element is invalid | :host
|
|
76
|
-
* `focused` | Set when the element is focused | :host
|
|
77
|
-
* `focus-ring` | Set when the element is keyboard focused | :host
|
|
78
|
-
* `readonly` | Set when the element is readonly | :host
|
|
59
|
+
* `<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
|
|
60
|
+
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
79
61
|
*
|
|
80
62
|
* See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
|
|
81
63
|
*
|
package/src/vaadin-text-area.js
CHANGED
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import '@vaadin/input-container/src/vaadin-input-container.js';
|
|
7
|
+
import { html, PolymerElement } from '@polymer/polymer';
|
|
7
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
|
-
import { AriaLabelController } from '@vaadin/field-base/src/aria-label-controller.js';
|
|
9
9
|
import { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';
|
|
10
|
-
import {
|
|
10
|
+
import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
|
|
11
11
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
12
|
-
import {
|
|
13
|
-
import { registerStyles } from '@vaadin/vaadin-themable-mixin/
|
|
14
|
-
import '@vaadin/input-container/src/vaadin-input-container.js';
|
|
12
|
+
import { TextAreaController } from '@vaadin/field-base/src/text-area-controller.js';
|
|
13
|
+
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
14
|
|
|
16
15
|
registerStyles('vaadin-text-area', inputFieldShared, { moduleId: 'vaadin-text-area-styles' });
|
|
17
16
|
|
|
@@ -44,28 +43,8 @@ registerStyles('vaadin-text-area', inputFieldShared, { moduleId: 'vaadin-text-ar
|
|
|
44
43
|
* -------------------------------|----------------------------|---------
|
|
45
44
|
* `--vaadin-field-default-width` | Default width of the field | `12em`
|
|
46
45
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* Part name | Description
|
|
50
|
-
* ----------------|----------------
|
|
51
|
-
* `label` | The label element wrapper
|
|
52
|
-
* `input-field` | The element that wraps prefix, textarea and suffix
|
|
53
|
-
* `error-message` | The error message element wrapper
|
|
54
|
-
* `helper-text` | The helper text element wrapper
|
|
55
|
-
*
|
|
56
|
-
* The following state attributes are available for styling:
|
|
57
|
-
*
|
|
58
|
-
* Attribute | Description | Part name
|
|
59
|
-
* --------------------|-------------------------------------------|----------
|
|
60
|
-
* `disabled` | Set when the element is disabled | :host
|
|
61
|
-
* `has-value` | Set when the element has a value | :host
|
|
62
|
-
* `has-label` | Set when the element has a label | :host
|
|
63
|
-
* `has-helper` | Set when the element has helper text | :host
|
|
64
|
-
* `has-error-message` | Set when the element has an error message | :host
|
|
65
|
-
* `invalid` | Set when the element is invalid | :host
|
|
66
|
-
* `focused` | Set when the element is focused | :host
|
|
67
|
-
* `focus-ring` | Set when the element is keyboard focused | :host
|
|
68
|
-
* `readonly` | Set when the element is readonly | :host
|
|
46
|
+
* `<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
|
|
47
|
+
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
69
48
|
*
|
|
70
49
|
* See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
|
|
71
50
|
*
|
|
@@ -135,6 +114,11 @@ export class TextArea extends InputFieldMixin(ThemableMixin(ElementMixin(Polymer
|
|
|
135
114
|
align-self: flex-start;
|
|
136
115
|
}
|
|
137
116
|
|
|
117
|
+
/* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
|
|
118
|
+
:host([disabled]) ::slotted(textarea) {
|
|
119
|
+
user-select: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
138
122
|
@keyframes vaadin-text-area-appear {
|
|
139
123
|
to {
|
|
140
124
|
opacity: 1;
|
|
@@ -226,7 +210,7 @@ export class TextArea extends InputFieldMixin(ThemableMixin(ElementMixin(Polymer
|
|
|
226
210
|
this.ariaTarget = input;
|
|
227
211
|
})
|
|
228
212
|
);
|
|
229
|
-
this.addController(new
|
|
213
|
+
this.addController(new LabelledInputController(this.inputElement, this._labelNode));
|
|
230
214
|
this.addEventListener('animationend', this._onAnimationEnd);
|
|
231
215
|
}
|
|
232
216
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
7
6
|
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
8
7
|
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
9
8
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
10
9
|
import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
|
|
10
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
11
|
|
|
12
12
|
const textArea = css`
|
|
13
13
|
[part='input-field'],
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
7
6
|
import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
|
|
7
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
8
|
|
|
9
9
|
const textArea = css`
|
|
10
10
|
[part='input-field'] {
|