@team-monolith/cds 1.80.2 → 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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css, useTheme } from "@emotion/react";
|
|
4
|
-
import { AlertDialog, AlertDialogActions, AlertDialogContent, AlertDialogTitle } from "./AlertDialog";
|
|
4
|
+
import { AlertDialog, AlertDialogActions, AlertDialogContent, AlertDialogTitle, } from "./AlertDialog";
|
|
5
5
|
import { AlertFillIcon } from "../icons";
|
|
6
6
|
import { Button } from "./Button";
|
|
7
7
|
export function FileTypeAlertDialog(props) {
|
|
@@ -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,
|
|
@@ -15,7 +15,7 @@ import styled from "@emotion/styled";
|
|
|
15
15
|
import { FileTypeAlertDialog } from "../../../components/FileTypeAlertDialog";
|
|
16
16
|
const fileTypeMap = {
|
|
17
17
|
image: { accept: "image/*", typeStr: "이미지 파일" },
|
|
18
|
-
pdf: { accept: ".pdf", typeStr: "
|
|
18
|
+
pdf: { accept: ".pdf", typeStr: "PDF 파일" },
|
|
19
19
|
file: {},
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
@@ -39,8 +39,8 @@ export function FileSelectInput(props) {
|
|
|
39
39
|
return;
|
|
40
40
|
if (accept) {
|
|
41
41
|
// 특정 파일 타입에 대해서 검사하므로 복수개의 accept는 고려하지 않음
|
|
42
|
-
const isTypeValid = accept.startsWith(
|
|
43
|
-
? accept.slice(1) === ((_b = file.name.split(
|
|
42
|
+
const isTypeValid = accept.startsWith(".")
|
|
43
|
+
? accept.slice(1) === ((_b = file.name.split(".").pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase())
|
|
44
44
|
: file.type.match(accept);
|
|
45
45
|
if (!isTypeValid) {
|
|
46
46
|
event.target.value = "";
|