@vaadin/custom-field 24.6.0-alpha2 → 24.6.0-alpha4
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 +19 -19
- package/src/vaadin-custom-field-mixin.js +8 -6
- package/web-types.json +3 -3
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/custom-field",
|
|
3
|
-
"version": "24.6.0-
|
|
3
|
+
"version": "24.6.0-alpha4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,32 +38,32 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/a11y-base": "24.6.0-
|
|
42
|
-
"@vaadin/component-base": "24.6.0-
|
|
43
|
-
"@vaadin/field-base": "24.6.0-
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "24.6.0-
|
|
45
|
-
"@vaadin/vaadin-material-styles": "24.6.0-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "24.6.0-
|
|
41
|
+
"@vaadin/a11y-base": "24.6.0-alpha4",
|
|
42
|
+
"@vaadin/component-base": "24.6.0-alpha4",
|
|
43
|
+
"@vaadin/field-base": "24.6.0-alpha4",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha4",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "24.6.0-alpha4",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha4",
|
|
47
47
|
"lit": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "24.6.0-
|
|
51
|
-
"@vaadin/combo-box": "24.6.0-
|
|
52
|
-
"@vaadin/date-picker": "24.6.0-
|
|
53
|
-
"@vaadin/email-field": "24.6.0-
|
|
54
|
-
"@vaadin/form-layout": "24.6.0-
|
|
55
|
-
"@vaadin/number-field": "24.6.0-
|
|
56
|
-
"@vaadin/password-field": "24.6.0-
|
|
57
|
-
"@vaadin/select": "24.6.0-
|
|
50
|
+
"@vaadin/chai-plugins": "24.6.0-alpha4",
|
|
51
|
+
"@vaadin/combo-box": "24.6.0-alpha4",
|
|
52
|
+
"@vaadin/date-picker": "24.6.0-alpha4",
|
|
53
|
+
"@vaadin/email-field": "24.6.0-alpha4",
|
|
54
|
+
"@vaadin/form-layout": "24.6.0-alpha4",
|
|
55
|
+
"@vaadin/number-field": "24.6.0-alpha4",
|
|
56
|
+
"@vaadin/password-field": "24.6.0-alpha4",
|
|
57
|
+
"@vaadin/select": "24.6.0-alpha4",
|
|
58
58
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
59
|
-
"@vaadin/text-area": "24.6.0-
|
|
60
|
-
"@vaadin/text-field": "24.6.0-
|
|
61
|
-
"@vaadin/time-picker": "24.6.0-
|
|
59
|
+
"@vaadin/text-area": "24.6.0-alpha4",
|
|
60
|
+
"@vaadin/text-field": "24.6.0-alpha4",
|
|
61
|
+
"@vaadin/time-picker": "24.6.0-alpha4",
|
|
62
62
|
"sinon": "^18.0.0"
|
|
63
63
|
},
|
|
64
64
|
"web-types": [
|
|
65
65
|
"web-types.json",
|
|
66
66
|
"web-types.lit.json"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "78967d4f3bb46f58f43c2cc621802554acb2efaf"
|
|
69
69
|
}
|
|
@@ -172,7 +172,7 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
172
172
|
*/
|
|
173
173
|
_shouldRemoveFocus(event) {
|
|
174
174
|
const { relatedTarget } = event;
|
|
175
|
-
return !this.inputs.some((el) => relatedTarget === (el.focusElement || el));
|
|
175
|
+
return !this.inputs || !this.inputs.some((el) => relatedTarget === (el.focusElement || el));
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
/**
|
|
@@ -181,9 +181,10 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
181
181
|
* @return {boolean}
|
|
182
182
|
*/
|
|
183
183
|
checkValidity() {
|
|
184
|
-
const
|
|
184
|
+
const hasInvalidFields =
|
|
185
|
+
this.inputs && this.inputs.some((input) => !(input.validate || input.checkValidity).call(input));
|
|
185
186
|
|
|
186
|
-
if (
|
|
187
|
+
if (hasInvalidFields || (this.required && !(this.value && this.value.trim()))) {
|
|
187
188
|
// Either 1. one of the input fields is invalid or
|
|
188
189
|
// 2. the custom field itself is required but doesn't have a value
|
|
189
190
|
return false;
|
|
@@ -213,9 +214,10 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
213
214
|
*/
|
|
214
215
|
_onKeyDown(e) {
|
|
215
216
|
if (e.key === 'Tab') {
|
|
217
|
+
const inputs = this.inputs || [];
|
|
216
218
|
if (
|
|
217
|
-
(
|
|
218
|
-
(
|
|
219
|
+
(inputs.indexOf(e.target) < inputs.length - 1 && !e.shiftKey) ||
|
|
220
|
+
(inputs.indexOf(e.target) > 0 && e.shiftKey)
|
|
219
221
|
) {
|
|
220
222
|
this.dispatchEvent(new CustomEvent('internal-tab'));
|
|
221
223
|
} else {
|
|
@@ -294,7 +296,7 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
294
296
|
return;
|
|
295
297
|
}
|
|
296
298
|
|
|
297
|
-
this.__applyInputsValue(value);
|
|
299
|
+
this.__applyInputsValue(value || '\t');
|
|
298
300
|
|
|
299
301
|
if (oldValue !== undefined) {
|
|
300
302
|
this.validate();
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/custom-field",
|
|
4
|
-
"version": "24.6.0-
|
|
4
|
+
"version": "24.6.0-alpha4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "value",
|
|
103
|
-
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
103
|
+
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
104
104
|
"value": {
|
|
105
105
|
"type": [
|
|
106
106
|
"string",
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
"name": "value",
|
|
216
|
-
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
216
|
+
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
217
217
|
"value": {
|
|
218
218
|
"type": [
|
|
219
219
|
"string",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/custom-field",
|
|
4
|
-
"version": "24.6.0-
|
|
4
|
+
"version": "24.6.0-alpha4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"name": ".value",
|
|
80
|
-
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
80
|
+
"description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
81
81
|
"value": {
|
|
82
82
|
"kind": "expression"
|
|
83
83
|
}
|