@vaadin/component-base 24.9.4 → 24.9.6

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/component-base",
3
- "version": "24.9.4",
3
+ "version": "24.9.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,10 +38,10 @@
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "~24.9.4",
42
- "@vaadin/test-runner-commands": "~24.9.4",
41
+ "@vaadin/chai-plugins": "~24.9.6",
42
+ "@vaadin/test-runner-commands": "~24.9.6",
43
43
  "@vaadin/testing-helpers": "^1.1.0",
44
44
  "sinon": "^18.0.0"
45
45
  },
46
- "gitHead": "7084e972641ef2355ffc281cbd932c070f998ed1"
46
+ "gitHead": "04dec563d48efd4e5ca0c0b96687302666ee5ab1"
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 = '24.9.4') {
16
+ export function defineCustomElement(CustomElement, version = '24.9.6') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -129,6 +129,10 @@ export class SlotController extends EventTarget {
129
129
  getSlotChildren() {
130
130
  const { slotName } = this;
131
131
  return Array.from(this.host.childNodes).filter((node) => {
132
+ // Ignore nodes with data-slot-ignore attribute
133
+ if (node.nodeType === Node.ELEMENT_NODE && node.hasAttribute('data-slot-ignore')) {
134
+ return false;
135
+ }
132
136
  // Either an element (any slot) or a text node (only un-named slot).
133
137
  return (
134
138
  (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||
@@ -203,7 +207,13 @@ export class SlotController extends EventTarget {
203
207
 
204
208
  // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:
205
209
  // unlike comment nodes, they are not filtered out. So we need to manually ignore them.
206
- const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));
210
+ // Also ignore nodes with data-slot-ignore attribute.
211
+ const newNodes = addedNodes.filter(
212
+ (node) =>
213
+ !isEmptyTextNode(node) &&
214
+ !current.includes(node) &&
215
+ !(node.nodeType === Node.ELEMENT_NODE && node.hasAttribute('data-slot-ignore')),
216
+ );
207
217
 
208
218
  if (removedNodes.length) {
209
219
  this.nodes = current.filter((node) => !removedNodes.includes(node));