@vaadin/message-input 23.2.0-dev.8a7678b70 → 23.3.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
@@ -2,13 +2,13 @@
2
2
 
3
3
  A web component that allows users to author and send messages.
4
4
 
5
- [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/message-input)
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/message-input)
6
6
 
7
7
  ```html
8
8
  <vaadin-message-input></vaadin-message-input>
9
9
  ```
10
10
 
11
- [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/message-input/screenshot.png" width="656" alt="Screenshot of vaadin-message-input">](https://vaadin.com/docs/latest/ds/components/message-input)
11
+ [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/message-input/screenshot.png" width="656" alt="Screenshot of vaadin-message-input">](https://vaadin.com/docs/latest/components/message-input)
12
12
 
13
13
  ## Installation
14
14
 
@@ -26,7 +26,7 @@ import '@vaadin/message-input';
26
26
 
27
27
  ## Themes
28
28
 
29
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
29
+ Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
30
30
  The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/message-input/vaadin-message-input.js) of the package uses the Lumo theme.
31
31
 
32
32
  To use the Material theme, import the component from the `theme/material` folder:
@@ -49,7 +49,7 @@ import '@vaadin/message-input/src/vaadin-message-input.js';
49
49
 
50
50
  ## Contributing
51
51
 
52
- 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.
52
+ Read the [contributing guide](https://vaadin.com/docs/latest/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
53
53
 
54
54
  ## License
55
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/message-input",
3
- "version": "23.2.0-dev.8a7678b70",
3
+ "version": "23.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,7 +23,9 @@
23
23
  "src",
24
24
  "theme",
25
25
  "vaadin-*.d.ts",
26
- "vaadin-*.js"
26
+ "vaadin-*.js",
27
+ "web-types.json",
28
+ "web-types.lit.json"
27
29
  ],
28
30
  "keywords": [
29
31
  "Vaadin",
@@ -34,17 +36,21 @@
34
36
  ],
35
37
  "dependencies": {
36
38
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/button": "23.2.0-dev.8a7678b70",
38
- "@vaadin/component-base": "23.2.0-dev.8a7678b70",
39
- "@vaadin/text-area": "23.2.0-dev.8a7678b70",
40
- "@vaadin/vaadin-lumo-styles": "23.2.0-dev.8a7678b70",
41
- "@vaadin/vaadin-material-styles": "23.2.0-dev.8a7678b70",
42
- "@vaadin/vaadin-themable-mixin": "23.2.0-dev.8a7678b70"
39
+ "@vaadin/button": "23.3.0-alpha1",
40
+ "@vaadin/component-base": "23.3.0-alpha1",
41
+ "@vaadin/text-area": "23.3.0-alpha1",
42
+ "@vaadin/vaadin-lumo-styles": "23.3.0-alpha1",
43
+ "@vaadin/vaadin-material-styles": "23.3.0-alpha1",
44
+ "@vaadin/vaadin-themable-mixin": "23.3.0-alpha1"
43
45
  },
44
46
  "devDependencies": {
45
47
  "@esm-bundle/chai": "^4.3.4",
46
48
  "@vaadin/testing-helpers": "^0.3.2",
47
49
  "sinon": "^13.0.2"
48
50
  },
49
- "gitHead": "85b403f96d8282f262322b56c0ff4289f843d02a"
51
+ "web-types": [
52
+ "web-types.json",
53
+ "web-types.lit.json"
54
+ ],
55
+ "gitHead": "beabc527d4b1274eb798ff701d406fed45cfe638"
50
56
  }
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
6
7
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
7
8
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
9
 
@@ -35,7 +36,7 @@ export type MessageInputEventMap = HTMLElementEventMap & MessageInputCustomEvent
35
36
  * <vaadin-message-input></vaadin-message-input>
36
37
  * ```
37
38
  */
38
- declare class MessageInput extends ThemableMixin(ElementMixin(HTMLElement)) {
39
+ declare class MessageInput extends ThemableMixin(ElementMixin(ControllerMixin(HTMLElement))) {
39
40
  /**
40
41
  * Current content of the text input field
41
42
  */
@@ -68,13 +69,13 @@ declare class MessageInput extends ThemableMixin(ElementMixin(HTMLElement)) {
68
69
  addEventListener<K extends keyof MessageInputEventMap>(
69
70
  type: K,
70
71
  listener: (this: MessageInput, ev: MessageInputEventMap[K]) => void,
71
- options?: boolean | AddEventListenerOptions,
72
+ options?: AddEventListenerOptions | boolean,
72
73
  ): void;
73
74
 
74
75
  removeEventListener<K extends keyof MessageInputEventMap>(
75
76
  type: K,
76
77
  listener: (this: MessageInput, ev: MessageInputEventMap[K]) => void,
77
- options?: boolean | EventListenerOptions,
78
+ options?: EventListenerOptions | boolean,
78
79
  ): void;
79
80
  }
80
81
 
@@ -6,7 +6,9 @@
6
6
  import './vaadin-message-input-text-area.js';
7
7
  import './vaadin-message-input-button.js';
8
8
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
9
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
9
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
+ import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
10
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
13
 
12
14
  /**
@@ -30,10 +32,11 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
30
32
  * - `<vaadin-message-input-text-area>` - has the same API as [`<vaadin-text-area>`](#/elements/vaadin-text-area).
31
33
  *
32
34
  * @extends HTMLElement
35
+ * @mizes ControllerMixin
33
36
  * @mixes ThemableMixin
34
37
  * @mixes ElementMixin
35
38
  */
36
- class MessageInput extends ElementMixin(ThemableMixin(PolymerElement)) {
39
+ class MessageInput extends ElementMixin(ThemableMixin(ControllerMixin(PolymerElement))) {
37
40
  static get properties() {
38
41
  return {
39
42
  /**
@@ -106,6 +109,8 @@ class MessageInput extends ElementMixin(ThemableMixin(PolymerElement)) {
106
109
  <vaadin-message-input-button disabled="[[disabled]]" theme="primary contained" on-click="__submit"
107
110
  >[[i18n.send]]</vaadin-message-input-button
108
111
  >
112
+
113
+ <slot name="tooltip"></slot>
109
114
  `;
110
115
  }
111
116
 
@@ -113,6 +118,14 @@ class MessageInput extends ElementMixin(ThemableMixin(PolymerElement)) {
113
118
  return 'vaadin-message-input';
114
119
  }
115
120
 
121
+ /** @protected */
122
+ ready() {
123
+ super.ready();
124
+
125
+ this._tooltipController = new TooltipController(this);
126
+ this.addController(this._tooltipController);
127
+ }
128
+
116
129
  /**
117
130
  * Submits the current value as an custom event named 'submit'.
118
131
  * It also clears the text input and refocuses it for sending another message.
package/web-types.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/message-input",
4
+ "version": "23.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-message-input",
11
+ "description": "`<vaadin-message-input>` is a Web Component for sending messages.\nIt consists of a text area that grows on along with the content, and a send button to send message.\n\nThe message can be sent by one of the following actions:\n- by pressing Enter (use Shift + Enter to add a new line)\n- by clicking `submit` button.\n\n```html\n<vaadin-message-input></vaadin-message-input>\n```\n\n### Internal components\n\nIn addition to `<vaadin-message-input>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-message-input-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-button).\n- `<vaadin-message-input-text-area>` - has the same API as [`<vaadin-text-area>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-text-area).",
12
+ "attributes": [
13
+ {
14
+ "name": "value",
15
+ "description": "Current content of the text input field",
16
+ "value": {
17
+ "type": [
18
+ "string",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "disabled",
26
+ "description": "Set to true to disable this element.",
27
+ "value": {
28
+ "type": [
29
+ "boolean"
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ "name": "theme",
35
+ "description": "The theme variants to apply to the component.",
36
+ "value": {
37
+ "type": [
38
+ "string",
39
+ "null",
40
+ "undefined"
41
+ ]
42
+ }
43
+ }
44
+ ],
45
+ "js": {
46
+ "properties": [
47
+ {
48
+ "name": "value",
49
+ "description": "Current content of the text input field",
50
+ "value": {
51
+ "type": [
52
+ "string",
53
+ "null",
54
+ "undefined"
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "name": "i18n",
60
+ "description": "The object used to localize this component.\nFor changing the default localization, change the entire\n`i18n` object.\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // Used as the button label\n send: 'Send',\n\n // Used as the input field's placeholder and aria-label\n message: 'Message'\n}\n```",
61
+ "value": {
62
+ "type": [
63
+ "MessageInputI18n"
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "name": "disabled",
69
+ "description": "Set to true to disable this element.",
70
+ "value": {
71
+ "type": [
72
+ "boolean"
73
+ ]
74
+ }
75
+ }
76
+ ],
77
+ "events": []
78
+ }
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/message-input",
4
+ "version": "23.3.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-message-input",
19
+ "description": "`<vaadin-message-input>` is a Web Component for sending messages.\nIt consists of a text area that grows on along with the content, and a send button to send message.\n\nThe message can be sent by one of the following actions:\n- by pressing Enter (use Shift + Enter to add a new line)\n- by clicking `submit` button.\n\n```html\n<vaadin-message-input></vaadin-message-input>\n```\n\n### Internal components\n\nIn addition to `<vaadin-message-input>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-message-input-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-button).\n- `<vaadin-message-input-text-area>` - has the same API as [`<vaadin-text-area>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-text-area).",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": "?disabled",
24
+ "description": "Set to true to disable this element.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": ".value",
31
+ "description": "Current content of the text input field",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": ".i18n",
38
+ "description": "The object used to localize this component.\nFor changing the default localization, change the entire\n`i18n` object.\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // Used as the button label\n send: 'Send',\n\n // Used as the input field's placeholder and aria-label\n message: 'Message'\n}\n```",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ }