@vaadin/field-base 24.0.0-alpha8 → 24.0.0-beta1
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 +4 -4
- package/src/field-aria-controller.js +10 -10
- package/src/field-mixin.js +16 -16
- package/src/input-field-mixin.js +9 -9
- package/src/input-mixin.d.ts +2 -2
- package/src/input-mixin.js +10 -10
- package/src/label-mixin.js +10 -10
- package/src/styles/clear-button-styles.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-base",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
34
34
|
"@polymer/polymer": "^3.0.0",
|
|
35
|
-
"@vaadin/component-base": "24.0.0-
|
|
35
|
+
"@vaadin/component-base": "24.0.0-beta1",
|
|
36
36
|
"lit": "^2.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@esm-bundle/chai": "^4.3.4",
|
|
40
|
-
"@vaadin/testing-helpers": "^0.
|
|
40
|
+
"@vaadin/testing-helpers": "^0.4.0",
|
|
41
41
|
"sinon": "^13.0.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c5b48921a62482746df8e46994b37e1490fec27e"
|
|
44
44
|
}
|
|
@@ -15,6 +15,16 @@ export class FieldAriaController {
|
|
|
15
15
|
this.__required = false;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* `true` if the target element is the host component itself, `false` otherwise.
|
|
20
|
+
*
|
|
21
|
+
* @return {boolean}
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
get __isGroupField() {
|
|
25
|
+
return this.__target === this.host;
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
/**
|
|
19
29
|
* Sets a target element to which ARIA attributes are added.
|
|
20
30
|
*
|
|
@@ -81,16 +91,6 @@ export class FieldAriaController {
|
|
|
81
91
|
this.__helperId = helperId;
|
|
82
92
|
}
|
|
83
93
|
|
|
84
|
-
/**
|
|
85
|
-
* `true` if the target element is the host component itself, `false` otherwise.
|
|
86
|
-
*
|
|
87
|
-
* @return {boolean}
|
|
88
|
-
* @private
|
|
89
|
-
*/
|
|
90
|
-
get __isGroupField() {
|
|
91
|
-
return this.__target === this.host;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
94
|
/**
|
|
95
95
|
* @param {string | null | undefined} labelId
|
|
96
96
|
* @param {string | null | undefined} oldLabelId
|
package/src/field-mixin.js
CHANGED
|
@@ -56,22 +56,6 @@ export const FieldMixin = (superclass) =>
|
|
|
56
56
|
return ['_invalidChanged(invalid)', '_requiredChanged(required)'];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* @protected
|
|
61
|
-
* @return {HTMLElement}
|
|
62
|
-
*/
|
|
63
|
-
get _errorNode() {
|
|
64
|
-
return this._errorController.node;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @protected
|
|
69
|
-
* @return {HTMLElement}
|
|
70
|
-
*/
|
|
71
|
-
get _helperNode() {
|
|
72
|
-
return this._helperController.node;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
59
|
constructor() {
|
|
76
60
|
super();
|
|
77
61
|
|
|
@@ -95,6 +79,22 @@ export const FieldMixin = (superclass) =>
|
|
|
95
79
|
});
|
|
96
80
|
}
|
|
97
81
|
|
|
82
|
+
/**
|
|
83
|
+
* @protected
|
|
84
|
+
* @return {HTMLElement}
|
|
85
|
+
*/
|
|
86
|
+
get _errorNode() {
|
|
87
|
+
return this._errorController.node;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @protected
|
|
92
|
+
* @return {HTMLElement}
|
|
93
|
+
*/
|
|
94
|
+
get _helperNode() {
|
|
95
|
+
return this._helperController.node;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
98
|
/** @protected */
|
|
99
99
|
ready() {
|
|
100
100
|
super.ready();
|
package/src/input-field-mixin.js
CHANGED
|
@@ -55,6 +55,15 @@ export const InputFieldMixin = (superclass) =>
|
|
|
55
55
|
return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
// Workaround for https://github.com/Polymer/polymer/issues/5259
|
|
59
|
+
get __data() {
|
|
60
|
+
return this.__dataValue || {};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
set __data(value) {
|
|
64
|
+
this.__dataValue = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
/**
|
|
59
68
|
* @param {HTMLElement} input
|
|
60
69
|
* @protected
|
|
@@ -76,15 +85,6 @@ export const InputFieldMixin = (superclass) =>
|
|
|
76
85
|
}
|
|
77
86
|
}
|
|
78
87
|
|
|
79
|
-
// Workaround for https://github.com/Polymer/polymer/issues/5259
|
|
80
|
-
get __data() {
|
|
81
|
-
return this.__dataValue || {};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
set __data(value) {
|
|
85
|
-
this.__dataValue = value;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
88
|
/**
|
|
89
89
|
* Override an event listener from `FocusMixin`.
|
|
90
90
|
* @param {boolean} focused
|
package/src/input-mixin.d.ts
CHANGED
|
@@ -47,9 +47,9 @@ export declare class InputMixinClass {
|
|
|
47
47
|
|
|
48
48
|
protected _inputElementChanged(input: HTMLElement, oldInput: HTMLElement): void;
|
|
49
49
|
|
|
50
|
-
protected _onChange(event:
|
|
50
|
+
protected _onChange(event: Event): void;
|
|
51
51
|
|
|
52
|
-
protected _onInput(event:
|
|
52
|
+
protected _onInput(event: Event): void;
|
|
53
53
|
|
|
54
54
|
protected _setInputElement(input: HTMLElement): void;
|
|
55
55
|
|
package/src/input-mixin.js
CHANGED
|
@@ -72,6 +72,16 @@ export const InputMixin = dedupingMixin(
|
|
|
72
72
|
this._boundOnChange = this._onChange.bind(this);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Indicates whether the value is different from the default one.
|
|
77
|
+
* Override if the `value` property has a type other than `string`.
|
|
78
|
+
*
|
|
79
|
+
* @protected
|
|
80
|
+
*/
|
|
81
|
+
get _hasValue() {
|
|
82
|
+
return this.value != null && this.value !== '';
|
|
83
|
+
}
|
|
84
|
+
|
|
75
85
|
/**
|
|
76
86
|
* Clear the value of the field.
|
|
77
87
|
*/
|
|
@@ -223,16 +233,6 @@ export const InputMixin = dedupingMixin(
|
|
|
223
233
|
this._forwardInputValue(newVal);
|
|
224
234
|
}
|
|
225
235
|
|
|
226
|
-
/**
|
|
227
|
-
* Indicates whether the value is different from the default one.
|
|
228
|
-
* Override if the `value` property has a type other than `string`.
|
|
229
|
-
*
|
|
230
|
-
* @protected
|
|
231
|
-
*/
|
|
232
|
-
get _hasValue() {
|
|
233
|
-
return this.value != null && this.value !== '';
|
|
234
|
-
}
|
|
235
|
-
|
|
236
236
|
/**
|
|
237
237
|
* Sets the `_hasInputValue` property based on the `input` event.
|
|
238
238
|
*
|
package/src/label-mixin.js
CHANGED
|
@@ -29,6 +29,16 @@ export const LabelMixin = dedupingMixin(
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
|
|
35
|
+
this._labelController = new LabelController(this);
|
|
36
|
+
|
|
37
|
+
this._labelController.addEventListener('slot-content-changed', (event) => {
|
|
38
|
+
this.toggleAttribute('has-label', event.detail.hasContent);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
/** @protected */
|
|
33
43
|
get _labelId() {
|
|
34
44
|
const node = this._labelNode;
|
|
@@ -40,16 +50,6 @@ export const LabelMixin = dedupingMixin(
|
|
|
40
50
|
return this._labelController.node;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
constructor() {
|
|
44
|
-
super();
|
|
45
|
-
|
|
46
|
-
this._labelController = new LabelController(this);
|
|
47
|
-
|
|
48
|
-
this._labelController.addEventListener('slot-content-changed', (event) => {
|
|
49
|
-
this.toggleAttribute('has-label', event.detail.hasContent);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
53
|
/** @protected */
|
|
54
54
|
ready() {
|
|
55
55
|
super.ready();
|