@vaadin/vaadin-text-field 2.9.0 → 2.9.1

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
@@ -10,7 +10,7 @@
10
10
  "repository": "vaadin/vaadin-text-field",
11
11
  "homepage": "https://vaadin.com/components",
12
12
  "name": "@vaadin/vaadin-text-field",
13
- "version": "2.9.0",
13
+ "version": "2.9.1",
14
14
  "main": "vaadin-text-field.js",
15
15
  "author": "Vaadin Ltd",
16
16
  "license": "Apache-2.0",
@@ -25,8 +25,6 @@
25
25
  "theme"
26
26
  ],
27
27
  "resolutions": {
28
- "es-abstract": "1.17.6",
29
- "@types/doctrine": "0.0.3",
30
28
  "inherits": "2.0.3",
31
29
  "samsam": "1.1.3",
32
30
  "supports-color": "3.1.2",
@@ -40,10 +38,9 @@
40
38
  "@vaadin/vaadin-material-styles": "^1.3.2",
41
39
  "@vaadin/vaadin-element-mixin": "^2.4.1"
42
40
  },
43
- "scripts": {
44
- "generate-typings": "gen-typescript-declarations --outDir . --verify"
45
- },
46
- "devDependencies": {
41
+ "devDependencies": {
42
+ "@web-padawan/gen-typescript-declarations": "^1.6.2",
43
+ "web-component-tester": "6.9.2",
47
44
  "@polymer/iron-component-page": "^4.0.0",
48
45
  "@polymer/iron-form": "^3.0.0",
49
46
  "@polymer/iron-test-helpers": "^3.0.0",
@@ -51,5 +48,9 @@
51
48
  "wct-browser-legacy": "^1.0.1",
52
49
  "@vaadin/vaadin-demo-helpers": "^3.0.0",
53
50
  "@vaadin/vaadin-button": "^2.1.0"
51
+ },
52
+ "scripts": {
53
+ "generate-typings": "gen-typescript-declarations --outDir . --verify",
54
+ "test": "wct --npm"
54
55
  }
55
56
  }
@@ -63,7 +63,7 @@ class EmailFieldElement extends TextFieldElement {
63
63
  }
64
64
 
65
65
  static get version() {
66
- return '2.9.0';
66
+ return '2.9.1';
67
67
  }
68
68
 
69
69
  static get template() {
@@ -32,7 +32,7 @@ class IntegerFieldElement extends NumberFieldElement {
32
32
  }
33
33
 
34
34
  static get version() {
35
- return '2.9.0';
35
+ return '2.9.1';
36
36
  }
37
37
 
38
38
  static get properties() {
@@ -105,7 +105,7 @@ class NumberFieldElement extends TextFieldElement {
105
105
  }
106
106
 
107
107
  static get version() {
108
- return '2.9.0';
108
+ return '2.9.1';
109
109
  }
110
110
 
111
111
  static get properties() {
@@ -76,7 +76,7 @@ class PasswordFieldElement extends TextFieldElement {
76
76
  }
77
77
 
78
78
  static get version() {
79
- return '2.9.0';
79
+ return '2.9.1';
80
80
  }
81
81
 
82
82
  static get properties() {
@@ -121,7 +121,7 @@ class TextAreaElement extends
121
121
 
122
122
  <label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
123
123
 
124
- <div part="input-field" id="[[_inputId]]">
124
+ <div part="input-field" id="[[_inputId]]" on-scroll="__scrollPositionUpdated">
125
125
 
126
126
  <slot name="prefix"></slot>
127
127
 
@@ -149,7 +149,7 @@ class TextAreaElement extends
149
149
  }
150
150
 
151
151
  static get version() {
152
- return '2.9.0';
152
+ return '2.9.1';
153
153
  }
154
154
 
155
155
  static get properties() {
@@ -175,6 +175,25 @@ class TextAreaElement extends
175
175
  super.ready();
176
176
  this._updateHeight();
177
177
  this.addEventListener('animationend', this._onAnimationEnd);
178
+
179
+ this._inputField = this.root.querySelector('[part=input-field]');
180
+ // Wheel scrolling results in async scroll events. Preventing the wheel
181
+ // event, scrolling manually and then synchronously updating the scroll position CSS variable
182
+ // allows us to avoid some jumpy behavior that would occur on wheel otherwise.
183
+ this._inputField.addEventListener('wheel', (e) => {
184
+ e.preventDefault();
185
+ this._inputField.scrollTop += e.deltaY;
186
+ this.__scrollPositionUpdated();
187
+ });
188
+
189
+ this.__scrollPositionUpdated();
190
+ }
191
+
192
+ /** @private */
193
+ __scrollPositionUpdated() {
194
+ this.updateStyles({
195
+ '--_text-area-vertical-scroll-position': this._inputField.scrollTop + 'px',
196
+ });
178
197
  }
179
198
 
180
199
  /** @private */
@@ -116,7 +116,7 @@ class TextFieldElement extends
116
116
  }
117
117
 
118
118
  static get version() {
119
- return '2.9.0';
119
+ return '2.9.1';
120
120
  }
121
121
 
122
122
  static get properties() {
@@ -20,6 +20,11 @@ const $_documentContainer = html`<dom-module id="material-text-area" theme-for="
20
20
  white-space: pre-wrap; /* override \`nowrap\` from <vaadin-text-field> */
21
21
  align-self: stretch; /* override \`baseline\` from <vaadin-text-field> */
22
22
  }
23
+
24
+ [part='input-field']::before,
25
+ [part='input-field']::after {
26
+ bottom: calc(var(--_text-area-vertical-scroll-position) * -1);
27
+ }
23
28
  </style>
24
29
  </template>
25
30
  </dom-module>`;