@vaadin/field-base 24.0.0-alpha2 → 24.0.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-base",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-alpha4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
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-alpha4",
|
|
36
36
|
"lit": "^2.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
41
41
|
"sinon": "^13.0.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "66be46e82c4d0a673859fbc9bdb1581dd89f360c"
|
|
44
44
|
}
|
package/src/error-controller.js
CHANGED
|
@@ -10,17 +10,14 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class ErrorController extends SlotController {
|
|
12
12
|
constructor(host) {
|
|
13
|
-
super(
|
|
14
|
-
|
|
15
|
-
'error-message',
|
|
16
|
-
() => document.createElement('div'),
|
|
17
|
-
(_host, node) => {
|
|
13
|
+
super(host, 'error-message', 'div', {
|
|
14
|
+
initializer: (node) => {
|
|
18
15
|
this.__updateErrorId(node);
|
|
19
16
|
|
|
20
17
|
this.__updateHasError();
|
|
21
18
|
},
|
|
22
|
-
true,
|
|
23
|
-
);
|
|
19
|
+
useUniqueId: true,
|
|
20
|
+
});
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
/**
|
|
@@ -55,7 +52,7 @@ export class ErrorController extends SlotController {
|
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
/**
|
|
58
|
-
* Override to initialize the newly added custom
|
|
55
|
+
* Override to initialize the newly added custom error message.
|
|
59
56
|
*
|
|
60
57
|
* @param {Node} errorNode
|
|
61
58
|
* @protected
|
|
@@ -73,7 +70,7 @@ export class ErrorController extends SlotController {
|
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
/**
|
|
76
|
-
* Override to cleanup
|
|
73
|
+
* Override to cleanup error message node when it's removed.
|
|
77
74
|
*
|
|
78
75
|
* @param {Node} node
|
|
79
76
|
* @protected
|
|
@@ -86,7 +83,7 @@ export class ErrorController extends SlotController {
|
|
|
86
83
|
if (!errorNode && node !== this.defaultNode) {
|
|
87
84
|
errorNode = this.attachDefaultNode();
|
|
88
85
|
|
|
89
|
-
// Run initializer to update default
|
|
86
|
+
// Run initializer to update default error message ID.
|
|
90
87
|
this.initNode(errorNode);
|
|
91
88
|
}
|
|
92
89
|
|
package/src/helper-controller.js
CHANGED
|
@@ -10,8 +10,10 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class HelperController extends SlotController {
|
|
12
12
|
constructor(host) {
|
|
13
|
-
// Do not provide
|
|
14
|
-
super(host, 'helper', null,
|
|
13
|
+
// Do not provide tag name, as we create helper lazily.
|
|
14
|
+
super(host, 'helper', null, {
|
|
15
|
+
useUniqueId: true,
|
|
16
|
+
});
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
get helperId() {
|
|
@@ -106,8 +108,8 @@ export class HelperController extends SlotController {
|
|
|
106
108
|
const hasHelperText = this.__isNotEmpty(helperText);
|
|
107
109
|
|
|
108
110
|
if (hasHelperText && !helperNode) {
|
|
109
|
-
// Set
|
|
110
|
-
this.
|
|
111
|
+
// Set tag name lazily to only create helper node when needed.
|
|
112
|
+
this.tagName = 'div';
|
|
111
113
|
|
|
112
114
|
helperNode = this.attachDefaultNode();
|
|
113
115
|
|
package/src/input-controller.js
CHANGED
|
@@ -10,11 +10,8 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class InputController extends SlotController {
|
|
12
12
|
constructor(host, callback) {
|
|
13
|
-
super(
|
|
14
|
-
host
|
|
15
|
-
'input',
|
|
16
|
-
() => document.createElement('input'),
|
|
17
|
-
(host, node) => {
|
|
13
|
+
super(host, 'input', 'input', {
|
|
14
|
+
initializer: (node, host) => {
|
|
18
15
|
if (host.value) {
|
|
19
16
|
node.setAttribute('value', host.value);
|
|
20
17
|
}
|
|
@@ -29,7 +26,7 @@ export class InputController extends SlotController {
|
|
|
29
26
|
callback(node);
|
|
30
27
|
}
|
|
31
28
|
},
|
|
32
|
-
true,
|
|
33
|
-
);
|
|
29
|
+
useUniqueId: true,
|
|
30
|
+
});
|
|
34
31
|
}
|
|
35
32
|
}
|
package/src/label-controller.js
CHANGED
|
@@ -10,11 +10,8 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class LabelController extends SlotController {
|
|
12
12
|
constructor(host) {
|
|
13
|
-
super(
|
|
14
|
-
|
|
15
|
-
'label',
|
|
16
|
-
() => document.createElement('label'),
|
|
17
|
-
(_host, node) => {
|
|
13
|
+
super(host, 'label', 'label', {
|
|
14
|
+
initializer: (node) => {
|
|
18
15
|
// Set ID attribute or use the existing one.
|
|
19
16
|
this.__updateLabelId(node);
|
|
20
17
|
|
|
@@ -23,8 +20,8 @@ export class LabelController extends SlotController {
|
|
|
23
20
|
|
|
24
21
|
this.__observeLabel(node);
|
|
25
22
|
},
|
|
26
|
-
true,
|
|
27
|
-
);
|
|
23
|
+
useUniqueId: true,
|
|
24
|
+
});
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
/**
|
package/src/label-mixin.js
CHANGED
|
@@ -11,7 +11,7 @@ import { LabelController } from './label-controller.js';
|
|
|
11
11
|
* A mixin to provide label via corresponding property or named slot.
|
|
12
12
|
*
|
|
13
13
|
* @polymerMixin
|
|
14
|
-
* @mixes
|
|
14
|
+
* @mixes ControllerMixin
|
|
15
15
|
*/
|
|
16
16
|
export const LabelMixin = dedupingMixin(
|
|
17
17
|
(superclass) =>
|
|
@@ -10,11 +10,8 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class TextAreaController extends SlotController {
|
|
12
12
|
constructor(host, callback) {
|
|
13
|
-
super(
|
|
14
|
-
host
|
|
15
|
-
'textarea',
|
|
16
|
-
() => document.createElement('textarea'),
|
|
17
|
-
(host, node) => {
|
|
13
|
+
super(host, 'textarea', 'textarea', {
|
|
14
|
+
initializer: (node, host) => {
|
|
18
15
|
const value = host.getAttribute('value');
|
|
19
16
|
if (value) {
|
|
20
17
|
node.value = value;
|
|
@@ -31,7 +28,7 @@ export class TextAreaController extends SlotController {
|
|
|
31
28
|
callback(node);
|
|
32
29
|
}
|
|
33
30
|
},
|
|
34
|
-
true,
|
|
35
|
-
);
|
|
31
|
+
useUniqueId: true,
|
|
32
|
+
});
|
|
36
33
|
}
|
|
37
34
|
}
|