@vaadin/text-area 24.8.0-alpha9 → 25.0.0-alpha2
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 +0 -23
- package/package.json +13 -13
- package/src/vaadin-text-area-base-styles.js +32 -0
- package/src/{vaadin-lit-text-area.d.ts → vaadin-text-area-core-styles.d.ts} +3 -1
- package/src/vaadin-text-area-mixin.d.ts +0 -2
- package/src/vaadin-text-area-mixin.js +2 -0
- package/src/vaadin-text-area.js +18 -13
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-text-area.js +0 -83
- package/theme/lumo/vaadin-lit-text-area.d.ts +0 -2
- package/theme/lumo/vaadin-lit-text-area.js +0 -2
- package/theme/material/vaadin-lit-text-area.d.ts +0 -2
- package/theme/material/vaadin-lit-text-area.js +0 -2
- package/theme/material/vaadin-text-area-styles.d.ts +0 -6
- package/theme/material/vaadin-text-area-styles.js +0 -42
- package/theme/material/vaadin-text-area.d.ts +0 -7
- package/theme/material/vaadin-text-area.js +0 -7
- package/vaadin-lit-text-area.d.ts +0 -1
- package/vaadin-lit-text-area.js +0 -3
- /package/src/{vaadin-text-area-styles.d.ts → vaadin-text-area-base-styles.d.ts} +0 -0
- /package/src/{vaadin-text-area-styles.js → vaadin-text-area-core-styles.js} +0 -0
package/README.md
CHANGED
|
@@ -24,29 +24,6 @@ Once installed, import the component in your application:
|
|
|
24
24
|
import '@vaadin/text-area';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
## Themes
|
|
28
|
-
|
|
29
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
30
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/text-area/vaadin-text-area.js) of the package uses Lumo theme.
|
|
31
|
-
|
|
32
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
import '@vaadin/text-area/theme/material/vaadin-text-area.js';
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
You can also import the Lumo version of the component explicitly:
|
|
39
|
-
|
|
40
|
-
```js
|
|
41
|
-
import '@vaadin/text-area/theme/lumo/vaadin-text-area.js';
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
import '@vaadin/text-area/src/vaadin-text-area.js';
|
|
48
|
-
```
|
|
49
|
-
|
|
50
27
|
## Contributing
|
|
51
28
|
|
|
52
29
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/text-area",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha2",
|
|
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/*-base-styles.d.ts",
|
|
25
|
+
"!src/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -35,25 +37,23 @@
|
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@
|
|
39
|
-
"@vaadin/
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/vaadin-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "24.8.0-alpha9",
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha2",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha2",
|
|
42
|
+
"@vaadin/field-base": "25.0.0-alpha2",
|
|
43
|
+
"@vaadin/input-container": "25.0.0-alpha2",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "
|
|
50
|
-
"@vaadin/test-runner-commands": "
|
|
51
|
-
"@vaadin/testing-helpers": "^
|
|
49
|
+
"@vaadin/chai-plugins": "25.0.0-alpha2",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha2",
|
|
51
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
52
|
"sinon": "^18.0.0"
|
|
53
53
|
},
|
|
54
54
|
"web-types": [
|
|
55
55
|
"web-types.json",
|
|
56
56
|
"web-types.lit.json"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
|
|
59
59
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 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 textAreaStyles = css`
|
|
9
|
+
@layer base {
|
|
10
|
+
[part='input-field'] {
|
|
11
|
+
overflow: auto;
|
|
12
|
+
scroll-padding: var(--vaadin-input-field-padding, var(--_vaadin-padding-container));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
::slotted(textarea) {
|
|
16
|
+
resize: none;
|
|
17
|
+
white-space: pre-wrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[part='input-field'] ::slotted(:not(textarea)),
|
|
21
|
+
[part='clear-button'] {
|
|
22
|
+
align-self: flex-start;
|
|
23
|
+
position: sticky;
|
|
24
|
+
top: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
|
|
28
|
+
:host([disabled]) ::slotted(textarea) {
|
|
29
|
+
user-select: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 2025 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 { CSSResult } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const textAreaStyles: CSSResult;
|
|
@@ -8,7 +8,6 @@ import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-foc
|
|
|
8
8
|
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
9
9
|
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
10
10
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
11
|
-
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
12
11
|
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
13
12
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
14
13
|
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
@@ -27,7 +26,6 @@ import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.j
|
|
|
27
26
|
export declare function TextAreaMixin<T extends Constructor<HTMLElement>>(
|
|
28
27
|
base: T,
|
|
29
28
|
): Constructor<ClearButtonMixinClass> &
|
|
30
|
-
Constructor<ControllerMixinClass> &
|
|
31
29
|
Constructor<DelegateFocusMixinClass> &
|
|
32
30
|
Constructor<DelegateStateMixinClass> &
|
|
33
31
|
Constructor<DisabledMixinClass> &
|
|
@@ -235,6 +235,8 @@ export const TextAreaMixin = (superClass) =>
|
|
|
235
235
|
parseFloat(inputStyle.paddingBottom) +
|
|
236
236
|
parseFloat(inputStyle.marginTop) +
|
|
237
237
|
parseFloat(inputStyle.marginBottom) +
|
|
238
|
+
parseFloat(inputFieldStyle.borderTopWidth) +
|
|
239
|
+
parseFloat(inputFieldStyle.borderBottomWidth) +
|
|
238
240
|
parseFloat(inputFieldStyle.paddingTop) +
|
|
239
241
|
parseFloat(inputFieldStyle.paddingBottom);
|
|
240
242
|
const maxHeight = Math.ceil(contentHeight + marginsAndPaddings);
|
package/src/vaadin-text-area.js
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
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';
|
|
7
|
-
import { html,
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
12
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
11
13
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
12
|
-
import {
|
|
14
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
|
+
import { textAreaStyles } from './vaadin-text-area-core-styles.js';
|
|
13
16
|
import { TextAreaMixin } from './vaadin-text-area-mixin.js';
|
|
14
|
-
import { textAreaStyles } from './vaadin-text-area-styles.js';
|
|
15
|
-
|
|
16
|
-
registerStyles('vaadin-text-area', [inputFieldShared, textAreaStyles], { moduleId: 'vaadin-text-area-styles' });
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* `<vaadin-text-area>` is a web component for multi-line text input.
|
|
@@ -61,26 +61,31 @@ registerStyles('vaadin-text-area', [inputFieldShared, textAreaStyles], { moduleI
|
|
|
61
61
|
* @mixes TextAreaMixin
|
|
62
62
|
* @mixes ThemableMixin
|
|
63
63
|
*/
|
|
64
|
-
export class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(
|
|
64
|
+
export class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
65
65
|
static get is() {
|
|
66
66
|
return 'vaadin-text-area';
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
static get
|
|
69
|
+
static get styles() {
|
|
70
|
+
return [inputFieldShared, textAreaStyles];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** @protected */
|
|
74
|
+
render() {
|
|
70
75
|
return html`
|
|
71
76
|
<div class="vaadin-text-area-container">
|
|
72
77
|
<div part="label">
|
|
73
78
|
<slot name="label"></slot>
|
|
74
|
-
<span part="required-indicator" aria-hidden="true"
|
|
79
|
+
<span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
|
|
75
80
|
</div>
|
|
76
81
|
|
|
77
82
|
<vaadin-input-container
|
|
78
83
|
part="input-field"
|
|
79
|
-
readonly="
|
|
80
|
-
disabled="
|
|
81
|
-
invalid="
|
|
82
|
-
theme
|
|
83
|
-
|
|
84
|
+
.readonly="${this.readonly}"
|
|
85
|
+
.disabled="${this.disabled}"
|
|
86
|
+
.invalid="${this.invalid}"
|
|
87
|
+
theme="${ifDefined(this._theme)}"
|
|
88
|
+
@scroll="${this._onScroll}"
|
|
84
89
|
>
|
|
85
90
|
<slot name="prefix" slot="prefix"></slot>
|
|
86
91
|
<slot name="textarea"></slot>
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/text-area",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-text-area",
|
|
11
|
-
"description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` 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-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\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\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/
|
|
11
|
+
"description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` 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-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\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\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
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-area",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha2",
|
|
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-text-area",
|
|
19
|
-
"description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` 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-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\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\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/
|
|
19
|
+
"description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` 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-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\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\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 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 { html, LitElement } from 'lit';
|
|
8
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
-
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
13
|
-
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
14
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
|
-
import { TextAreaMixin } from './vaadin-text-area-mixin.js';
|
|
16
|
-
import { textAreaStyles } from './vaadin-text-area-styles.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* LitElement based version of `<vaadin-text-area>` web component.
|
|
20
|
-
*
|
|
21
|
-
* ## Disclaimer
|
|
22
|
-
*
|
|
23
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
24
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
25
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
26
|
-
*/
|
|
27
|
-
export class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
28
|
-
static get is() {
|
|
29
|
-
return 'vaadin-text-area';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static get styles() {
|
|
33
|
-
return [inputFieldShared, textAreaStyles];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** @protected */
|
|
37
|
-
render() {
|
|
38
|
-
return html`
|
|
39
|
-
<div class="vaadin-text-area-container">
|
|
40
|
-
<div part="label">
|
|
41
|
-
<slot name="label"></slot>
|
|
42
|
-
<span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<vaadin-input-container
|
|
46
|
-
part="input-field"
|
|
47
|
-
.readonly="${this.readonly}"
|
|
48
|
-
.disabled="${this.disabled}"
|
|
49
|
-
.invalid="${this.invalid}"
|
|
50
|
-
theme="${ifDefined(this._theme)}"
|
|
51
|
-
@scroll="${this._onScroll}"
|
|
52
|
-
>
|
|
53
|
-
<slot name="prefix" slot="prefix"></slot>
|
|
54
|
-
<slot name="textarea"></slot>
|
|
55
|
-
<slot name="suffix" slot="suffix"></slot>
|
|
56
|
-
<div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
|
|
57
|
-
</vaadin-input-container>
|
|
58
|
-
|
|
59
|
-
<div part="helper-text">
|
|
60
|
-
<slot name="helper"></slot>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div part="error-message">
|
|
64
|
-
<slot name="error-message"></slot>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<slot name="tooltip"></slot>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** @protected */
|
|
73
|
-
ready() {
|
|
74
|
-
super.ready();
|
|
75
|
-
|
|
76
|
-
this._tooltipController = new TooltipController(this);
|
|
77
|
-
this._tooltipController.setPosition('top');
|
|
78
|
-
this._tooltipController.setAriaTarget(this.inputElement);
|
|
79
|
-
this.addController(this._tooltipController);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
defineCustomElement(TextArea);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 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';
|
|
7
|
-
import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
|
|
8
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
-
|
|
10
|
-
const textArea = css`
|
|
11
|
-
[part='input-field'] {
|
|
12
|
-
height: auto;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[part='input-field'] ::slotted(textarea) {
|
|
17
|
-
padding-top: 0;
|
|
18
|
-
padding-bottom: 4px;
|
|
19
|
-
margin-top: 4px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[part='input-field']::before,
|
|
23
|
-
[part='input-field']::after {
|
|
24
|
-
bottom: calc(var(--_text-area-vertical-scroll-position) * -1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* Use sticky positioning to keep prefix/suffix/clear button visible when scrolling textarea container */
|
|
28
|
-
[part='input-field'] ::slotted([slot$='fix']),
|
|
29
|
-
[part='clear-button'] {
|
|
30
|
-
position: sticky;
|
|
31
|
-
top: 0;
|
|
32
|
-
align-self: flex-start;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* Align prefix/suffix icon or text with native textarea */
|
|
36
|
-
[part='input-field'] ::slotted([slot$='fix']) {
|
|
37
|
-
top: 4px;
|
|
38
|
-
margin-top: 4px;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
registerStyles('vaadin-text-area', [inputFieldShared, textArea], { moduleId: 'material-text-area' });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-text-area.js';
|
package/vaadin-lit-text-area.js
DELETED
|
File without changes
|
|
File without changes
|