pds-dev-kit-web 1.4.43 → 1.4.46
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/src/desktop/components/ChatList/Body.d.ts +4 -4
- package/dist/src/desktop/components/ChatList/Body.js +21 -12
- package/dist/src/desktop/components/ChatList/ChatList.d.ts +1 -1
- package/dist/src/desktop/components/ChatList/ChatList.js +17 -5
- package/dist/src/desktop/components/ChatList/useAutoScrollToBottom.js +7 -2
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +41 -47
- package/dist/src/desktop/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/desktop/components/Dropdown/Dropdown.js +22 -7
- package/dist/src/desktop/components/FilterBar/FilterBar.js +1 -1
- package/dist/src/mobile/components/ChatList/Body.d.ts +4 -4
- package/dist/src/mobile/components/ChatList/Body.js +30 -25
- package/dist/src/mobile/components/ChatList/ChatList.d.ts +1 -1
- package/dist/src/mobile/components/ChatList/ChatList.js +17 -5
- package/dist/src/mobile/components/ChatList/useAutoScrollToBottom.js +7 -2
- package/dist/src/mobile/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/mobile/components/Dropdown/Dropdown.js +22 -7
- package/package.json +1 -1
- package/release-note.md +3 -7
- package/dist/src/mobile/components/ChatList/useTimeout.d.ts +0 -6
- package/dist/src/mobile/components/ChatList/useTimeout.js +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { Props as ChatListProps } from './ChatList';
|
|
3
|
-
declare
|
|
3
|
+
declare const Body: React.ForwardRefExoticComponent<Pick<ChatListProps, "children" | "scrollVisibleType" | "bodyMBtnText" | "bodySpacingMode"> & {
|
|
4
4
|
isSubmitted: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
callBackAfterScrollToBottom: () => void;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export default Body;
|
|
@@ -30,26 +30,34 @@ var react_1 = __importStar(require("react"));
|
|
|
30
30
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
31
31
|
var MainButton_1 = require("../MainButton");
|
|
32
32
|
var useAutoScrollToBottom_1 = __importDefault(require("./useAutoScrollToBottom"));
|
|
33
|
-
|
|
34
|
-
var scrollVisibleType = _a.scrollVisibleType, children = _a.children, isSubmitted = _a.isSubmitted, bodyMBtnText = _a.bodyMBtnText, bodySpacingMode = _a.bodySpacingMode;
|
|
33
|
+
var Body = react_1.default.forwardRef(function (_a, ref) {
|
|
34
|
+
var scrollVisibleType = _a.scrollVisibleType, children = _a.children, isSubmitted = _a.isSubmitted, bodyMBtnText = _a.bodyMBtnText, bodySpacingMode = _a.bodySpacingMode, callBackAfterScrollToBottom = _a.callBackAfterScrollToBottom;
|
|
35
35
|
var _b = (0, react_1.useState)(false), isButtonShow = _b[0], setIsButtonShow = _b[1];
|
|
36
36
|
var _c = (0, useAutoScrollToBottom_1.default)(), triggerScrollToBottom = _c.triggerScrollToBottom, EndOfList = _c.EndOfList;
|
|
37
|
-
var scrollRef = (0, react_1.useRef)(null);
|
|
38
|
-
var childrenLength = react_1.default.Children.count(children);
|
|
39
37
|
/**
|
|
40
|
-
* @when
|
|
38
|
+
* @when 페이지 진입 시
|
|
41
39
|
* @expected 채팅 리스트의 맨 밑으로 스크롤 내린다.
|
|
42
40
|
* @clear -
|
|
43
41
|
*/
|
|
44
42
|
(0, react_1.useEffect)(function () {
|
|
45
|
-
if (isButtonShow) {
|
|
43
|
+
if (!isButtonShow) {
|
|
44
|
+
triggerScrollToBottom();
|
|
45
|
+
}
|
|
46
|
+
}, [children, isButtonShow, triggerScrollToBottom]);
|
|
47
|
+
/**
|
|
48
|
+
* @when 스크롤을 하고 있지 않은 상황에서 chatMessages가 업데이트 될 때마다
|
|
49
|
+
* @expected 채팅 리스트의 맨 밑으로 스크롤 내린다.
|
|
50
|
+
* @clear -
|
|
51
|
+
*/
|
|
52
|
+
(0, react_1.useEffect)(function () {
|
|
53
|
+
var handleTriggerScroll = function () {
|
|
46
54
|
if (isSubmitted) {
|
|
55
|
+
callBackAfterScrollToBottom();
|
|
47
56
|
triggerScrollToBottom();
|
|
48
57
|
}
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}, [childrenLength, isButtonShow, isSubmitted]);
|
|
58
|
+
};
|
|
59
|
+
setTimeout(function () { return handleTriggerScroll(); }, 0);
|
|
60
|
+
}, [children, isButtonShow, isSubmitted, callBackAfterScrollToBottom]);
|
|
53
61
|
var handleClickMBtn = function () {
|
|
54
62
|
triggerScrollToBottom();
|
|
55
63
|
};
|
|
@@ -62,12 +70,12 @@ function Body(_a) {
|
|
|
62
70
|
setIsButtonShow(true);
|
|
63
71
|
};
|
|
64
72
|
return (react_1.default.createElement(S_Body, { bodySpacingMode: bodySpacingMode },
|
|
65
|
-
react_1.default.createElement(S_ChatMessageBox, { id: "chatMessageBox", onScroll: handleScroll,
|
|
73
|
+
react_1.default.createElement(S_ChatMessageBox, { id: "chatMessageBox", onScroll: handleScroll, scrollVisibleType: scrollVisibleType, ref: ref },
|
|
66
74
|
children,
|
|
67
75
|
react_1.default.createElement(EndOfList, null)),
|
|
68
76
|
isButtonShow && (react_1.default.createElement(S_BottomButtonWrapper, null,
|
|
69
77
|
react_1.default.createElement(MainButton_1.MainButton, { text: bodyMBtnText, size: "small", onClick: handleClickMBtn })))));
|
|
70
|
-
}
|
|
78
|
+
});
|
|
71
79
|
var bodySpacing = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n padding-right: ", ";\n padding-left: ", ";\n"], ["\n box-sizing: border-box;\n padding-right: ", ";\n padding-left: ", ";\n"])), function (_a) {
|
|
72
80
|
var theme = _a.theme;
|
|
73
81
|
return theme.spacing.spacingE;
|
|
@@ -96,4 +104,5 @@ var S_BottomButtonWrapper = styled_components_1.default.div(templateObject_6 ||
|
|
|
96
104
|
return theme.spacing.spacingC;
|
|
97
105
|
});
|
|
98
106
|
exports.default = Body;
|
|
107
|
+
Body.displayName = 'Body';
|
|
99
108
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -41,5 +41,5 @@ export declare type Props = {
|
|
|
41
41
|
onSubmit: (value: string) => void;
|
|
42
42
|
onClickHeaderIBtn1?: () => void;
|
|
43
43
|
};
|
|
44
|
-
declare
|
|
44
|
+
declare const ChatList: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
45
45
|
export default ChatList;
|
|
@@ -49,7 +49,7 @@ var baseBackgroundColors = {
|
|
|
49
49
|
translucent: 'ui_cpnt_list_base_area_translucent',
|
|
50
50
|
transparent: 'ui_cpnt_list_base_area_translucent'
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
var ChatList = react_1.default.forwardRef(function (_a, ref) {
|
|
53
53
|
var _b = _a.styleTheme, styleTheme = _b === void 0 ? 'solid' : _b, _c = _a.headerMode, headerMode = _c === void 0 ? 'use' : _c, titleText = _a.titleText, descText = _a.descText, captionText = _a.captionText, _d = _a.titleStyleTheme, titleStyleTheme = _d === void 0 ? 'subTitleBold' : _d, _e = _a.headerDisplayType, headerDisplayType = _e === void 0 ? 'none' : _e, _f = _a.headerIBtn1IconName, headerIBtn1IconName = _f === void 0 ? 'ic_xmark' : _f, _g = _a.headerIBtn1IconFillType, headerIBtn1IconFillType = _g === void 0 ? 'line' : _g, children = _a.children, _h = _a.textFieldState, textFieldState = _h === void 0 ? 'normal' : _h, textFieldHintText = _a.textFieldHintText, textFieldDefaultText = _a.textFieldDefaultText, textFieldMaxLength = _a.textFieldMaxLength, _j = _a.scrollVisibleType, scrollVisibleType = _j === void 0 ? 'moving' : _j, footerChildren = _a.footerChildren, _k = _a.submitIBtnState, submitIBtnState = _k === void 0 ? 'normal' : _k, bodyMBtnText = _a.bodyMBtnText, _l = _a.bodySpacingMode, bodySpacingMode = _l === void 0 ? 'none' : _l, onSubmit = _a.onSubmit, onClickHeaderIBtn1 = _a.onClickHeaderIBtn1, submitIBtnIconName = _a.submitIBtnIconName, submitIBtnIconFillType = _a.submitIBtnIconFillType, _m = _a.footerIBtn1State, footerIBtn1State = _m === void 0 ? 'normal' : _m, footerIBtn1IconName = _a.footerIBtn1IconName, footerIBtn1IconFillType = _a.footerIBtn1IconFillType, _o = _a.footerIBtn1Type, footerIBtn1Type = _o === void 0 ? 'button' : _o, onClickFooterIBtn1 = _a.onClickFooterIBtn1, _p = _a.footerIBtn2State, footerIBtn2State = _p === void 0 ? 'normal' : _p, footerIBtn2IconName = _a.footerIBtn2IconName, footerIBtn2IconFillType = _a.footerIBtn2IconFillType, _q = _a.footerIBtn2Type, footerIBtn2Type = _q === void 0 ? 'button' : _q, onClickFooterIBtn2 = _a.onClickFooterIBtn2, _r = _a.footerIBtn3State, footerIBtn3State = _r === void 0 ? 'normal' : _r, footerIBtn3IconName = _a.footerIBtn3IconName, footerIBtn3IconFillType = _a.footerIBtn3IconFillType, _s = _a.footerIBtn3Type, footerIBtn3Type = _s === void 0 ? 'button' : _s, footerIBtn3Accept = _a.footerIBtn3Accept, onClickFooterIBtn3 = _a.onClickFooterIBtn3;
|
|
54
54
|
var methods = (0, react_hook_form_1.useForm)({
|
|
55
55
|
mode: 'onChange',
|
|
@@ -57,7 +57,17 @@ function ChatList(_a) {
|
|
|
57
57
|
chat: ''
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
var reset = methods.reset, handleSubmit = methods.handleSubmit, control = methods.control, _t = methods.formState,
|
|
60
|
+
var reset = methods.reset, handleSubmit = methods.handleSubmit, control = methods.control, _t = methods.formState, isDirty = _t.isDirty, isValid = _t.isValid, isSubmitSuccessful = _t.isSubmitSuccessful;
|
|
61
|
+
/**
|
|
62
|
+
* @when 폼 submit이 성공적으로 완료 되었을 때
|
|
63
|
+
* @expected 폼을 초기화합니다.
|
|
64
|
+
* @clear -
|
|
65
|
+
*/
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
67
|
+
if (isSubmitSuccessful) {
|
|
68
|
+
reset();
|
|
69
|
+
}
|
|
70
|
+
}, [isSubmitSuccessful]);
|
|
61
71
|
var inputValue = (0, react_hook_form_1.useWatch)({ name: 'chat', control: control });
|
|
62
72
|
var isSubmitButtonActive = (0, react_1.useMemo)(function () {
|
|
63
73
|
if (!submitIBtnState) {
|
|
@@ -71,20 +81,22 @@ function ChatList(_a) {
|
|
|
71
81
|
return;
|
|
72
82
|
}
|
|
73
83
|
onSubmit(chat);
|
|
74
|
-
|
|
84
|
+
};
|
|
85
|
+
var callBackAfterScrollToBottom = function () {
|
|
86
|
+
reset();
|
|
75
87
|
};
|
|
76
88
|
return (react_1.default.createElement(S_ChatList, { backgroundColor: baseBackgroundColors[styleTheme], id: "chatList" },
|
|
77
89
|
headerMode === 'use' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
78
90
|
react_1.default.createElement(Header_1.default, { styleTheme: styleTheme, titleText: titleText, descText: descText, captionText: captionText, titleStyleTheme: titleStyleTheme, headerDisplayType: headerDisplayType, headerIBtn1IconName: headerIBtn1IconName, headerIBtn1IconFillType: headerIBtn1IconFillType, onClickHeaderIBtn1: onClickHeaderIBtn1 }),
|
|
79
91
|
react_1.default.createElement(hybrid_1.Divider, null))),
|
|
80
|
-
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted:
|
|
92
|
+
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted: isSubmitSuccessful, bodyMBtnText: bodyMBtnText, bodySpacingMode: bodySpacingMode, callBackAfterScrollToBottom: callBackAfterScrollToBottom, ref: ref }, children),
|
|
81
93
|
react_1.default.createElement(hybrid_1.Divider, null),
|
|
82
94
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" }),
|
|
83
95
|
react_1.default.createElement(react_hook_form_1.FormProvider, __assign({}, methods),
|
|
84
96
|
react_1.default.createElement("form", { onSubmit: handleSubmit(handleSubmitChat) },
|
|
85
97
|
react_1.default.createElement(Footer_1.default, { textFieldDefaultText: textFieldDefaultText, textFieldHintText: textFieldHintText, textFieldState: textFieldState, textFieldMaxLength: textFieldMaxLength, footerChildren: footerChildren, isSubmitBtnActive: isSubmitButtonActive, submitIBtnIconName: submitIBtnIconName, submitIBtnIconFillType: submitIBtnIconFillType, footerIBtn1State: footerIBtn1State, footerIBtn1IconName: footerIBtn1IconName, footerIBtn1IconFillType: footerIBtn1IconFillType, footerIBtn1Type: footerIBtn1Type, onClickFooterIBtn1: onClickFooterIBtn1, footerIBtn2State: footerIBtn2State, footerIBtn2IconName: footerIBtn2IconName, footerIBtn2IconFillType: footerIBtn2IconFillType, footerIBtn2Type: footerIBtn2Type, onClickFooterIBtn2: onClickFooterIBtn2, footerIBtn3State: footerIBtn3State, footerIBtn3IconName: footerIBtn3IconName, footerIBtn3IconFillType: footerIBtn3IconFillType, footerIBtn3Type: footerIBtn3Type, footerIBtn3Accept: footerIBtn3Accept, onClickFooterIBtn3: onClickFooterIBtn3 }))),
|
|
86
98
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" })));
|
|
87
|
-
}
|
|
99
|
+
});
|
|
88
100
|
var S_ChatList = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n height: 100%;\n"], ["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n height: 100%;\n"])), function (_a) {
|
|
89
101
|
var backgroundColor = _a.backgroundColor, theme = _a.theme;
|
|
90
102
|
return theme[backgroundColor];
|
|
@@ -32,11 +32,16 @@ function useAutoScrollToBottom(_a) {
|
|
|
32
32
|
(0, react_1.useEffect)(function () {
|
|
33
33
|
if (scrollRef.current) {
|
|
34
34
|
scrollRef.current.scrollIntoView({ behavior: behavior });
|
|
35
|
+
// NOTE: 스크롤을 빠르게 하는 중에 scrollIntoView시 스크롤 영역만큼 렌더가 안되는 이슈에 대한 임시조치
|
|
36
|
+
setTimeout(function () {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: behavior });
|
|
39
|
+
}, 100);
|
|
35
40
|
}
|
|
36
41
|
}, [scrollTrigger]);
|
|
37
|
-
|
|
42
|
+
var triggerScrollToBottom = (0, react_1.useCallback)(function () {
|
|
38
43
|
setScrollTrigger(function (prev) { return !prev; });
|
|
39
|
-
}
|
|
44
|
+
}, []);
|
|
40
45
|
function EndOfList() {
|
|
41
46
|
return react_1.default.createElement("li", { style: { listStyle: 'none', height: heightOfEndOfList + "px" }, ref: scrollRef });
|
|
42
47
|
}
|
|
@@ -35,6 +35,7 @@ function DesktopTabBar(_a) {
|
|
|
35
35
|
var history = (0, react_router_dom_1.useHistory)();
|
|
36
36
|
var pathname = (0, react_router_dom_1.useLocation)().pathname;
|
|
37
37
|
if (itemArray) {
|
|
38
|
+
var isSubTabBarActivated = itemArray.some(function (item) { return item.isActive && item.subArray; });
|
|
38
39
|
var handelClickTabItem_1 = function (item, e) {
|
|
39
40
|
if (item.onClick) {
|
|
40
41
|
item.onClick(e);
|
|
@@ -51,13 +52,14 @@ function DesktopTabBar(_a) {
|
|
|
51
52
|
return (react_1.default.createElement(TextLabel_1.TextLabel, { text: item.title, textAlign: "center", styleTheme: item.isActive ? 'caption1Bold' : 'caption1Regular', colorTheme: item.isActive ? 'usrTextBrandPrimary' : 'sysTextSecondary', singleLineMode: "use" }));
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
|
-
return (react_1.default.createElement(
|
|
55
|
-
itemArray.map(function (item
|
|
56
|
-
react_1.default.createElement(
|
|
57
|
-
item.isActive && item.subArray && (react_1.default.createElement(
|
|
58
|
-
|
|
55
|
+
return (react_1.default.createElement(S_TabBarBox, null,
|
|
56
|
+
react_1.default.createElement(S_MainTabBarSpace, null, itemArray.map(function (item) { return (react_1.default.createElement(S_MainTabItemBox, { key: item.title },
|
|
57
|
+
react_1.default.createElement(S_MainTabItemWrapper, { text: item.title, styleTheme: styleTheme, isActive: item.isActive, onClick: function (e) { return handelClickTabItem_1(item, e); } }, textLabel_1(item, false)),
|
|
58
|
+
item.isActive && item.subArray && (react_1.default.createElement(S_SubTabBarWrapper, null, item.subArray.map(function (subItem) { return (react_1.default.createElement(S_SubTabItemWrapper, { key: subItem.title, text: subItem.title, onClick: function (e) { return handelClickTabItem_1(subItem, e); } }, textLabel_1(subItem, true))); }))))); })),
|
|
59
|
+
isSubTabBarActivated && react_1.default.createElement(S_SubTabBarSpace, null)));
|
|
59
60
|
}
|
|
60
61
|
if (textArray) {
|
|
62
|
+
var isSubTabBarActivated = textArray.some(function (item) { return pathname.includes(item.path) && item.subArray; });
|
|
61
63
|
var handleClick_1 = function (value) {
|
|
62
64
|
if (value) {
|
|
63
65
|
history.push(value.path);
|
|
@@ -74,24 +76,26 @@ function DesktopTabBar(_a) {
|
|
|
74
76
|
return (react_1.default.createElement(TextLabel_1.TextLabel, { text: item.title, textAlign: "center", styleTheme: pathname.includes(item.path) ? 'caption1Bold' : 'caption1Regular', colorTheme: pathname.includes(item.path) ? 'usrTextBrandPrimary' : 'sysTextSecondary', singleLineMode: "use" }));
|
|
75
77
|
}
|
|
76
78
|
};
|
|
77
|
-
return (react_1.default.createElement(
|
|
78
|
-
textArray.map(function (item) { return (react_1.default.createElement(
|
|
79
|
-
react_1.default.createElement(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
item.subArray && pathname.includes(item.path) && (react_1.default.createElement(S_SubTabBox, null, item.subArray.map(function (subItem) { return (react_1.default.createElement(S_SubWrapper, { key: subItem.path, text: subItem.title, onClick: function () {
|
|
83
|
-
handleClick_1(subItem);
|
|
84
|
-
} }, textLabel_2(subItem, true))); }))))); }),
|
|
85
|
-
textArray.map(function (item) {
|
|
86
|
-
return item.subArray && pathname.includes(item.path) && react_1.default.createElement(S_SubBackground, { key: item.path });
|
|
87
|
-
})));
|
|
79
|
+
return (react_1.default.createElement(S_TabBarBox, null,
|
|
80
|
+
react_1.default.createElement(S_MainTabBarSpace, null, textArray.map(function (item) { return (react_1.default.createElement(S_MainTabItemBox, { key: item.path },
|
|
81
|
+
react_1.default.createElement(S_MainTabItemWrapper, { isActive: pathname.includes(item.path), styleTheme: styleTheme, text: item.title, onClick: function () { return handleClick_1(item); } }, textLabel_2(item, false)),
|
|
82
|
+
pathname.includes(item.path) && item.subArray && (react_1.default.createElement(S_SubTabBarWrapper, null, item.subArray.map(function (subItem) { return (react_1.default.createElement(S_SubTabItemWrapper, { key: subItem.title, text: subItem.title, onClick: function () { return handleClick_1(subItem); } }, textLabel_2(subItem, true))); }))))); })),
|
|
83
|
+
isSubTabBarActivated && react_1.default.createElement(S_SubTabBarSpace, null)));
|
|
88
84
|
}
|
|
89
85
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
90
86
|
}
|
|
91
|
-
var
|
|
87
|
+
var S_TabBarBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
88
|
+
var S_MainTabBarSpace = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n height: 40px;\n"], ["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n height: 40px;\n"])), function (_a) {
|
|
92
89
|
var theme = _a.theme;
|
|
93
|
-
return theme.
|
|
90
|
+
return theme.ui_cpnt_tabbar_base_area;
|
|
91
|
+
}, function (_a) {
|
|
92
|
+
var theme = _a.theme;
|
|
93
|
+
return theme.ui_cpnt_divider;
|
|
94
94
|
}, function (_a) {
|
|
95
|
+
var theme = _a.theme;
|
|
96
|
+
return theme.spacing.spacingE;
|
|
97
|
+
});
|
|
98
|
+
var tabIndicator = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &::after {\n background-color: ", ";\n bottom: -1px;\n left: 0px;\n content: '';\n height: 2px;\n position: absolute;\n width: 100%;\n ", ";\n }\n"], ["\n &::after {\n background-color: ", ";\n bottom: -1px;\n left: 0px;\n content: '';\n height: 2px;\n position: absolute;\n width: 100%;\n ", ";\n }\n"])), function (_a) {
|
|
95
99
|
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
96
100
|
return styleTheme === 'content'
|
|
97
101
|
? theme.ui_cpnt_tabbar_border_active_indicator
|
|
@@ -101,51 +105,41 @@ var mediumStyle = (0, styled_components_1.css)(templateObject_1 || (templateObje
|
|
|
101
105
|
return !isActive && "display: none;";
|
|
102
106
|
});
|
|
103
107
|
// NOTE: Tab item 활성화 시 text에 bold가 적용되는데, 이때 font-family에 따라 text 영역의 너비가 변경되어 시각적 변동을 일으키는 문제를 해결하기 위한 처리입니다.
|
|
104
|
-
var textOffset = (0, styled_components_1.css)(
|
|
105
|
-
var text = _a.text;
|
|
106
|
-
return "'" + text + "'";
|
|
107
|
-
});
|
|
108
|
-
var S_TabWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n ", "\n"], ["\n position: relative;\n ", "\n"])), mediumStyle);
|
|
109
|
-
var S_TitleWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n cursor: pointer;\n padding: 0 ", ";\n padding-bottom: ", ";\n\n & > div::before {\n font-weight: ", ";\n ", "\n }\n\n & > div::after {\n font-weight: ", ";\n ", "\n }\n"], ["\n cursor: pointer;\n padding: 0 ", ";\n padding-bottom: ", ";\n\n & > div::before {\n font-weight: ", ";\n ", "\n }\n\n & > div::after {\n font-weight: ", ";\n ", "\n }\n"])), function (_a) {
|
|
108
|
+
var textOffset = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n & > div::before {\n font-weight: ", ";\n display: block;\n content: ", ";\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n & > div::after {\n font-weight: ", ";\n display: block;\n content: ", ";\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n"], ["\n & > div::before {\n font-weight: ", ";\n display: block;\n content: ", ";\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n & > div::after {\n font-weight: ", ";\n display: block;\n content: ", ";\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n"])), function (_a) {
|
|
110
109
|
var theme = _a.theme;
|
|
111
|
-
return theme.
|
|
110
|
+
return theme.fontWeight.normal;
|
|
112
111
|
}, function (_a) {
|
|
113
|
-
var
|
|
114
|
-
return
|
|
112
|
+
var text = _a.text;
|
|
113
|
+
return "'" + text + "'";
|
|
115
114
|
}, function (_a) {
|
|
116
|
-
var theme = _a.theme;
|
|
117
|
-
return theme.fontWeight.normal;
|
|
118
|
-
}, textOffset, function (_a) {
|
|
119
115
|
var theme = _a.theme;
|
|
120
116
|
return theme.fontWeight.bold;
|
|
121
|
-
}, textOffset);
|
|
122
|
-
var S_TabBox = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n position: relative;\n height: 40px;\n"], ["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n position: relative;\n height: 40px;\n"])), function (_a) {
|
|
123
|
-
var theme = _a.theme;
|
|
124
|
-
return theme.ui_cpnt_tabbar_base_area;
|
|
125
117
|
}, function (_a) {
|
|
118
|
+
var text = _a.text;
|
|
119
|
+
return "'" + text + "'";
|
|
120
|
+
});
|
|
121
|
+
var S_MainTabItemBox = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n"], ["\n margin-right: ", ";\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n"])), function (_a) {
|
|
126
122
|
var theme = _a.theme;
|
|
127
|
-
return theme.
|
|
123
|
+
return theme.spacing.spacingD;
|
|
124
|
+
});
|
|
125
|
+
var S_MainTabItemWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-end;\n display: flex;\n height: 100%;\n box-sizing: border-box;\n padding: 0 ", ";\n padding-bottom: ", ";\n cursor: pointer;\n\n ", "\n ", "\n"], ["\n align-items: flex-end;\n display: flex;\n height: 100%;\n box-sizing: border-box;\n padding: 0 ", ";\n padding-bottom: ", ";\n cursor: pointer;\n\n ", "\n ", "\n"])), function (_a) {
|
|
126
|
+
var theme = _a.theme;
|
|
127
|
+
return theme.spacing.spacingA;
|
|
128
128
|
}, function (_a) {
|
|
129
129
|
var theme = _a.theme;
|
|
130
|
-
return theme.spacing.
|
|
131
|
-
});
|
|
132
|
-
var
|
|
130
|
+
return theme.spacing.spacingB;
|
|
131
|
+
}, tabIndicator, textOffset);
|
|
132
|
+
var S_SubTabBarWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: max-content;\n position: absolute;\n bottom: -33px;\n left: 0px;\n height: 32px;\n display: flex;\n"], ["\n width: max-content;\n position: absolute;\n bottom: -33px;\n left: 0px;\n height: 32px;\n display: flex;\n"])));
|
|
133
|
+
var S_SubTabBarSpace = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: 32px;\n background-color: ", ";\n"], ["\n height: 32px;\n background-color: ", ";\n"])), function (_a) {
|
|
133
134
|
var theme = _a.theme;
|
|
134
135
|
return theme.ui_cpnt_tabbar_base_area_sub;
|
|
135
136
|
});
|
|
136
|
-
var
|
|
137
|
-
var S_SubWrapper = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n margin-right: ", ";\n position: relative;\n padding: 0 ", ";\n\n &:last-child {\n margin-right: 0;\n }\n\n & > div::before {\n font-weight: ", ";\n ", "\n }\n\n & > div::after {\n font-weight: ", ";\n ", "\n }\n"], ["\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n margin-right: ", ";\n position: relative;\n padding: 0 ", ";\n\n &:last-child {\n margin-right: 0;\n }\n\n & > div::before {\n font-weight: ", ";\n ", "\n }\n\n & > div::after {\n font-weight: ", ";\n ", "\n }\n"])), function (_a) {
|
|
137
|
+
var S_SubTabItemWrapper = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n margin-right: ", ";\n padding: 0 ", ";\n\n &:last-child {\n margin-right: 0;\n }\n\n ", "\n"], ["\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n margin-right: ", ";\n padding: 0 ", ";\n\n &:last-child {\n margin-right: 0;\n }\n\n ", "\n"])), function (_a) {
|
|
138
138
|
var theme = _a.theme;
|
|
139
139
|
return theme.spacing.spacingE;
|
|
140
140
|
}, function (_a) {
|
|
141
141
|
var theme = _a.theme;
|
|
142
142
|
return theme.spacing.spacingA;
|
|
143
|
-
}, function (_a) {
|
|
144
|
-
var theme = _a.theme;
|
|
145
|
-
return theme.fontWeight.normal;
|
|
146
|
-
}, textOffset, function (_a) {
|
|
147
|
-
var theme = _a.theme;
|
|
148
|
-
return theme.fontWeight.bold;
|
|
149
143
|
}, textOffset);
|
|
150
144
|
exports.default = DesktopTabBar;
|
|
151
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
145
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -9,7 +9,7 @@ declare type Props = {
|
|
|
9
9
|
hintText?: TFunctionResult;
|
|
10
10
|
maxHeightItemNumber?: number;
|
|
11
11
|
defaultValue?: PDSValueOption;
|
|
12
|
-
value?: PDSValueOption;
|
|
12
|
+
value?: PDSValueOption | null;
|
|
13
13
|
responsiveMode?: 'none' | 'use';
|
|
14
14
|
size?: 'large' | 'small';
|
|
15
15
|
state?: 'normal' | 'read_only' | 'disabled';
|
|
@@ -37,17 +37,32 @@ function Dropdown(_a) {
|
|
|
37
37
|
// selectionMode = 'single',
|
|
38
38
|
size = _e === void 0 ? 'large' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, valueArray = _a.valueArray, customWidth = _a.customWidth, onChange = _a.onChange;
|
|
39
39
|
var _g = (0, react_1.useState)(false), isFocused = _g[0], setIsFocused = _g[1];
|
|
40
|
-
var _h = (0, react_1.useState)(
|
|
40
|
+
var _h = (0, react_1.useState)(null), selectedValue = _h[0], setSelectedValue = _h[1];
|
|
41
|
+
/**
|
|
42
|
+
* @when value 프롭의 값에 따라
|
|
43
|
+
* @expected 값이 null일 때 드롭다운을 초기화하고, 값이 있다면 해당 값으로 설정해줍니다.
|
|
44
|
+
* @clear -
|
|
45
|
+
*/
|
|
41
46
|
(0, react_1.useEffect)(function () {
|
|
42
|
-
if (
|
|
43
|
-
setSelectedValue(
|
|
47
|
+
if (value === null) {
|
|
48
|
+
setSelectedValue(null);
|
|
49
|
+
return;
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
(0, react_1.useEffect)(function () {
|
|
47
|
-
if (value) {
|
|
51
|
+
if (value !== undefined) {
|
|
48
52
|
setSelectedValue(value);
|
|
49
53
|
}
|
|
50
54
|
}, [value]);
|
|
55
|
+
/**
|
|
56
|
+
* @when defaultValue 프롭에 값이 있을 시
|
|
57
|
+
* @expected Dropdown의 초기값을 설정해줍니다.
|
|
58
|
+
* @clear -
|
|
59
|
+
*/
|
|
60
|
+
(0, react_1.useEffect)(function () {
|
|
61
|
+
if (!defaultValue) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setSelectedValue(defaultValue);
|
|
65
|
+
}, [defaultValue]);
|
|
51
66
|
var handleClick = function () {
|
|
52
67
|
if (state === 'disabled' || state === 'read_only') {
|
|
53
68
|
return;
|
|
@@ -61,7 +76,7 @@ function Dropdown(_a) {
|
|
|
61
76
|
};
|
|
62
77
|
var handleClickOption = function (option) {
|
|
63
78
|
setIsFocused(false);
|
|
64
|
-
if (
|
|
79
|
+
if (value === undefined) {
|
|
65
80
|
setSelectedValue(option);
|
|
66
81
|
}
|
|
67
82
|
if (onChange) {
|
|
@@ -18,7 +18,7 @@ function FilterBar(_a) {
|
|
|
18
18
|
return textArray.map(function (option) {
|
|
19
19
|
var _a;
|
|
20
20
|
return (react_1.default.createElement(S_ChipWrapper, { key: option.value },
|
|
21
|
-
react_1.default.createElement(Chip_1.Chip, { displayType: "filter_single", text: option.text, value:
|
|
21
|
+
react_1.default.createElement(Chip_1.Chip, { displayType: "filter_single", text: option.text, value: value === null || value === void 0 ? void 0 : value.value, id: option.value, onClickChip: function () { return onClickChip && onClickChip(option); }, activeChipId: activeChipId, chipId: (_a = option.value) === null || _a === void 0 ? void 0 : _a.toString() })));
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { Props as ChatListProps } from './ChatList';
|
|
3
|
-
declare
|
|
3
|
+
declare const Body: React.ForwardRefExoticComponent<Pick<ChatListProps, "children" | "scrollVisibleType" | "bodyMBtnText" | "bodySpacingMode"> & {
|
|
4
4
|
isSubmitted: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
callBackAfterScrollToBottom: () => void;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export default Body;
|
|
@@ -30,49 +30,53 @@ var react_1 = __importStar(require("react"));
|
|
|
30
30
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
31
31
|
var MainButton_1 = require("../MainButton");
|
|
32
32
|
var useAutoScrollToBottom_1 = __importDefault(require("./useAutoScrollToBottom"));
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
var scrollVisibleType = _a.scrollVisibleType, children = _a.children, isSubmitted = _a.isSubmitted, bodyMBtnText = _a.bodyMBtnText, bodySpacingMode = _a.bodySpacingMode;
|
|
33
|
+
var Body = react_1.default.forwardRef(function (_a, ref) {
|
|
34
|
+
var scrollVisibleType = _a.scrollVisibleType, children = _a.children, isSubmitted = _a.isSubmitted, bodyMBtnText = _a.bodyMBtnText, bodySpacingMode = _a.bodySpacingMode, callBackAfterScrollToBottom = _a.callBackAfterScrollToBottom;
|
|
36
35
|
var _b = (0, react_1.useState)(false), isButtonShow = _b[0], setIsButtonShow = _b[1];
|
|
37
36
|
var _c = (0, useAutoScrollToBottom_1.default)(), triggerScrollToBottom = _c.triggerScrollToBottom, EndOfList = _c.EndOfList;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @when 페이지 진입 시
|
|
39
|
+
* @expected 채팅 리스트의 맨 밑으로 스크롤 내린다.
|
|
40
|
+
* @clear -
|
|
41
|
+
*/
|
|
42
|
+
(0, react_1.useEffect)(function () {
|
|
43
|
+
if (!isButtonShow) {
|
|
44
|
+
triggerScrollToBottom();
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
};
|
|
46
|
+
}, [children, isButtonShow, triggerScrollToBottom]);
|
|
49
47
|
/**
|
|
50
48
|
* @when 스크롤을 하고 있지 않은 상황에서 chatMessages가 업데이트 될 때마다
|
|
51
49
|
* @expected 채팅 리스트의 맨 밑으로 스크롤 내린다.
|
|
52
50
|
* @clear -
|
|
53
51
|
*/
|
|
54
|
-
(0,
|
|
52
|
+
(0, react_1.useEffect)(function () {
|
|
53
|
+
var handleTriggerScroll = function () {
|
|
54
|
+
if (isSubmitted) {
|
|
55
|
+
callBackAfterScrollToBottom();
|
|
56
|
+
triggerScrollToBottom();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
setTimeout(function () { return handleTriggerScroll(); }, 0);
|
|
60
|
+
}, [children, isButtonShow, isSubmitted, callBackAfterScrollToBottom]);
|
|
55
61
|
var handleClickMBtn = function () {
|
|
56
62
|
triggerScrollToBottom();
|
|
57
63
|
};
|
|
58
|
-
var handleScroll = function () {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
setIsButtonShow(true);
|
|
64
|
+
var handleScroll = function (e) {
|
|
65
|
+
var _a = e.currentTarget, scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
66
|
+
var BUTTON_SHOW_UP_HEIGHT = 100;
|
|
67
|
+
if (Math.ceil(scrollTop) + clientHeight + BUTTON_SHOW_UP_HEIGHT > scrollHeight) {
|
|
68
|
+
setIsButtonShow(false);
|
|
69
|
+
return;
|
|
67
70
|
}
|
|
71
|
+
setIsButtonShow(true);
|
|
68
72
|
};
|
|
69
73
|
return (react_1.default.createElement(S_Body, { bodySpacingMode: bodySpacingMode },
|
|
70
|
-
react_1.default.createElement(S_ChatMessageBox, { onScroll: handleScroll, ref:
|
|
74
|
+
react_1.default.createElement(S_ChatMessageBox, { onScroll: handleScroll, ref: ref, scrollVisibleType: scrollVisibleType },
|
|
71
75
|
children,
|
|
72
76
|
react_1.default.createElement(EndOfList, null)),
|
|
73
77
|
isButtonShow && (react_1.default.createElement(S_BottomButtonWrapper, null,
|
|
74
78
|
react_1.default.createElement(MainButton_1.MainButton, { text: bodyMBtnText, size: "small", onClick: handleClickMBtn })))));
|
|
75
|
-
}
|
|
79
|
+
});
|
|
76
80
|
var bodySpacing = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n padding-right: ", ";\n padding-left: ", ";\n"], ["\n box-sizing: border-box;\n padding-right: ", ";\n padding-left: ", ";\n"])), function (_a) {
|
|
77
81
|
var theme = _a.theme;
|
|
78
82
|
return theme.spacing.spacingE;
|
|
@@ -101,4 +105,5 @@ var S_BottomButtonWrapper = styled_components_1.default.div(templateObject_6 ||
|
|
|
101
105
|
return theme.spacing.spacingC;
|
|
102
106
|
});
|
|
103
107
|
exports.default = Body;
|
|
108
|
+
Body.displayName = 'Body';
|
|
104
109
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -41,5 +41,5 @@ export declare type Props = {
|
|
|
41
41
|
onSubmit: (value: string) => void;
|
|
42
42
|
onClickHeaderIBtn1?: () => void;
|
|
43
43
|
};
|
|
44
|
-
declare
|
|
44
|
+
declare const ChatList: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
45
45
|
export default ChatList;
|
|
@@ -49,7 +49,7 @@ var baseBackgroundColors = {
|
|
|
49
49
|
translucent: 'ui_cpnt_list_base_area_translucent',
|
|
50
50
|
transparent: 'ui_cpnt_list_base_area_translucent'
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
var ChatList = react_1.default.forwardRef(function (_a, ref) {
|
|
53
53
|
var _b = _a.styleTheme, styleTheme = _b === void 0 ? 'solid' : _b, _c = _a.headerMode, headerMode = _c === void 0 ? 'use' : _c, titleText = _a.titleText, descText = _a.descText, captionText = _a.captionText, _d = _a.titleStyleTheme, titleStyleTheme = _d === void 0 ? 'subTitleBold' : _d, _e = _a.headerDisplayType, headerDisplayType = _e === void 0 ? 'none' : _e, _f = _a.headerIBtn1IconName, headerIBtn1IconName = _f === void 0 ? 'ic_xmark' : _f, _g = _a.headerIBtn1IconFillType, headerIBtn1IconFillType = _g === void 0 ? 'line' : _g, children = _a.children, _h = _a.textFieldState, textFieldState = _h === void 0 ? 'normal' : _h, textFieldHintText = _a.textFieldHintText, textFieldDefaultText = _a.textFieldDefaultText, textFieldMaxLength = _a.textFieldMaxLength, _j = _a.scrollVisibleType, scrollVisibleType = _j === void 0 ? 'moving' : _j, footerChildren = _a.footerChildren, _k = _a.submitIBtnState, submitIBtnState = _k === void 0 ? 'normal' : _k, bodyMBtnText = _a.bodyMBtnText, _l = _a.bodySpacingMode, bodySpacingMode = _l === void 0 ? 'none' : _l, onSubmit = _a.onSubmit, onClickHeaderIBtn1 = _a.onClickHeaderIBtn1, submitIBtnIconName = _a.submitIBtnIconName, submitIBtnIconFillType = _a.submitIBtnIconFillType, _m = _a.footerIBtn1State, footerIBtn1State = _m === void 0 ? 'normal' : _m, footerIBtn1IconName = _a.footerIBtn1IconName, footerIBtn1IconFillType = _a.footerIBtn1IconFillType, _o = _a.footerIBtn1Type, footerIBtn1Type = _o === void 0 ? 'button' : _o, onClickFooterIBtn1 = _a.onClickFooterIBtn1, _p = _a.footerIBtn2State, footerIBtn2State = _p === void 0 ? 'normal' : _p, footerIBtn2IconName = _a.footerIBtn2IconName, footerIBtn2IconFillType = _a.footerIBtn2IconFillType, _q = _a.footerIBtn2Type, footerIBtn2Type = _q === void 0 ? 'button' : _q, onClickFooterIBtn2 = _a.onClickFooterIBtn2, _r = _a.footerIBtn3State, footerIBtn3State = _r === void 0 ? 'normal' : _r, footerIBtn3IconName = _a.footerIBtn3IconName, footerIBtn3IconFillType = _a.footerIBtn3IconFillType, _s = _a.footerIBtn3Type, footerIBtn3Type = _s === void 0 ? 'button' : _s, footerIBtn3Accept = _a.footerIBtn3Accept, onClickFooterIBtn3 = _a.onClickFooterIBtn3;
|
|
54
54
|
var methods = (0, react_hook_form_1.useForm)({
|
|
55
55
|
mode: 'onChange',
|
|
@@ -57,7 +57,17 @@ function ChatList(_a) {
|
|
|
57
57
|
chat: ''
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
var reset = methods.reset, handleSubmit = methods.handleSubmit, control = methods.control, _t = methods.formState,
|
|
60
|
+
var reset = methods.reset, handleSubmit = methods.handleSubmit, control = methods.control, _t = methods.formState, isValid = _t.isValid, isDirty = _t.isDirty, isSubmitSuccessful = _t.isSubmitSuccessful;
|
|
61
|
+
/**
|
|
62
|
+
* @when 폼 제출에 성공했을 시
|
|
63
|
+
* @expected 폼을 초기화합니다.
|
|
64
|
+
* @clear -
|
|
65
|
+
*/
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
67
|
+
if (isSubmitSuccessful) {
|
|
68
|
+
reset();
|
|
69
|
+
}
|
|
70
|
+
}, [isSubmitSuccessful]);
|
|
61
71
|
var inputValue = (0, react_hook_form_1.useWatch)({ name: 'chat', control: control });
|
|
62
72
|
var isSubmitButtonActive = (0, react_1.useMemo)(function () {
|
|
63
73
|
if (!submitIBtnState) {
|
|
@@ -71,20 +81,22 @@ function ChatList(_a) {
|
|
|
71
81
|
return;
|
|
72
82
|
}
|
|
73
83
|
onSubmit(chat);
|
|
74
|
-
|
|
84
|
+
};
|
|
85
|
+
var callBackAfterScrollToBottom = function () {
|
|
86
|
+
reset();
|
|
75
87
|
};
|
|
76
88
|
return (react_1.default.createElement(S_ChatList, { backgroundColor: baseBackgroundColors[styleTheme], id: "chatList" },
|
|
77
89
|
headerMode === 'use' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
78
90
|
react_1.default.createElement(Header_1.default, { styleTheme: styleTheme, titleText: titleText, descText: descText, captionText: captionText, titleStyleTheme: titleStyleTheme, headerDisplayType: headerDisplayType, headerIBtn1IconName: headerIBtn1IconName, headerIBtn1IconFillType: headerIBtn1IconFillType, onClickHeaderIBtn1: onClickHeaderIBtn1 }),
|
|
79
91
|
react_1.default.createElement(hybrid_1.Divider, null))),
|
|
80
|
-
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted:
|
|
92
|
+
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted: isSubmitSuccessful, bodyMBtnText: bodyMBtnText, bodySpacingMode: bodySpacingMode, callBackAfterScrollToBottom: callBackAfterScrollToBottom, ref: ref }, children),
|
|
81
93
|
react_1.default.createElement(hybrid_1.Divider, null),
|
|
82
94
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" }),
|
|
83
95
|
react_1.default.createElement(react_hook_form_1.FormProvider, __assign({}, methods),
|
|
84
96
|
react_1.default.createElement("form", { onSubmit: handleSubmit(handleSubmitChat) },
|
|
85
97
|
react_1.default.createElement(Footer_1.default, { textFieldDefaultText: textFieldDefaultText, textFieldHintText: textFieldHintText, textFieldState: textFieldState, textFieldMaxLength: textFieldMaxLength, footerChildren: footerChildren, isSubmitBtnActive: isSubmitButtonActive, submitIBtnIconName: submitIBtnIconName, submitIBtnIconFillType: submitIBtnIconFillType, footerIBtn1State: footerIBtn1State, footerIBtn1IconName: footerIBtn1IconName, footerIBtn1IconFillType: footerIBtn1IconFillType, footerIBtn1Type: footerIBtn1Type, onClickFooterIBtn1: onClickFooterIBtn1, footerIBtn2State: footerIBtn2State, footerIBtn2IconName: footerIBtn2IconName, footerIBtn2IconFillType: footerIBtn2IconFillType, footerIBtn2Type: footerIBtn2Type, onClickFooterIBtn2: onClickFooterIBtn2, footerIBtn3State: footerIBtn3State, footerIBtn3IconName: footerIBtn3IconName, footerIBtn3IconFillType: footerIBtn3IconFillType, footerIBtn3Type: footerIBtn3Type, footerIBtn3Accept: footerIBtn3Accept, onClickFooterIBtn3: onClickFooterIBtn3 }))),
|
|
86
98
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" })));
|
|
87
|
-
}
|
|
99
|
+
});
|
|
88
100
|
var S_ChatList = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n height: 100%;\n"], ["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n height: 100%;\n"])), function (_a) {
|
|
89
101
|
var backgroundColor = _a.backgroundColor, theme = _a.theme;
|
|
90
102
|
return theme[backgroundColor];
|
|
@@ -32,11 +32,16 @@ function useAutoScrollToBottom(_a) {
|
|
|
32
32
|
(0, react_1.useEffect)(function () {
|
|
33
33
|
if (scrollRef.current) {
|
|
34
34
|
scrollRef.current.scrollIntoView({ behavior: behavior });
|
|
35
|
+
// NOTE: 스크롤을 빠르게 하는 중에 scrollIntoView시 스크롤 영역만큼 렌더가 안되는 이슈에 대한 임시조치
|
|
36
|
+
setTimeout(function () {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: behavior });
|
|
39
|
+
}, 100);
|
|
35
40
|
}
|
|
36
41
|
}, [scrollTrigger]);
|
|
37
|
-
|
|
42
|
+
var triggerScrollToBottom = (0, react_1.useCallback)(function () {
|
|
38
43
|
setScrollTrigger(function (prev) { return !prev; });
|
|
39
|
-
}
|
|
44
|
+
}, []);
|
|
40
45
|
function EndOfList() {
|
|
41
46
|
return react_1.default.createElement("li", { style: { listStyle: 'none', height: heightOfEndOfList + "px" }, ref: scrollRef });
|
|
42
47
|
}
|
|
@@ -7,7 +7,7 @@ declare type DropDownValues = PDSValueOption & {
|
|
|
7
7
|
declare type Props = {
|
|
8
8
|
colorTheme?: 'none' | 'dark' | 'white';
|
|
9
9
|
defaultValue?: PDSValueOption;
|
|
10
|
-
value?: PDSValueOption;
|
|
10
|
+
value?: PDSValueOption | null;
|
|
11
11
|
hintText?: TFunctionResult;
|
|
12
12
|
maxHeightItemNumber?: number;
|
|
13
13
|
responsiveMode?: 'none' | 'use';
|
|
@@ -37,17 +37,32 @@ function Dropdown(_a) {
|
|
|
37
37
|
// selectionMode = 'single',
|
|
38
38
|
size = _e === void 0 ? 'large' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, valueArray = _a.valueArray, customWidth = _a.customWidth, onChange = _a.onChange;
|
|
39
39
|
var _g = (0, react_1.useState)(false), isFocused = _g[0], setIsFocused = _g[1];
|
|
40
|
-
var _h = (0, react_1.useState)(
|
|
40
|
+
var _h = (0, react_1.useState)(null), selectedValue = _h[0], setSelectedValue = _h[1];
|
|
41
|
+
/**
|
|
42
|
+
* @when value 프롭의 값에 따라
|
|
43
|
+
* @expected 값이 null일 때 드롭다운을 초기화하고, 값이 있다면 해당 값으로 설정해줍니다.
|
|
44
|
+
* @clear -
|
|
45
|
+
*/
|
|
41
46
|
(0, react_1.useEffect)(function () {
|
|
42
|
-
if (
|
|
43
|
-
setSelectedValue(
|
|
47
|
+
if (value === null) {
|
|
48
|
+
setSelectedValue(null);
|
|
49
|
+
return;
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
(0, react_1.useEffect)(function () {
|
|
47
|
-
if (value) {
|
|
51
|
+
if (value !== undefined) {
|
|
48
52
|
setSelectedValue(value);
|
|
49
53
|
}
|
|
50
54
|
}, [value]);
|
|
55
|
+
/**
|
|
56
|
+
* @when defaultValue 프롭에 값이 있을 시
|
|
57
|
+
* @expected Dropdown의 초기값을 설정해줍니다.
|
|
58
|
+
* @clear -
|
|
59
|
+
*/
|
|
60
|
+
(0, react_1.useEffect)(function () {
|
|
61
|
+
if (!defaultValue) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setSelectedValue(defaultValue);
|
|
65
|
+
}, [defaultValue]);
|
|
51
66
|
var handleClick = function () {
|
|
52
67
|
if (state === 'disabled' || state === 'read_only') {
|
|
53
68
|
return;
|
|
@@ -61,7 +76,7 @@ function Dropdown(_a) {
|
|
|
61
76
|
};
|
|
62
77
|
var handleClickOption = function (option) {
|
|
63
78
|
setIsFocused(false);
|
|
64
|
-
if (
|
|
79
|
+
if (value === undefined) {
|
|
65
80
|
setSelectedValue(option);
|
|
66
81
|
}
|
|
67
82
|
if (onChange) {
|
package/package.json
CHANGED
package/release-note.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# PDS-DEV-KIT-WEB Release Notes
|
|
2
|
-
## [v1.4.
|
|
2
|
+
## [v1.4.46]
|
|
3
3
|
|
|
4
4
|
### Component
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* ChatBubbleListItem
|
|
8
|
-
* safari에서 우측 더보기 버튼이 간혈적으로 보이지 않는 이슈 해결
|
|
9
|
-
* UserDesktopNavBar
|
|
10
|
-
* loginInfoMode가 profile일때 마우스 커서가 변하지 않는 이슈 해결
|
|
5
|
+
* DesktopTabBar
|
|
6
|
+
* subTabBar가 영역을 가질 수 있도록 수정
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var react_1 = require("react");
|
|
4
|
-
function useTimeout(_a, delay) {
|
|
5
|
-
var callback = _a.callback, target = _a.target;
|
|
6
|
-
(0, react_1.useEffect)(function () {
|
|
7
|
-
var timeout = setTimeout(function () { return callback(); }, delay);
|
|
8
|
-
return function () { return clearTimeout(timeout); };
|
|
9
|
-
}, [target]);
|
|
10
|
-
}
|
|
11
|
-
exports.default = useTimeout;
|