@uniai-fe/ui-legacy 0.1.28 → 0.1.30
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/package.json
CHANGED
package/src/components.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// 컴포넌트 모듈
|
|
2
|
+
import Field from "./form-field/common";
|
|
2
3
|
import Input from "./form-field/input";
|
|
3
4
|
import Select from "./form-field/select";
|
|
4
5
|
import Button from "./button";
|
|
@@ -20,6 +21,7 @@ import Weather from "./weather/components";
|
|
|
20
21
|
import TextEditor from "./text-editor";
|
|
21
22
|
|
|
22
23
|
export {
|
|
24
|
+
Field,
|
|
23
25
|
Input,
|
|
24
26
|
Select,
|
|
25
27
|
Button,
|
|
@@ -61,7 +61,8 @@ export default function SelectDefault({
|
|
|
61
61
|
if (selectOptionList.length > 0) setOptions([]);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
// 변경 설명: disabled placeholder 옵션도 기본 표시값/빈값 선택 상태로 유지해야 하므로 목록에서 제외하지 않는다.
|
|
65
|
+
setOptions(selectItems);
|
|
65
66
|
}, [selectItems, selectOptionList.length]);
|
|
66
67
|
|
|
67
68
|
const setRegisterValue = useCallback(
|
|
@@ -7,16 +7,29 @@ import ModalFormProvider from "../form/Provider";
|
|
|
7
7
|
|
|
8
8
|
export default function ModalLayoutContainer({
|
|
9
9
|
stackKey,
|
|
10
|
-
modalProps: {
|
|
11
|
-
data,
|
|
12
|
-
isModalForm,
|
|
13
|
-
formOptions,
|
|
14
|
-
formMethods,
|
|
15
|
-
isHeader,
|
|
16
|
-
isNoTitle,
|
|
17
|
-
},
|
|
10
|
+
modalProps: { data, formOptions, formMethods, isHeader, isNoTitle },
|
|
18
11
|
isDraggable,
|
|
19
12
|
}: ModalComponentPropsType) {
|
|
13
|
+
const layoutBody = (
|
|
14
|
+
<>
|
|
15
|
+
<ModalBody body={data?.body} />
|
|
16
|
+
{data?.footerBtns && <ModalFooter btns={data.footerBtns} />}
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// 변경 설명: 신규 formMethods가 있으면 해당 RHF context를 최우선으로 사용하고,
|
|
21
|
+
// 없을 때만 기존 formOptions 기반 provider를 유지해 서비스 호환성을 보존한다.
|
|
22
|
+
const content =
|
|
23
|
+
typeof formMethods !== "undefined" ? (
|
|
24
|
+
<ModalFormProvider formMethods={formMethods}>
|
|
25
|
+
{layoutBody}
|
|
26
|
+
</ModalFormProvider>
|
|
27
|
+
) : typeof formOptions !== "undefined" ? (
|
|
28
|
+
<Form.Provider {...formOptions}>{layoutBody}</Form.Provider>
|
|
29
|
+
) : (
|
|
30
|
+
layoutBody
|
|
31
|
+
);
|
|
32
|
+
|
|
20
33
|
const Layout = (
|
|
21
34
|
<>
|
|
22
35
|
{isHeader && (
|
|
@@ -29,23 +42,9 @@ export default function ModalLayoutContainer({
|
|
|
29
42
|
isNoTitle={isNoTitle}
|
|
30
43
|
/>
|
|
31
44
|
)}
|
|
32
|
-
{
|
|
33
|
-
<Form.Provider {...formOptions}>
|
|
34
|
-
<ModalBody body={data?.body} />
|
|
35
|
-
{data?.footerBtns && <ModalFooter btns={data.footerBtns} />}
|
|
36
|
-
</Form.Provider>
|
|
37
|
-
) : (
|
|
38
|
-
<>
|
|
39
|
-
<ModalBody body={data?.body} />
|
|
40
|
-
{data?.footerBtns && <ModalFooter btns={data.footerBtns} />}
|
|
41
|
-
</>
|
|
42
|
-
)}
|
|
45
|
+
{content}
|
|
43
46
|
</>
|
|
44
47
|
);
|
|
45
48
|
|
|
46
|
-
return
|
|
47
|
-
<ModalFormProvider formMethods={formMethods}>{Layout}</ModalFormProvider>
|
|
48
|
-
) : (
|
|
49
|
-
Layout
|
|
50
|
-
);
|
|
49
|
+
return Layout;
|
|
51
50
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import StyledField from "./form-field/common/styled";
|
|
1
2
|
import StyledInput from "./form-field/input/styled";
|
|
2
3
|
import StyledSelect from "./form-field/select/styled";
|
|
3
4
|
import StyledButton from "./button/styled";
|
|
@@ -14,6 +15,7 @@ import StyledWeather from "./weather/styled";
|
|
|
14
15
|
import StyledTextEditor from "./text-editor/styled";
|
|
15
16
|
|
|
16
17
|
export {
|
|
18
|
+
StyledField,
|
|
17
19
|
StyledInput,
|
|
18
20
|
StyledSelect,
|
|
19
21
|
StyledButton,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LinkProps } from "next/link";
|
|
2
2
|
import type { ButtonDefaultPropsType } from "../button";
|
|
3
|
-
import type { FieldValues } from "react-hook-form";
|
|
3
|
+
import type { FieldValues, UseFormProps, UseFormReturn } from "react-hook-form";
|
|
4
4
|
|
|
5
5
|
// 모달 활성화 타입
|
|
6
6
|
export type ModalShowType = "init" | boolean;
|
|
@@ -69,8 +69,8 @@ export type ModalPropsType = Partial<{
|
|
|
69
69
|
* @deprecated formMethods를 활용할 것.
|
|
70
70
|
*/
|
|
71
71
|
formOptions: Partial<{
|
|
72
|
-
options: UseFormProps<
|
|
73
|
-
callback: (params: UseFormReturn<
|
|
72
|
+
options: UseFormProps<FieldValues>;
|
|
73
|
+
callback: (params: UseFormReturn<FieldValues>) => void | undefined;
|
|
74
74
|
}>;
|
|
75
75
|
/**
|
|
76
76
|
* modal context
|