@team-monolith/cds 1.80.3 → 1.80.4
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.
|
@@ -40,6 +40,8 @@ const DropdownItem = React.forwardRef(function DropdownItem(props, ref) {
|
|
|
40
40
|
// 드롭다운 아이템을 클릭하면, 같은 레벨에 있는 다른 아이템들은 모두 닫히도록 설정해야 합니다.
|
|
41
41
|
const handleClick = (e) => {
|
|
42
42
|
e.stopPropagation();
|
|
43
|
+
if (disabled)
|
|
44
|
+
return;
|
|
43
45
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
44
46
|
// 서브메뉴가 없는 드롭다운 아이템 클릭시 상위 메뉴가 닫히는 설정
|
|
45
47
|
if (onCloseOnItemClick && !isSubMenuExist) {
|
|
@@ -31,7 +31,7 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
|
|
|
31
31
|
vertical: "top",
|
|
32
32
|
horizontal: "left",
|
|
33
33
|
}, closeOnItemClick, children, menuCss, itemState = new Map(), setItemState = () => { } } = props, other = __rest(props, ["className", "open", "anchorEl", "onClose", "isNestedMenu", "anchorOrigin", "transformOrigin", "closeOnItemClick", "children", "menuCss", "itemState", "setItemState"]);
|
|
34
|
-
const { nestedIndex } = useContext(DropdownContext);
|
|
34
|
+
const { nestedIndex, onCloseOnItemClick } = useContext(DropdownContext);
|
|
35
35
|
// 드롭다운 메뉴 위치 조정
|
|
36
36
|
const anchorRect = anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.getBoundingClientRect();
|
|
37
37
|
const menuStyle = [
|
|
@@ -64,7 +64,8 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
|
|
|
64
64
|
// 그래서 중첩구조를 파괴하기 위해 Portal을 사용하여 중첩 드롭다운 메뉴를 최상단에 렌더링합니다.
|
|
65
65
|
return (_jsx(Portal, { children: _jsx(DropdownContext.Provider, Object.assign({ value: {
|
|
66
66
|
open,
|
|
67
|
-
onCloseOnItemClick
|
|
67
|
+
// 중첩 드롭다운 메뉴의 onCloseOnItemClick은 상위 드롭다운 메뉴에서 전달된 값 사용
|
|
68
|
+
onCloseOnItemClick,
|
|
68
69
|
nestedIndex,
|
|
69
70
|
itemState,
|
|
70
71
|
setItemState,
|