@team-monolith/cds 1.109.0 → 1.109.2
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.
|
@@ -13,6 +13,8 @@ export interface AlertDialogOwnProps<RootComponentType extends React.ElementType
|
|
|
13
13
|
icon?: React.ReactNode;
|
|
14
14
|
/** 전달시 아이콘 패딩이 비활성화 됩니다. */
|
|
15
15
|
disableIconPadding?: boolean;
|
|
16
|
+
/** Modal의 zindex를 직접 전달합니다. 미전달시 기본값(ZINDEX.ALERT = 700)이 사용됩니다. */
|
|
17
|
+
zIndex?: number;
|
|
16
18
|
}
|
|
17
19
|
export type AlertDialogProps<RootComponentType extends React.ElementType = AlertDialogTypeMap["defaultComponent"]> = PolymorphicProps<AlertDialogTypeMap<RootComponentType>, RootComponentType>;
|
|
18
20
|
export interface AlertDialogTypeMap<RootComponentType extends React.ElementType = "div"> {
|
|
@@ -20,11 +20,11 @@ import { AlertDialogContext } from "./AlertDialogContext";
|
|
|
20
20
|
import { ZINDEX } from "../../utils/zIndex";
|
|
21
21
|
import { Modal } from "../..";
|
|
22
22
|
export const AlertDialog = React.forwardRef(function AlertDialog(props, ref) {
|
|
23
|
-
const { className, component: Component = "div", open, onClose, children, icon, disableIconPadding } = props, other = __rest(props, ["className", "component", "open", "onClose", "children", "icon", "disableIconPadding"]);
|
|
23
|
+
const { className, component: Component = "div", open, onClose, children, icon, disableIconPadding, zIndex } = props, other = __rest(props, ["className", "component", "open", "onClose", "children", "icon", "disableIconPadding", "zIndex"]);
|
|
24
24
|
const theme = useTheme();
|
|
25
25
|
const paddingAreaName = disableIconPadding ? "content" : "iconPadding";
|
|
26
26
|
return (_jsx(Modal, Object.assign({ open: open, onClose: onClose, ref: ref, sx: {
|
|
27
|
-
zIndex: ZINDEX.ALERT,
|
|
27
|
+
zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : ZINDEX.ALERT,
|
|
28
28
|
} }, other, { children: _jsxs(Component, { className: className, css: css `
|
|
29
29
|
width: 480px;
|
|
30
30
|
max-height: calc(100% - 48px);
|
|
@@ -11,10 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
13
13
|
/** @jsxImportSource @emotion/react */
|
|
14
|
-
import { css } from "@emotion/react";
|
|
14
|
+
import { css, useTheme } from "@emotion/react";
|
|
15
15
|
import * as React from "react";
|
|
16
16
|
import styled from "@emotion/styled";
|
|
17
|
-
import { CheckboxInput, ArrowRightSLineIcon, HOVER, RESET_BUTTON, } from "../../..";
|
|
17
|
+
import { CheckboxInput, ArrowRightSLineIcon, HOVER, RESET_BUTTON, OverflowTooltip, } from "../../..";
|
|
18
18
|
import { useContext, useId, useRef } from "react";
|
|
19
19
|
import { DropdownMenu } from "../DropdownMenu";
|
|
20
20
|
import { DropdownContext } from "../DropdownContext";
|
|
@@ -31,6 +31,7 @@ const DropdownItem = React.forwardRef(function DropdownItem(props, ref) {
|
|
|
31
31
|
const itemRef = useRef(null);
|
|
32
32
|
const { open, onCloseOnItemClick, nestedIndex, itemState, setItemState } = useContext(DropdownContext);
|
|
33
33
|
const dropdownMenuId = `dropdown-menu-${useId()}`;
|
|
34
|
+
const theme = useTheme();
|
|
34
35
|
const absItemIndex = nestedIndex ? `${nestedIndex}-${index}` : `${index}`;
|
|
35
36
|
// 서브메뉴가 존재하는지 여부
|
|
36
37
|
const isSubMenuExist = Boolean(children);
|
|
@@ -61,7 +62,12 @@ const DropdownItem = React.forwardRef(function DropdownItem(props, ref) {
|
|
|
61
62
|
}
|
|
62
63
|
: {}), { children: _jsxs(Item, { ref: itemRef, disabled: disabled, selected: isSubMenuShowed || Boolean(active), children: [_jsxs(LeftWrapper, { children: [checkbox && (_jsx(StyledCheckboxInput, Object.assign({}, checkboxProps, { disabled: disabled, onClick: (e) => {
|
|
63
64
|
e.stopPropagation();
|
|
64
|
-
} }))), startIcon && (_jsx(IconDiv, { type: type, preserveIconColor: preserveIconColor, children: startIcon })), _jsx(LabelDiv, { css: labelCss, type: type, children:
|
|
65
|
+
} }))), startIcon && (_jsx(IconDiv, { type: type, preserveIconColor: preserveIconColor, children: startIcon })), _jsx(LabelDiv, { css: labelCss, type: type, children: _jsx(OverflowTooltip, { text: label, childrenCss: css `
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
font-family: ${theme.fontFamily.ui};
|
|
69
|
+
color: ${TYPE_TO_COLOR(theme, type)};
|
|
70
|
+
` }) })] }), endIcon && (_jsx(IconDiv, { type: type, preserveIconColor: preserveIconColor, children: endIcon })), !endIcon && isSubMenuExist && (_jsx(IconDiv, { type: type, preserveIconColor: preserveIconColor, children: _jsx(ArrowRightSLineIcon, {}) }))] }) })), isSubMenuExist && (_jsx(DropdownContext.Provider, { value: {
|
|
65
71
|
open,
|
|
66
72
|
onCloseOnItemClick,
|
|
67
73
|
nestedIndex: absItemIndex,
|
|
@@ -93,9 +99,9 @@ const IconDiv = styled("div", {
|
|
|
93
99
|
}
|
|
94
100
|
`);
|
|
95
101
|
const LabelDiv = styled.div `
|
|
102
|
+
flex: 1;
|
|
103
|
+
min-width: 0;
|
|
96
104
|
overflow: hidden;
|
|
97
|
-
text-overflow: ellipsis;
|
|
98
|
-
white-space: nowrap;
|
|
99
105
|
font-size: 14px;
|
|
100
106
|
font-weight: 400;
|
|
101
107
|
font-family: ${({ theme }) => theme.fontFamily.ui};
|
|
@@ -108,6 +114,7 @@ const LeftWrapper = styled.div `
|
|
|
108
114
|
white-space: nowrap;
|
|
109
115
|
gap: 4px;
|
|
110
116
|
flex: 1;
|
|
117
|
+
min-width: 0;
|
|
111
118
|
`;
|
|
112
119
|
const Item = styled.div(({ theme, selected, disabled }) => css `
|
|
113
120
|
background-color: ${theme.color.background.neutralBase};
|