@vaadin/field-base 24.7.0-alpha1 → 24.7.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 +6 -6
- package/src/error-controller.js +4 -5
- package/src/input-mixin.d.ts +0 -2
- package/src/input-mixin.js +3 -15
- package/src/validate-mixin.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-base",
|
|
3
|
-
"version": "24.7.0-
|
|
3
|
+
"version": "24.7.0-alpha3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
34
34
|
"@polymer/polymer": "^3.0.0",
|
|
35
|
-
"@vaadin/a11y-base": "24.7.0-
|
|
36
|
-
"@vaadin/component-base": "24.7.0-
|
|
35
|
+
"@vaadin/a11y-base": "24.7.0-alpha3",
|
|
36
|
+
"@vaadin/component-base": "24.7.0-alpha3",
|
|
37
37
|
"lit": "^3.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@vaadin/chai-plugins": "24.7.0-
|
|
41
|
-
"@vaadin/testing-helpers": "^1.
|
|
40
|
+
"@vaadin/chai-plugins": "24.7.0-alpha3",
|
|
41
|
+
"@vaadin/testing-helpers": "^1.1.0",
|
|
42
42
|
"sinon": "^18.0.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "dd5cfad6c9b54e676f5b10dffba2233775378f40"
|
|
45
45
|
}
|
package/src/error-controller.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { announce } from '@vaadin/a11y-base/src/announce.js';
|
|
6
7
|
import { SlotChildObserveController } from '@vaadin/component-base/src/slot-child-observe-controller.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -108,12 +109,10 @@ export class ErrorController extends SlotChildObserveController {
|
|
|
108
109
|
errorNode.textContent = hasError ? errorMessage : '';
|
|
109
110
|
errorNode.hidden = !hasError;
|
|
110
111
|
|
|
111
|
-
// Role alert will make the error message announce immediately
|
|
112
|
-
// as the field becomes invalid
|
|
113
112
|
if (hasError) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
// Assertive mode ensures VoiceOver reads
|
|
114
|
+
// the error message on commit with Enter.
|
|
115
|
+
announce(errorMessage, { mode: 'assertive' });
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
package/src/input-mixin.d.ts
CHANGED
package/src/input-mixin.js
CHANGED
|
@@ -32,6 +32,7 @@ export const InputMixin = dedupingMixin(
|
|
|
32
32
|
type: Object,
|
|
33
33
|
readOnly: true,
|
|
34
34
|
observer: '_inputElementChanged',
|
|
35
|
+
sync: true,
|
|
35
36
|
},
|
|
36
37
|
|
|
37
38
|
/**
|
|
@@ -63,6 +64,7 @@ export const InputMixin = dedupingMixin(
|
|
|
63
64
|
type: Boolean,
|
|
64
65
|
value: false,
|
|
65
66
|
observer: '_hasInputValueChanged',
|
|
67
|
+
sync: true,
|
|
66
68
|
},
|
|
67
69
|
};
|
|
68
70
|
}
|
|
@@ -204,7 +206,7 @@ export const InputMixin = dedupingMixin(
|
|
|
204
206
|
* @private
|
|
205
207
|
*/
|
|
206
208
|
__onInput(event) {
|
|
207
|
-
this.
|
|
209
|
+
this._hasInputValue = !!this._inputElementValue;
|
|
208
210
|
this._onInput(event);
|
|
209
211
|
}
|
|
210
212
|
|
|
@@ -265,19 +267,5 @@ export const InputMixin = dedupingMixin(
|
|
|
265
267
|
// Setting a value programmatically, sync it to input element.
|
|
266
268
|
this._forwardInputValue(newVal);
|
|
267
269
|
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Sets the `_hasInputValue` property based on the `input` event.
|
|
271
|
-
*
|
|
272
|
-
* @param {InputEvent} event
|
|
273
|
-
* @protected
|
|
274
|
-
*/
|
|
275
|
-
_setHasInputValue(event) {
|
|
276
|
-
// In the case a custom web component is passed as `inputElement`,
|
|
277
|
-
// the actual native input element, on which the event occurred,
|
|
278
|
-
// can be inside shadow trees.
|
|
279
|
-
const target = event.composedPath()[0];
|
|
280
|
-
this._hasInputValue = target.value.length > 0;
|
|
281
|
-
}
|
|
282
270
|
},
|
|
283
271
|
);
|
package/src/validate-mixin.js
CHANGED
|
@@ -23,6 +23,7 @@ export const ValidateMixin = dedupingMixin(
|
|
|
23
23
|
reflectToAttribute: true,
|
|
24
24
|
notify: true,
|
|
25
25
|
value: false,
|
|
26
|
+
sync: true,
|
|
26
27
|
},
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -47,6 +48,7 @@ export const ValidateMixin = dedupingMixin(
|
|
|
47
48
|
required: {
|
|
48
49
|
type: Boolean,
|
|
49
50
|
reflectToAttribute: true,
|
|
51
|
+
sync: true,
|
|
50
52
|
},
|
|
51
53
|
};
|
|
52
54
|
}
|