@team-monolith/cds 1.89.1 → 1.89.3
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
3
|
import { ButtonColor, ButtonSize, ButtonProps } from "../..";
|
|
4
4
|
import { DropdownMenuProps } from "./DropdownMenu";
|
|
5
5
|
import { SerializedStyles } from "@emotion/react";
|
|
@@ -25,7 +25,7 @@ export interface DropdownProps {
|
|
|
25
25
|
/** button에 적용되는 css 스타일 */
|
|
26
26
|
buttonCss?: SerializedStyles;
|
|
27
27
|
/** 버튼 컴포넌트 내 표기될 문자열 */
|
|
28
|
-
label?:
|
|
28
|
+
label?: ReactNode;
|
|
29
29
|
/** 버튼 클릭 시 호출될 콜백 함수 */
|
|
30
30
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
31
31
|
/** 드롭다운 메뉴의 props */
|
|
@@ -30,7 +30,7 @@ export interface DropdownMenuProps {
|
|
|
30
30
|
/** 중첩 드롭다운 메뉴가 아닐 경우 주어주지 않아도 됩니다. */
|
|
31
31
|
itemState?: ItemState;
|
|
32
32
|
setItemState?: React.Dispatch<React.SetStateAction<ItemState>>;
|
|
33
|
-
|
|
33
|
+
disablePortal?: boolean;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1921&t=FwczLZ1IVvskUVbT-0)
|
|
@@ -20,7 +20,7 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
|
|
|
20
20
|
}, transformOrigin = {
|
|
21
21
|
vertical: "top",
|
|
22
22
|
horizontal: "left",
|
|
23
|
-
}, closeOnItemClick, children, menuCss, itemState = EMPTY_MAP, setItemState = () => { },
|
|
23
|
+
}, closeOnItemClick, children, menuCss, itemState = EMPTY_MAP, setItemState = () => { }, disablePortal = false, } = props;
|
|
24
24
|
const { nestedIndex, onCloseOnItemClick } = useContext(DropdownContext);
|
|
25
25
|
// 드롭다운 메뉴 위치 조정
|
|
26
26
|
const menuStyle = css `
|
|
@@ -40,7 +40,7 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
|
|
|
40
40
|
nestedIndex,
|
|
41
41
|
itemState,
|
|
42
42
|
setItemState,
|
|
43
|
-
} }, { children: _jsx(Menu, Object.assign({ className: className, open: open, onClose: onClose, anchorEl: anchorEl, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ref: ref, css: menuStyle,
|
|
43
|
+
} }, { children: _jsx(Menu, Object.assign({ className: className, open: open, onClose: onClose, anchorEl: anchorEl, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ref: ref, css: menuStyle, disablePortal: disablePortal }, { children: children })) })));
|
|
44
44
|
}
|
|
45
45
|
// 중첩 드롭다운 메뉴
|
|
46
46
|
return (_jsx(DropdownContext.Provider, Object.assign({ value: {
|
|
@@ -61,7 +61,7 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
|
|
|
61
61
|
pointer-events: auto;
|
|
62
62
|
}
|
|
63
63
|
`,
|
|
64
|
-
],
|
|
64
|
+
], disablePortal: disablePortal }, { children: children })) })));
|
|
65
65
|
});
|
|
66
66
|
export { DropdownMenu };
|
|
67
67
|
const Menu = styled(Popover)(({ theme }) => css `
|