@vaadin/password-field 23.0.0-beta4 → 23.0.0
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 +6 -6
- package/src/vaadin-password-field.js +21 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/password-field",
|
|
3
|
-
"version": "23.0.0
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/button": "23.0.0
|
|
37
|
-
"@vaadin/text-field": "23.0.0
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0
|
|
39
|
-
"@vaadin/vaadin-material-styles": "23.0.0
|
|
36
|
+
"@vaadin/button": "^23.0.0",
|
|
37
|
+
"@vaadin/text-field": "^23.0.0",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.0",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "^23.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@esm-bundle/chai": "^4.3.4",
|
|
43
43
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
44
44
|
"sinon": "^9.2.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e5ce38429a14de1448d732614e359fb32b2c42e0"
|
|
47
47
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-password-field-button.js';
|
|
7
7
|
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
|
8
|
-
import {
|
|
8
|
+
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
9
9
|
import { SlotStylesMixin } from '@vaadin/field-base/src/slot-styles-mixin.js';
|
|
10
10
|
import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js';
|
|
11
11
|
|
|
@@ -51,7 +51,7 @@ let memoizedTemplate;
|
|
|
51
51
|
* @extends TextField
|
|
52
52
|
* @mixes SlotStylesMixin
|
|
53
53
|
*/
|
|
54
|
-
export class PasswordField extends SlotStylesMixin(
|
|
54
|
+
export class PasswordField extends SlotStylesMixin(TextField) {
|
|
55
55
|
static get is() {
|
|
56
56
|
return 'vaadin-password-field';
|
|
57
57
|
}
|
|
@@ -122,18 +122,6 @@ export class PasswordField extends SlotStylesMixin(SlotMixin(TextField)) {
|
|
|
122
122
|
return ['__i18nChanged(i18n.*)'];
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
/** @protected */
|
|
126
|
-
get slots() {
|
|
127
|
-
return {
|
|
128
|
-
...super.slots,
|
|
129
|
-
reveal: () => {
|
|
130
|
-
const btn = document.createElement('vaadin-password-field-button');
|
|
131
|
-
btn.disabled = this.disabled;
|
|
132
|
-
return btn;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
125
|
/** @protected */
|
|
138
126
|
get slotStyles() {
|
|
139
127
|
const tag = this.localName;
|
|
@@ -148,7 +136,7 @@ export class PasswordField extends SlotStylesMixin(SlotMixin(TextField)) {
|
|
|
148
136
|
|
|
149
137
|
/** @protected */
|
|
150
138
|
get _revealNode() {
|
|
151
|
-
return this.
|
|
139
|
+
return this._revealButtonController && this._revealButtonController.node;
|
|
152
140
|
}
|
|
153
141
|
|
|
154
142
|
constructor() {
|
|
@@ -163,33 +151,27 @@ export class PasswordField extends SlotStylesMixin(SlotMixin(TextField)) {
|
|
|
163
151
|
super.ready();
|
|
164
152
|
|
|
165
153
|
this._revealPart = this.shadowRoot.querySelector('[part="reveal-button"]');
|
|
166
|
-
}
|
|
167
154
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
155
|
+
this._revealButtonController = new SlotController(
|
|
156
|
+
this,
|
|
157
|
+
'reveal',
|
|
158
|
+
() => document.createElement('vaadin-password-field-button'),
|
|
159
|
+
(host, btn) => {
|
|
160
|
+
btn.disabled = host.disabled;
|
|
171
161
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
162
|
+
btn.addEventListener('click', host.__boundRevealButtonClick);
|
|
163
|
+
btn.addEventListener('touchend', host.__boundRevealButtonTouchend);
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
this.addController(this._revealButtonController);
|
|
177
167
|
|
|
178
|
-
|
|
179
|
-
this.inputElement.autocapitalize = 'off';
|
|
180
|
-
}
|
|
168
|
+
this.__updateAriaLabel(this.i18n);
|
|
181
169
|
|
|
182
|
-
this._toggleRevealHidden(this.revealButtonHidden);
|
|
183
170
|
this._updateToggleState(false);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
/** @protected */
|
|
187
|
-
disconnectedCallback() {
|
|
188
|
-
super.disconnectedCallback();
|
|
171
|
+
this._toggleRevealHidden(this.revealButtonHidden);
|
|
189
172
|
|
|
190
|
-
if (this.
|
|
191
|
-
this.
|
|
192
|
-
this._revealNode.removeEventListener('touchend', this.__boundRevealButtonTouchend);
|
|
173
|
+
if (this.inputElement) {
|
|
174
|
+
this.inputElement.autocapitalize = 'off';
|
|
193
175
|
}
|
|
194
176
|
}
|
|
195
177
|
|
|
@@ -306,10 +288,11 @@ export class PasswordField extends SlotStylesMixin(SlotMixin(TextField)) {
|
|
|
306
288
|
* Override method inherited from `DisabledMixin` to synchronize the reveal button
|
|
307
289
|
* disabled state with the password field disabled state.
|
|
308
290
|
* @param {boolean} disabled
|
|
291
|
+
* @param {boolean} oldDisabled
|
|
309
292
|
* @protected
|
|
310
293
|
*/
|
|
311
|
-
_disabledChanged(disabled) {
|
|
312
|
-
super._disabledChanged(disabled);
|
|
294
|
+
_disabledChanged(disabled, oldDisabled) {
|
|
295
|
+
super._disabledChanged(disabled, oldDisabled);
|
|
313
296
|
|
|
314
297
|
if (this._revealNode) {
|
|
315
298
|
this._revealNode.disabled = disabled;
|