@vaadin/text-area 23.1.2 → 23.2.0-alpha3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/text-area",
3
- "version": "23.1.2",
3
+ "version": "23.2.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,17 +33,17 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/component-base": "^23.1.2",
37
- "@vaadin/field-base": "^23.1.2",
38
- "@vaadin/input-container": "^23.1.2",
39
- "@vaadin/vaadin-lumo-styles": "^23.1.2",
40
- "@vaadin/vaadin-material-styles": "^23.1.2",
41
- "@vaadin/vaadin-themable-mixin": "^23.1.2"
36
+ "@vaadin/component-base": "23.2.0-alpha3",
37
+ "@vaadin/field-base": "23.2.0-alpha3",
38
+ "@vaadin/input-container": "23.2.0-alpha3",
39
+ "@vaadin/vaadin-lumo-styles": "23.2.0-alpha3",
40
+ "@vaadin/vaadin-material-styles": "23.2.0-alpha3",
41
+ "@vaadin/vaadin-themable-mixin": "23.2.0-alpha3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@esm-bundle/chai": "^4.3.4",
45
45
  "@vaadin/testing-helpers": "^0.3.2",
46
46
  "sinon": "^13.0.2"
47
47
  },
48
- "gitHead": "6fb205c6e9a761feadfb779dd5d7af96d3102e56"
48
+ "gitHead": "06e5875be93ca50da2846dafc65a8531010c0576"
49
49
  }
@@ -26,10 +26,17 @@ export type TextAreaInvalidChangedEvent = CustomEvent<{ value: boolean }>;
26
26
  */
27
27
  export type TextAreaValueChangedEvent = CustomEvent<{ value: string }>;
28
28
 
29
+ /**
30
+ * Fired whenever the field is validated.
31
+ */
32
+ export type TextAreaValidatedEvent = CustomEvent<{ valid: boolean }>;
33
+
29
34
  export interface TextAreaCustomEventMap {
30
35
  'invalid-changed': TextAreaInvalidChangedEvent;
31
36
 
32
37
  'value-changed': TextAreaValueChangedEvent;
38
+
39
+ validated: TextAreaValidatedEvent;
33
40
  }
34
41
 
35
42
  export interface TextAreaEventMap extends HTMLElementEventMap, TextAreaCustomEventMap {
@@ -76,6 +83,7 @@ export interface TextAreaEventMap extends HTMLElementEventMap, TextAreaCustomEve
76
83
  * @fires {Event} change - Fired when the user commits a value change.
77
84
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
78
85
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
86
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
79
87
  */
80
88
  declare class TextArea extends ResizeMixin(PatternMixin(InputFieldMixin(ThemableMixin(ElementMixin(HTMLElement))))) {
81
89
  /**
@@ -54,6 +54,7 @@ registerStyles('vaadin-text-area', inputFieldShared, { moduleId: 'vaadin-text-ar
54
54
  * @fires {Event} change - Fired when the user commits a value change.
55
55
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
56
56
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
57
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
57
58
  *
58
59
  * @extends HTMLElement
59
60
  * @mixes InputFieldMixin
@@ -201,29 +202,6 @@ export class TextArea extends ResizeMixin(PatternMixin(InputFieldMixin(ThemableM
201
202
  return this.$.clearButton;
202
203
  }
203
204
 
204
- /** @protected */
205
- connectedCallback() {
206
- super.connectedCallback();
207
-
208
- this._inputField = this.shadowRoot.querySelector('[part=input-field]');
209
-
210
- // Wheel scrolling results in async scroll events. Preventing the wheel
211
- // event, scrolling manually and then synchronously updating the scroll position CSS variable
212
- // allows us to avoid some jumpy behavior that would occur on wheel otherwise.
213
- this._inputField.addEventListener('wheel', (e) => {
214
- const scrollTopBefore = this._inputField.scrollTop;
215
- this._inputField.scrollTop += e.deltaY;
216
-
217
- if (scrollTopBefore !== this._inputField.scrollTop) {
218
- e.preventDefault();
219
- this.__scrollPositionUpdated();
220
- }
221
- });
222
-
223
- this._updateHeight();
224
- this.__scrollPositionUpdated();
225
- }
226
-
227
205
  /**
228
206
  * @protected
229
207
  * @override
@@ -246,6 +224,24 @@ export class TextArea extends ResizeMixin(PatternMixin(InputFieldMixin(ThemableM
246
224
  );
247
225
  this.addController(new LabelledInputController(this.inputElement, this._labelController));
248
226
  this.addEventListener('animationend', this._onAnimationEnd);
227
+
228
+ this._inputField = this.shadowRoot.querySelector('[part=input-field]');
229
+
230
+ // Wheel scrolling results in async scroll events. Preventing the wheel
231
+ // event, scrolling manually and then synchronously updating the scroll position CSS variable
232
+ // allows us to avoid some jumpy behavior that would occur on wheel otherwise.
233
+ this._inputField.addEventListener('wheel', (e) => {
234
+ const scrollTopBefore = this._inputField.scrollTop;
235
+ this._inputField.scrollTop += e.deltaY;
236
+
237
+ if (scrollTopBefore !== this._inputField.scrollTop) {
238
+ e.preventDefault();
239
+ this.__scrollPositionUpdated();
240
+ }
241
+ });
242
+
243
+ this._updateHeight();
244
+ this.__scrollPositionUpdated();
249
245
  }
250
246
 
251
247
  /** @private */