@vaadin/custom-field 24.2.0-alpha7 → 24.2.0-alpha9
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 +21 -19
- package/src/vaadin-custom-field-mixin.js +20 -1
- package/src/vaadin-custom-field.d.ts +8 -0
- package/src/vaadin-custom-field.js +2 -1
- package/web-types.json +29 -3
- package/web-types.lit.json +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/custom-field",
|
|
3
|
-
"version": "24.2.0-
|
|
3
|
+
"version": "24.2.0-alpha9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/vaadin-lit-custom-field.d.ts",
|
|
25
|
+
"!src/vaadin-lit-custom-field.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -36,31 +38,31 @@
|
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
40
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.2.0-
|
|
40
|
-
"@vaadin/component-base": "24.2.0-
|
|
41
|
-
"@vaadin/field-base": "24.2.0-
|
|
42
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0-
|
|
43
|
-
"@vaadin/vaadin-material-styles": "24.2.0-
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0-
|
|
41
|
+
"@vaadin/a11y-base": "24.2.0-alpha9",
|
|
42
|
+
"@vaadin/component-base": "24.2.0-alpha9",
|
|
43
|
+
"@vaadin/field-base": "24.2.0-alpha9",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "24.2.0-alpha9",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "24.2.0-alpha9",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "24.2.0-alpha9"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
49
|
"@esm-bundle/chai": "^4.3.4",
|
|
48
|
-
"@vaadin/combo-box": "24.2.0-
|
|
49
|
-
"@vaadin/date-picker": "24.2.0-
|
|
50
|
-
"@vaadin/email-field": "24.2.0-
|
|
51
|
-
"@vaadin/form-layout": "24.2.0-
|
|
52
|
-
"@vaadin/number-field": "24.2.0-
|
|
53
|
-
"@vaadin/password-field": "24.2.0-
|
|
54
|
-
"@vaadin/select": "24.2.0-
|
|
55
|
-
"@vaadin/testing-helpers": "^0.
|
|
56
|
-
"@vaadin/text-area": "24.2.0-
|
|
57
|
-
"@vaadin/text-field": "24.2.0-
|
|
58
|
-
"@vaadin/time-picker": "24.2.0-
|
|
50
|
+
"@vaadin/combo-box": "24.2.0-alpha9",
|
|
51
|
+
"@vaadin/date-picker": "24.2.0-alpha9",
|
|
52
|
+
"@vaadin/email-field": "24.2.0-alpha9",
|
|
53
|
+
"@vaadin/form-layout": "24.2.0-alpha9",
|
|
54
|
+
"@vaadin/number-field": "24.2.0-alpha9",
|
|
55
|
+
"@vaadin/password-field": "24.2.0-alpha9",
|
|
56
|
+
"@vaadin/select": "24.2.0-alpha9",
|
|
57
|
+
"@vaadin/testing-helpers": "^0.5.0",
|
|
58
|
+
"@vaadin/text-area": "24.2.0-alpha9",
|
|
59
|
+
"@vaadin/text-field": "24.2.0-alpha9",
|
|
60
|
+
"@vaadin/time-picker": "24.2.0-alpha9",
|
|
59
61
|
"sinon": "^13.0.2"
|
|
60
62
|
},
|
|
61
63
|
"web-types": [
|
|
62
64
|
"web-types.json",
|
|
63
65
|
"web-types.lit.json"
|
|
64
66
|
],
|
|
65
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "e9765733fea96542e379e02e6f42b07145893140"
|
|
66
68
|
}
|
|
@@ -105,6 +105,19 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
105
105
|
parseValue: {
|
|
106
106
|
type: Function,
|
|
107
107
|
},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether the field is dirty.
|
|
111
|
+
*
|
|
112
|
+
* The field is automatically marked as dirty once the user triggers
|
|
113
|
+
* an `input` or `change` event. Additionally, the field can be manually
|
|
114
|
+
* marked as dirty by setting the property to `true`.
|
|
115
|
+
*/
|
|
116
|
+
dirty: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
value: false,
|
|
119
|
+
notify: true,
|
|
120
|
+
},
|
|
108
121
|
};
|
|
109
122
|
}
|
|
110
123
|
|
|
@@ -210,9 +223,15 @@ export const CustomFieldMixin = (superClass) =>
|
|
|
210
223
|
}
|
|
211
224
|
|
|
212
225
|
/** @protected */
|
|
213
|
-
|
|
226
|
+
_onInput() {
|
|
227
|
+
this.dirty = true;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** @protected */
|
|
231
|
+
_onChange(event) {
|
|
214
232
|
// Stop native change events
|
|
215
233
|
event.stopPropagation();
|
|
234
|
+
this.dirty = true;
|
|
216
235
|
|
|
217
236
|
this.__setValue();
|
|
218
237
|
this.validate();
|
|
@@ -16,6 +16,11 @@ export type CustomFieldChangeEvent = Event & {
|
|
|
16
16
|
target: CustomField;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Fired when the `dirty` property changes.
|
|
21
|
+
*/
|
|
22
|
+
export type CustomFieldDirtyChangedEvent = CustomEvent<{ value: boolean }>;
|
|
23
|
+
|
|
19
24
|
/**
|
|
20
25
|
* Fired when the `invalid` property changes.
|
|
21
26
|
*/
|
|
@@ -39,6 +44,8 @@ export type CustomFieldInternalTabEvent = Event & {
|
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
export interface CustomFieldCustomEventMap {
|
|
47
|
+
'dirty-changed': CustomFieldDirtyChangedEvent;
|
|
48
|
+
|
|
42
49
|
'invalid-changed': CustomFieldInvalidChangedEvent;
|
|
43
50
|
|
|
44
51
|
'value-changed': CustomFieldValueChangedEvent;
|
|
@@ -91,6 +98,7 @@ export interface CustomFieldEventMap extends HTMLElementEventMap, CustomFieldCus
|
|
|
91
98
|
*
|
|
92
99
|
* @fires {Event} change - Fired when the user commits a value change for any of the internal inputs.
|
|
93
100
|
* @fires {Event} internal-tab - Fired on Tab keydown triggered from the internal inputs, meaning focus will not leave the inputs.
|
|
101
|
+
* @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
|
|
94
102
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
95
103
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
96
104
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
@@ -50,6 +50,7 @@ registerStyles('vaadin-custom-field', customFieldStyles, { moduleId: 'vaadin-cus
|
|
|
50
50
|
*
|
|
51
51
|
* @fires {Event} change - Fired when the user commits a value change for any of the internal inputs.
|
|
52
52
|
* @fires {Event} internal-tab - Fired on Tab keydown triggered from the internal inputs, meaning focus will not leave the inputs.
|
|
53
|
+
* @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
|
|
53
54
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
54
55
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
55
56
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
@@ -72,7 +73,7 @@ class CustomField extends CustomFieldMixin(ThemableMixin(ElementMixin(PolymerEle
|
|
|
72
73
|
<span part="required-indicator" aria-hidden="true"></span>
|
|
73
74
|
</div>
|
|
74
75
|
|
|
75
|
-
<div class="inputs-wrapper" on-change="
|
|
76
|
+
<div class="inputs-wrapper" on-change="_onChange" on-input="_onInput">
|
|
76
77
|
<slot id="slot"></slot>
|
|
77
78
|
</div>
|
|
78
79
|
|
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.2.0-
|
|
4
|
+
"version": "24.2.0-alpha9",
|
|
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.2.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.2.0-alpha9/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha9/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
104
104
|
"value": {
|
|
105
105
|
"type": [
|
|
106
106
|
"string",
|
|
@@ -109,6 +109,17 @@
|
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
|
+
{
|
|
113
|
+
"name": "dirty",
|
|
114
|
+
"description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
|
|
115
|
+
"value": {
|
|
116
|
+
"type": [
|
|
117
|
+
"boolean",
|
|
118
|
+
"null",
|
|
119
|
+
"undefined"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
},
|
|
112
123
|
{
|
|
113
124
|
"name": "theme",
|
|
114
125
|
"description": "The theme variants to apply to the component.",
|
|
@@ -213,7 +224,7 @@
|
|
|
213
224
|
},
|
|
214
225
|
{
|
|
215
226
|
"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.2.0-
|
|
227
|
+
"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.2.0-alpha9/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha9/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
217
228
|
"value": {
|
|
218
229
|
"type": [
|
|
219
230
|
"string",
|
|
@@ -241,6 +252,17 @@
|
|
|
241
252
|
"undefined"
|
|
242
253
|
]
|
|
243
254
|
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "dirty",
|
|
258
|
+
"description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
|
|
259
|
+
"value": {
|
|
260
|
+
"type": [
|
|
261
|
+
"boolean",
|
|
262
|
+
"null",
|
|
263
|
+
"undefined"
|
|
264
|
+
]
|
|
265
|
+
}
|
|
244
266
|
}
|
|
245
267
|
],
|
|
246
268
|
"events": [
|
|
@@ -259,6 +281,10 @@
|
|
|
259
281
|
{
|
|
260
282
|
"name": "value-changed",
|
|
261
283
|
"description": "Fired when the `value` property changes."
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "dirty-changed",
|
|
287
|
+
"description": "Fired when the `dirty` property changes."
|
|
262
288
|
}
|
|
263
289
|
]
|
|
264
290
|
}
|
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.2.0-
|
|
4
|
+
"version": "24.2.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -33,6 +33,13 @@
|
|
|
33
33
|
"kind": "expression"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"name": "?dirty",
|
|
38
|
+
"description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
|
|
39
|
+
"value": {
|
|
40
|
+
"kind": "expression"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
36
43
|
{
|
|
37
44
|
"name": ".label",
|
|
38
45
|
"description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
|
|
@@ -77,7 +84,7 @@
|
|
|
77
84
|
},
|
|
78
85
|
{
|
|
79
86
|
"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.2.0-
|
|
87
|
+
"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.2.0-alpha9/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha9/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
|
|
81
88
|
"value": {
|
|
82
89
|
"kind": "expression"
|
|
83
90
|
}
|
|
@@ -123,6 +130,13 @@
|
|
|
123
130
|
"value": {
|
|
124
131
|
"kind": "expression"
|
|
125
132
|
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "@dirty-changed",
|
|
136
|
+
"description": "Fired when the `dirty` property changes.",
|
|
137
|
+
"value": {
|
|
138
|
+
"kind": "expression"
|
|
139
|
+
}
|
|
126
140
|
}
|
|
127
141
|
]
|
|
128
142
|
}
|