@vaadin/card 25.1.0-beta1 → 25.1.0-beta2
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 +12 -12
- package/src/vaadin-card.js +8 -1
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/card",
|
|
3
|
-
"version": "25.1.0-
|
|
3
|
+
"version": "25.1.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"web-component"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vaadin/component-base": "25.1.0-
|
|
38
|
-
"@vaadin/vaadin-themable-mixin": "25.1.0-
|
|
37
|
+
"@vaadin/component-base": "25.1.0-beta2",
|
|
38
|
+
"@vaadin/vaadin-themable-mixin": "25.1.0-beta2",
|
|
39
39
|
"lit": "^3.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@vaadin/aura": "25.1.0-
|
|
43
|
-
"@vaadin/avatar": "25.1.0-
|
|
44
|
-
"@vaadin/button": "25.1.0-
|
|
45
|
-
"@vaadin/chai-plugins": "25.1.0-
|
|
46
|
-
"@vaadin/icon": "25.1.0-
|
|
47
|
-
"@vaadin/icons": "25.1.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.1.0-
|
|
42
|
+
"@vaadin/aura": "25.1.0-beta2",
|
|
43
|
+
"@vaadin/avatar": "25.1.0-beta2",
|
|
44
|
+
"@vaadin/button": "25.1.0-beta2",
|
|
45
|
+
"@vaadin/chai-plugins": "25.1.0-beta2",
|
|
46
|
+
"@vaadin/icon": "25.1.0-beta2",
|
|
47
|
+
"@vaadin/icons": "25.1.0-beta2",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.1.0-beta2",
|
|
49
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "25.1.0-
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "25.1.0-beta2",
|
|
51
51
|
"sinon": "^21.0.0"
|
|
52
52
|
},
|
|
53
53
|
"customElements": "custom-elements.json",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"web-types.json",
|
|
56
56
|
"web-types.lit.json"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ffbedbae08a5160d13bcd1c6fcaa328df5103a05"
|
|
59
59
|
}
|
package/src/vaadin-card.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { isEmptyTextNode } from '@vaadin/component-base/src/dom-utils.js';
|
|
8
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
11
|
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
@@ -157,13 +158,19 @@ class Card extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(Li
|
|
|
157
158
|
);
|
|
158
159
|
this.toggleAttribute('_hp', this.querySelector(':scope > [slot="header-prefix"]'));
|
|
159
160
|
this.toggleAttribute('_hs', this.querySelector(':scope > [slot="header-suffix"]'));
|
|
160
|
-
this.toggleAttribute('_c', this.
|
|
161
|
+
this.toggleAttribute('_c', this.__hasContent());
|
|
161
162
|
this.toggleAttribute('_f', this.querySelector(':scope > [slot="footer"]'));
|
|
162
163
|
if (this.__getCustomTitleElement()) {
|
|
163
164
|
this.__clearStringTitle();
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
/** @private */
|
|
169
|
+
__hasContent() {
|
|
170
|
+
const slot = this.shadowRoot.querySelector('slot:not([name])');
|
|
171
|
+
return slot.assignedNodes({ flatten: true }).filter((node) => !isEmptyTextNode(node)).length > 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
167
174
|
/** @private */
|
|
168
175
|
__clearStringTitle() {
|
|
169
176
|
const stringTitleElement = this.__getStringTitleElement();
|
package/web-types.json
CHANGED