@iyulab/components 0.1.9 → 0.1.10
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.10 (2025-12-19)
|
|
4
|
+
- Fixed circular dependency issue between `UMenu` and `UMenuItem`
|
|
5
|
+
- Changed `UMenuItem` to use tagName check instead of `instanceof` for submenu detection
|
|
6
|
+
|
|
3
7
|
## 0.1.9 (2025-12-19)
|
|
4
8
|
- Added `Tree`, `TreeItem` components for hierarchical data display
|
|
5
9
|
- Updated React wrapper plugin to support new file structure
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { state, property } from 'lit/decorators.js';
|
|
3
3
|
import { BaseElement } from '../BaseElement.js';
|
|
4
|
-
import { UMenu } from '../menu/UMenu.component.js';
|
|
5
4
|
import { styles } from './UMenuItem.styles.js';
|
|
6
5
|
|
|
7
6
|
var __defProp = Object.defineProperty;
|
|
@@ -23,15 +22,20 @@ class UMenuItem extends BaseElement {
|
|
|
23
22
|
this.value = "";
|
|
24
23
|
this.handleSubmenuSlotChange = (e) => {
|
|
25
24
|
const slot = e.target;
|
|
26
|
-
const elements = slot.assignedElements({ flatten: true })
|
|
25
|
+
const elements = slot.assignedElements({ flatten: true });
|
|
27
26
|
if (elements.length !== 1) {
|
|
28
|
-
console.warn(`when using
|
|
27
|
+
console.warn(`when using submenu, there must be exactly one UMenu component in the 'submenu' slot.`);
|
|
29
28
|
this.isNested = false;
|
|
30
29
|
} else {
|
|
31
30
|
const submenu = elements[0];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if ("anchor" in submenu && "type" in submenu) {
|
|
32
|
+
submenu.anchor = this;
|
|
33
|
+
submenu.type = "submenu";
|
|
34
|
+
this.isNested = true;
|
|
35
|
+
} else {
|
|
36
|
+
console.warn(`the element assigned to the 'submenu' slot is not a valid UMenu component.`);
|
|
37
|
+
this.isNested = false;
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
};
|
|
37
41
|
}
|