@vaadin/component-base 25.0.0-alpha16 → 25.0.0-alpha17
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/define.js +1 -1
- package/src/polylit-mixin.js +0 -16
- package/src/styles/style-props.js +8 -6
- package/src/tooltip-controller.js +20 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/component-base",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
35
35
|
"@vaadin/vaadin-development-mode-detector": "^2.0.0",
|
|
36
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
36
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha17",
|
|
37
37
|
"@vaadin/vaadin-usage-statistics": "^2.1.0",
|
|
38
38
|
"lit": "^3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
42
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
41
|
+
"@vaadin/chai-plugins": "25.0.0-alpha17",
|
|
42
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha17",
|
|
43
43
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
44
|
-
"sinon": "^
|
|
44
|
+
"sinon": "^21.0.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "8264c71309907be99368b09414f0f8d7f591e0b9"
|
|
47
47
|
}
|
package/src/define.js
CHANGED
|
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
|
|
|
13
13
|
|
|
14
14
|
const experimentalMap = {};
|
|
15
15
|
|
|
16
|
-
export function defineCustomElement(CustomElement, version = '25.0.0-
|
|
16
|
+
export function defineCustomElement(CustomElement, version = '25.0.0-alpha17') {
|
|
17
17
|
Object.defineProperty(CustomElement, 'version', {
|
|
18
18
|
get() {
|
|
19
19
|
return version;
|
package/src/polylit-mixin.js
CHANGED
|
@@ -215,26 +215,10 @@ const PolylitMixinImplementation = (superclass) => {
|
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
constructor() {
|
|
219
|
-
super();
|
|
220
|
-
this.__hasPolylitMixin = true;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
218
|
/** @protected */
|
|
224
219
|
connectedCallback() {
|
|
225
220
|
super.connectedCallback();
|
|
226
221
|
|
|
227
|
-
// Components like `vaadin-overlay` are teleported to the body element when opened.
|
|
228
|
-
// If their opened state is set as an attribute, the teleportation happens immediately
|
|
229
|
-
// after they are connected to the DOM. This means they will be outside the scope of
|
|
230
|
-
// querySelectorAll in the parent component's `firstUpdated()`. To ensure their reference
|
|
231
|
-
// is still registered in the $ map, we propagate the reference here.
|
|
232
|
-
const parentHost = this.getRootNode().host;
|
|
233
|
-
if (parentHost && parentHost.__hasPolylitMixin && this.id) {
|
|
234
|
-
parentHost.$ ||= {};
|
|
235
|
-
parentHost.$[this.id] = this;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
222
|
const { polylitConfig } = this.constructor;
|
|
239
223
|
if (!this.hasUpdated && !polylitConfig.asyncFirstRender) {
|
|
240
224
|
this.performUpdate();
|
|
@@ -15,20 +15,20 @@ addGlobalThemeStyles(
|
|
|
15
15
|
--vaadin-background-color: light-dark(#fff, #222);
|
|
16
16
|
|
|
17
17
|
/* Container colors */
|
|
18
|
-
--vaadin-background-container: color-mix(in
|
|
18
|
+
--vaadin-background-container: color-mix(in oklab, var(--vaadin-color) 5%, var(--vaadin-background-color));
|
|
19
19
|
--vaadin-background-container-strong: color-mix(
|
|
20
|
-
in
|
|
20
|
+
in oklab,
|
|
21
21
|
var(--vaadin-color) 10%,
|
|
22
22
|
var(--vaadin-background-color)
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
/* Border colors */
|
|
26
|
-
--vaadin-border-color-subtle: color-mix(in
|
|
27
|
-
--vaadin-border-color: color-mix(in
|
|
26
|
+
--vaadin-border-color-subtle: color-mix(in oklab, var(--vaadin-color) 24%, transparent);
|
|
27
|
+
--vaadin-border-color: color-mix(in oklab, var(--vaadin-color) 48%, transparent); /* Above 3:1 contrast */
|
|
28
28
|
|
|
29
29
|
/* Text colors */
|
|
30
|
-
--vaadin-color-disabled: color-mix(in
|
|
31
|
-
--vaadin-color-subtle: color-mix(in
|
|
30
|
+
--vaadin-color-disabled: color-mix(in oklab, var(--vaadin-color) 48%, transparent); /* Above 3:1 contrast */
|
|
31
|
+
--vaadin-color-subtle: color-mix(in oklab, var(--vaadin-color) 68%, transparent); /* Above 4.5:1 contrast */
|
|
32
32
|
--vaadin-color: light-dark(#1f1f1f, white); /* Above 7:1 contrast */
|
|
33
33
|
|
|
34
34
|
/* Padding */
|
|
@@ -40,9 +40,11 @@ addGlobalThemeStyles(
|
|
|
40
40
|
--vaadin-padding-container: var(--vaadin-padding-xs) var(--vaadin-padding-s);
|
|
41
41
|
|
|
42
42
|
/* Gap/spacing */
|
|
43
|
+
--vaadin-gap-xs: 6px;
|
|
43
44
|
--vaadin-gap-s: 8px;
|
|
44
45
|
--vaadin-gap-m: 12px;
|
|
45
46
|
--vaadin-gap-l: 16px;
|
|
47
|
+
--vaadin-gap-xl: 24px;
|
|
46
48
|
|
|
47
49
|
/* Border radius */
|
|
48
50
|
--vaadin-radius-s: 3px;
|
|
@@ -14,6 +14,7 @@ export class TooltipController extends SlotController {
|
|
|
14
14
|
super(host, 'tooltip');
|
|
15
15
|
|
|
16
16
|
this.setTarget(host);
|
|
17
|
+
this.__onContentChange = this.__onContentChange.bind(this);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -50,17 +51,26 @@ export class TooltipController extends SlotController {
|
|
|
50
51
|
tooltipNode.shouldShow = this.shouldShow;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
this.
|
|
54
|
+
if (!this.manual) {
|
|
55
|
+
this.host.setAttribute('has-tooltip', '');
|
|
56
|
+
}
|
|
57
|
+
this.__notifyChange(tooltipNode);
|
|
58
|
+
tooltipNode.addEventListener('content-changed', this.__onContentChange);
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
/**
|
|
57
62
|
* Override to notify the host when the tooltip is removed.
|
|
58
63
|
*
|
|
64
|
+
* @param {Node} tooltipNode
|
|
59
65
|
* @protected
|
|
60
66
|
* @override
|
|
61
67
|
*/
|
|
62
|
-
teardownNode() {
|
|
63
|
-
this.
|
|
68
|
+
teardownNode(tooltipNode) {
|
|
69
|
+
if (!this.manual) {
|
|
70
|
+
this.host.removeAttribute('has-tooltip');
|
|
71
|
+
}
|
|
72
|
+
tooltipNode.removeEventListener('content-changed', this.__onContentChange);
|
|
73
|
+
this.__notifyChange(null);
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
/**
|
|
@@ -159,7 +169,12 @@ export class TooltipController extends SlotController {
|
|
|
159
169
|
}
|
|
160
170
|
|
|
161
171
|
/** @private */
|
|
162
|
-
|
|
163
|
-
this.
|
|
172
|
+
__onContentChange(event) {
|
|
173
|
+
this.__notifyChange(event.target);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** @private */
|
|
177
|
+
__notifyChange(node) {
|
|
178
|
+
this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node } }));
|
|
164
179
|
}
|
|
165
180
|
}
|