@vaadin/card 25.0.5 → 25.0.7

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/card",
3
- "version": "25.0.5",
3
+ "version": "25.0.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,22 +33,22 @@
33
33
  "web-component"
34
34
  ],
35
35
  "dependencies": {
36
- "@vaadin/component-base": "~25.0.5",
37
- "@vaadin/vaadin-themable-mixin": "~25.0.5",
36
+ "@vaadin/component-base": "~25.0.7",
37
+ "@vaadin/vaadin-themable-mixin": "~25.0.7",
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/aura": "~25.0.5",
42
- "@vaadin/avatar": "~25.0.5",
43
- "@vaadin/chai-plugins": "~25.0.5",
44
- "@vaadin/test-runner-commands": "~25.0.5",
41
+ "@vaadin/aura": "~25.0.7",
42
+ "@vaadin/avatar": "~25.0.7",
43
+ "@vaadin/chai-plugins": "~25.0.7",
44
+ "@vaadin/test-runner-commands": "~25.0.7",
45
45
  "@vaadin/testing-helpers": "^2.0.0",
46
- "@vaadin/vaadin-lumo-styles": "~25.0.5",
46
+ "@vaadin/vaadin-lumo-styles": "~25.0.7",
47
47
  "sinon": "^21.0.0"
48
48
  },
49
49
  "web-types": [
50
50
  "web-types.json",
51
51
  "web-types.lit.json"
52
52
  ],
53
- "gitHead": "f9de924c232acc7b113e9f7f48368e8ca8105f81"
53
+ "gitHead": "8f3a780477d7dbe30fd473470ede41458e5217b9"
54
54
  }
@@ -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.querySelector(':scope > :not([slot])'));
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/card",
4
- "version": "25.0.5",
4
+ "version": "25.0.7",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/card",
4
- "version": "25.0.5",
4
+ "version": "25.0.7",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {