@uniai-fe/uds-templates 0.3.8 → 0.3.10
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
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
|
@@ -25,12 +25,11 @@ import { PAGE_FRAME_DESKTOP_SETTING_ITEMS } from "../../../../data/setting";
|
|
|
25
25
|
* @property {string} [props.className] 사용자 정의 className
|
|
26
26
|
* @property {PageFrameDesktopSettingItem[]} [props.items] dropdown 항목 배열
|
|
27
27
|
* @description
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* - 비밀번호 재설정
|
|
28
|
+
* - 내 정보 관리
|
|
29
|
+
* - 내 농장 관리
|
|
30
|
+
* - 기본 정보
|
|
31
|
+
* - 인증 정보
|
|
32
|
+
* - 시설 정보
|
|
34
33
|
*/
|
|
35
34
|
export default function PageHeaderSettingButton({
|
|
36
35
|
className,
|
|
@@ -46,17 +45,43 @@ export default function PageHeaderSettingButton({
|
|
|
46
45
|
() => getClosestRoute(menuItems, resolvedPath),
|
|
47
46
|
[menuItems, resolvedPath],
|
|
48
47
|
);
|
|
48
|
+
const commonRoute = useMemo(() => {
|
|
49
|
+
const routes = menuItems.map(({ path }) => path.split("/").filter(Boolean));
|
|
50
|
+
|
|
51
|
+
// route 각 index 아이템이 가장 많이 겹치는 route 추출
|
|
52
|
+
const maxLength = Math.max(...routes.map(route => route.length));
|
|
53
|
+
const res = Array(maxLength)
|
|
54
|
+
.fill("")
|
|
55
|
+
.map((_, index) => {
|
|
56
|
+
const current = routes[0][index] ?? "";
|
|
57
|
+
if (routes.every(route => route[index] === current)) {
|
|
58
|
+
return current;
|
|
59
|
+
}
|
|
60
|
+
return "";
|
|
61
|
+
})
|
|
62
|
+
.filter(Boolean);
|
|
63
|
+
return `/${res.join("/")}`;
|
|
64
|
+
}, [menuItems]);
|
|
65
|
+
|
|
66
|
+
const isMatchRouteGroup = useMemo(
|
|
67
|
+
() => pathname.startsWith(commonRoute),
|
|
68
|
+
[pathname, commonRoute],
|
|
69
|
+
);
|
|
49
70
|
|
|
50
71
|
const dropdownItems: DropdownTemplateItem[] = useMemo(
|
|
51
72
|
() =>
|
|
52
73
|
menuItems.map(item => ({
|
|
53
74
|
id: item.routeKey,
|
|
75
|
+
// 변경: Dropdown.Template value-first 계약에 맞춰 routeKey를 value로도 전달한다.
|
|
76
|
+
value: item.routeKey,
|
|
54
77
|
label: item.name,
|
|
55
78
|
left: item.icon,
|
|
56
79
|
// 변경: Dropdown.Template 선택 계약은 items[].selected를 source로 사용한다.
|
|
57
|
-
selected:
|
|
80
|
+
selected:
|
|
81
|
+
isMatchRouteGroup &&
|
|
82
|
+
String(closestRoute?.routeKey) === String(item.routeKey),
|
|
58
83
|
})),
|
|
59
|
-
[closestRoute?.routeKey
|
|
84
|
+
[menuItems, isMatchRouteGroup, closestRoute?.routeKey],
|
|
60
85
|
);
|
|
61
86
|
|
|
62
87
|
/**
|
|
@@ -65,9 +90,8 @@ export default function PageHeaderSettingButton({
|
|
|
65
90
|
*/
|
|
66
91
|
const handleSelect = useCallback(
|
|
67
92
|
(payload: DropdownTemplateChangePayload) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
);
|
|
93
|
+
const currentRouteKey = String(payload.currentValue);
|
|
94
|
+
const target = menuItems.find(item => item.routeKey === currentRouteKey);
|
|
71
95
|
target?.onSelect?.();
|
|
72
96
|
},
|
|
73
97
|
[menuItems],
|
|
@@ -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;
|