-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: move text area to new package (#2353)
- Loading branch information
1 parent
5bfb9aa
commit 835ca67
Showing
66 changed files
with
586 additions
and
1,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,54 @@ | ||
# @vaadin/text-area | ||
|
||
> ⚠️ Work in progress, please do not use this component yet. | ||
An input field component for multi-line text input. | ||
|
||
The new version of `vaadin-text-area` component using slotted `<input>`. | ||
[Live Demo ↗](https://vaadin.com/docs/latest/ds/components/text-area) | ||
|
||
```html | ||
<vaadin-text-area label="Comment"></vaadin-text-area> | ||
``` | ||
|
||
## Installation | ||
|
||
Install the component: | ||
|
||
```sh | ||
npm i @vaadin/text-area --save | ||
``` | ||
|
||
Once installed, import the component in your application: | ||
|
||
```js | ||
import '@vaadin/text-area'; | ||
``` | ||
|
||
## Themes | ||
|
||
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), | ||
Lumo and Material. The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/text-area/vaadin-text-area.js) | ||
of the package uses Lumo theme. | ||
|
||
To use the Material theme, import the component from the `theme/material` folder: | ||
|
||
```js | ||
import '@vaadin/text-area/theme/material/vaadin-text-area.js'; | ||
``` | ||
|
||
You can also import the Lumo version of the component explicitly: | ||
|
||
```js | ||
import '@vaadin/text-area/theme/lumo/vaadin-text-area.js'; | ||
``` | ||
|
||
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point: | ||
|
||
```js | ||
import '@vaadin/text-area/src/vaadin-text-area.js'; | ||
``` | ||
|
||
## License | ||
|
||
Apache License 2.0 | ||
|
||
Vaadin collects development time usage statistics to improve this product. | ||
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import '../../vaadin-text-area.js'; | ||
import { TextAreaInvalidChangedEvent, TextAreaValueChangedEvent } from '../../vaadin-text-area.js'; | ||
|
||
const assertType = <TExpected>(actual: TExpected) => actual; | ||
|
||
const area = document.createElement('vaadin-text-area'); | ||
|
||
area.addEventListener('invalid-changed', (event) => { | ||
assertType<TextAreaInvalidChangedEvent>(event); | ||
assertType<boolean>(event.detail.value); | ||
}); | ||
|
||
area.addEventListener('value-changed', (event) => { | ||
assertType<TextAreaValueChangedEvent>(event); | ||
assertType<string>(event.detail.value); | ||
}); |
Binary file modified
BIN
-1 Byte
(100%)
...ages/text-area/test/visual/lumo/screenshots/text-area/baseline/clear-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
packages/text-area/test/visual/lumo/screenshots/text-area/baseline/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
packages/text-area/test/visual/lumo/screenshots/text-area/baseline/value.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { TextArea } from './src/vaadin-text-area.js'; | ||
export * from './src/vaadin-text-area.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import './theme/lumo/vaadin-text-area.js'; | ||
|
||
export { TextArea } from './src/vaadin-text-area.js'; | ||
export * from './src/vaadin-text-area.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/vaadin-messages/src/vaadin-message-input-text-area.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { TextAreaElement } from '@vaadin/vaadin-text-field/src/vaadin-text-area.js'; | ||
import { TextArea } from '@vaadin/text-area/src/vaadin-text-area.js'; | ||
|
||
/** | ||
* An element used internally by `<vaadin-message-input>`. Not intended to be used separately. | ||
* | ||
* @protected | ||
*/ | ||
declare class MessageInputTextAreaElement extends TextAreaElement { | ||
declare class MessageInputTextArea extends TextArea { | ||
ariaLabel: string; | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'vaadin-message-input-text-area': MessageInputTextAreaElement; | ||
'vaadin-message-input-text-area': MessageInputTextArea; | ||
} | ||
} |
Oops, something went wrong.