@uniai-fe/uds-templates 0.3.7 → 0.3.9
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/dist/styles.css +4 -2
- package/package.json +1 -1
- package/src/modal/components/dialog/Header.tsx +18 -2
- package/src/modal/components/dialog/Template.tsx +4 -0
- package/src/modal/types/components.ts +10 -0
- package/src/modal/types/templates.ts +5 -0
- package/src/page-frame/desktop/styles/page/common.scss +6 -3
package/dist/styles.css
CHANGED
|
@@ -103,20 +103,21 @@
|
|
|
103
103
|
.page-frame-container {
|
|
104
104
|
width: 100%;
|
|
105
105
|
min-height: 100vh;
|
|
106
|
+
height: 100%;
|
|
106
107
|
background-color: var(--uds-page-frame-background);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
.page-frame-service-frame {
|
|
110
111
|
width: 100%;
|
|
111
112
|
min-height: 100vh;
|
|
113
|
+
height: 100%;
|
|
112
114
|
display: flex;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
.page-frame-service-main {
|
|
116
118
|
width: calc(100% - var(--uds-page-nav-width));
|
|
117
119
|
min-height: 100vh;
|
|
118
|
-
|
|
119
|
-
flex-direction: column;
|
|
120
|
+
height: 100%;
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
.page-frame-service-main-wrapper {
|
|
@@ -124,6 +125,7 @@
|
|
|
124
125
|
height: calc(100% - var(--uds-page-header-height));
|
|
125
126
|
padding: var(--uds-page-body-padding-vertical) var(--uds-page-body-padding-horizontal);
|
|
126
127
|
background-color: var(--uds-page-body-background);
|
|
128
|
+
overflow-y: auto;
|
|
127
129
|
position: relative;
|
|
128
130
|
z-index: 0;
|
|
129
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { useModal } from "../../hooks/useModal";
|
|
5
|
+
import { ModalHeaderCloseButton } from "../core/header/CloseButton";
|
|
4
6
|
|
|
5
7
|
import type { DialogHeaderProps } from "../../types";
|
|
6
8
|
|
|
@@ -13,6 +15,8 @@ import type { DialogHeaderProps } from "../../types";
|
|
|
13
15
|
* @param {"center" | "split"} [props.layout] 헤더 레이아웃
|
|
14
16
|
* @param {React.ReactNode} [props.leadingContent] 타이틀 왼쪽 콘텐츠
|
|
15
17
|
* @param {React.ReactNode} [props.trailingContent] 우측 액션 콘텐츠
|
|
18
|
+
* @param {string} [props.stackKey] 모달 스택 키(기본 닫기 버튼 동작 연결용)
|
|
19
|
+
* @param {boolean} [props.activeCloseButton] 우측 기본 닫기 버튼 활성화 여부
|
|
16
20
|
* @param {string} [props.className] 헤더 className
|
|
17
21
|
* @example
|
|
18
22
|
* <DialogHeader title="제목" description="설명" />
|
|
@@ -23,10 +27,22 @@ export function DialogHeader({
|
|
|
23
27
|
layout = "center",
|
|
24
28
|
leadingContent,
|
|
25
29
|
trailingContent,
|
|
30
|
+
stackKey,
|
|
31
|
+
activeCloseButton = false,
|
|
26
32
|
className,
|
|
27
33
|
}: DialogHeaderProps) {
|
|
34
|
+
const { closeModal } = useModal();
|
|
28
35
|
const hasRight = Boolean(trailingContent);
|
|
29
36
|
const hasDescription = Boolean(description);
|
|
37
|
+
const shouldRenderDefaultCloseButton =
|
|
38
|
+
activeCloseButton && !hasRight && Boolean(stackKey);
|
|
39
|
+
const resolvedTrailingContent = shouldRenderDefaultCloseButton ? (
|
|
40
|
+
<ModalHeaderCloseButton
|
|
41
|
+
onClick={() => closeModal({ stackKey: String(stackKey) })}
|
|
42
|
+
/>
|
|
43
|
+
) : (
|
|
44
|
+
trailingContent
|
|
45
|
+
);
|
|
30
46
|
// 변경: title/description은 string | number일 때만 래핑한다.
|
|
31
47
|
const shouldWrapTitleAsText = ["string", "number"].includes(typeof title);
|
|
32
48
|
const shouldWrapDescriptionAsText = ["string", "number"].includes(
|
|
@@ -56,9 +72,9 @@ export function DialogHeader({
|
|
|
56
72
|
{shouldWrapTitleAsText ? <h3>{title}</h3> : title}
|
|
57
73
|
</div>
|
|
58
74
|
</div>
|
|
59
|
-
{
|
|
75
|
+
{resolvedTrailingContent ? (
|
|
60
76
|
<div className="uds-modal-dialog-header-trailing">
|
|
61
|
-
{
|
|
77
|
+
{resolvedTrailingContent}
|
|
62
78
|
</div>
|
|
63
79
|
) : null}
|
|
64
80
|
</div>
|
|
@@ -44,6 +44,7 @@ function createDialogFormSubmitHandler(stackKey: string): () => void {
|
|
|
44
44
|
* @param {"center" | "split"} [options.headerLayout] 헤더 레이아웃
|
|
45
45
|
* @param {React.ReactNode} [options.headerLeadingContent] 타이틀 왼쪽 콘텐츠
|
|
46
46
|
* @param {React.ReactNode} [options.headerTrailingContent] 우측 액션 콘텐츠
|
|
47
|
+
* @param {boolean} [options.activeCloseButton] 우측 기본 닫기 버튼 표시 여부
|
|
47
48
|
* @param {string} [options.headerClassName] 헤더 className
|
|
48
49
|
* @param {React.ReactNode} [options.customHeader] 완전 커스텀 header
|
|
49
50
|
* @param {React.ReactNode} options.content 본문 콘텐츠
|
|
@@ -66,6 +67,7 @@ export function createDialogModal<FormContext extends FieldValues>({
|
|
|
66
67
|
headerLayout,
|
|
67
68
|
headerLeadingContent,
|
|
68
69
|
headerTrailingContent,
|
|
70
|
+
activeCloseButton,
|
|
69
71
|
headerClassName,
|
|
70
72
|
customHeader,
|
|
71
73
|
content,
|
|
@@ -99,6 +101,8 @@ export function createDialogModal<FormContext extends FieldValues>({
|
|
|
99
101
|
layout={headerLayout}
|
|
100
102
|
leadingContent={headerLeadingContent}
|
|
101
103
|
trailingContent={headerTrailingContent}
|
|
104
|
+
stackKey={stackKey}
|
|
105
|
+
activeCloseButton={activeCloseButton}
|
|
102
106
|
className={headerClassName}
|
|
103
107
|
/>
|
|
104
108
|
) : null);
|
|
@@ -256,6 +256,8 @@ export type AlertContentsProps = {
|
|
|
256
256
|
* @property {ModalDialogHeaderLayout} [layout] 레이아웃 정보
|
|
257
257
|
* @property {ReactNode} [leadingContent] 타이틀 왼쪽 콘텐츠
|
|
258
258
|
* @property {ReactNode} [trailingContent] 우측 액션 콘텐츠
|
|
259
|
+
* @property {string} [stackKey] 모달 스택 키(기본 닫기 버튼 동작 연결용)
|
|
260
|
+
* @property {boolean} [activeCloseButton] 우측 기본 닫기 버튼 활성화 여부
|
|
259
261
|
* @property {string} [className] 추가 className
|
|
260
262
|
*/
|
|
261
263
|
export interface DialogHeaderProps {
|
|
@@ -279,6 +281,14 @@ export interface DialogHeaderProps {
|
|
|
279
281
|
* 우측 액션 콘텐츠
|
|
280
282
|
*/
|
|
281
283
|
trailingContent?: ReactNode;
|
|
284
|
+
/**
|
|
285
|
+
* 모달 스택 키(기본 닫기 버튼 동작 연결용)
|
|
286
|
+
*/
|
|
287
|
+
stackKey?: string;
|
|
288
|
+
/**
|
|
289
|
+
* 우측 기본 닫기 버튼 활성화 여부
|
|
290
|
+
*/
|
|
291
|
+
activeCloseButton?: boolean;
|
|
282
292
|
/**
|
|
283
293
|
* 추가 className
|
|
284
294
|
*/
|
|
@@ -135,6 +135,7 @@ export type AlertTemplateOptions<
|
|
|
135
135
|
* @property {ModalDialogHeaderLayout} [headerLayout] 헤더 레이아웃
|
|
136
136
|
* @property {ReactNode} [headerLeadingContent] 타이틀 왼쪽 콘텐츠
|
|
137
137
|
* @property {ReactNode} [headerTrailingContent] 우측 액션 콘텐츠
|
|
138
|
+
* @property {boolean} [activeCloseButton] 우측 기본 닫기 버튼 표시 여부
|
|
138
139
|
* @property {string} [headerClassName] header 추가 className
|
|
139
140
|
* @property {ReactNode} [customHeader] 완전 커스텀 header
|
|
140
141
|
* @property {ReactNode} content 본문 콘텐츠
|
|
@@ -169,6 +170,10 @@ export type DialogTemplateOptions<
|
|
|
169
170
|
* 우측 액션 콘텐츠
|
|
170
171
|
*/
|
|
171
172
|
headerTrailingContent?: ReactNode;
|
|
173
|
+
/**
|
|
174
|
+
* 우측 기본 닫기 버튼 표시 여부
|
|
175
|
+
*/
|
|
176
|
+
activeCloseButton?: boolean;
|
|
172
177
|
/**
|
|
173
178
|
* header 추가 className
|
|
174
179
|
*/
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
.page-frame-container {
|
|
3
3
|
width: 100%;
|
|
4
4
|
min-height: 100vh;
|
|
5
|
+
height: 100%;
|
|
5
6
|
background-color: var(--uds-page-frame-background);
|
|
6
7
|
}
|
|
7
8
|
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
.page-frame-service-frame {
|
|
10
11
|
width: 100%;
|
|
11
12
|
min-height: 100vh;
|
|
13
|
+
height: 100%;
|
|
12
14
|
display: flex;
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -16,8 +18,9 @@
|
|
|
16
18
|
.page-frame-service-main {
|
|
17
19
|
width: calc(100% - var(--uds-page-nav-width));
|
|
18
20
|
min-height: 100vh;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
height: 100%;
|
|
22
|
+
// display: flex;
|
|
23
|
+
// flex-direction: column;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
// 본문 스크롤 영역: 헤더 높이를 제외하고 padding을 CSS 변수로 제어한다.
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
padding: var(--uds-page-body-padding-vertical)
|
|
28
31
|
var(--uds-page-body-padding-horizontal);
|
|
29
32
|
background-color: var(--uds-page-body-background);
|
|
30
|
-
|
|
33
|
+
overflow-y: auto;
|
|
31
34
|
|
|
32
35
|
position: relative;
|
|
33
36
|
z-index: 0;
|