pds-dev-kit-web-test 0.0.5 → 0.0.8
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/README.md +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +9 -3
- package/dist/src/GlobalStyle.js +1 -1
- package/dist/src/common/assets/icons/line/Clip.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Clip.js +36 -0
- package/dist/src/common/assets/icons/line/Coins.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Coins.js +34 -0
- package/dist/src/common/assets/icons/line/Ghost.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Ghost.js +36 -0
- package/dist/src/common/assets/icons/line/Home.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Home.js +36 -0
- package/dist/src/common/assets/icons/line/Internal.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Internal.js +36 -0
- package/dist/src/common/assets/icons/line/PaymentFreeTrial.d.ts +4 -0
- package/dist/src/common/assets/icons/line/PaymentFreeTrial.js +34 -0
- package/dist/src/common/assets/icons/line/PaymentOnetime.js +1 -1
- package/dist/src/common/assets/icons/line/PaymentRegularly.js +2 -1
- package/dist/src/common/assets/icons/line/PostColumn.d.ts +4 -0
- package/dist/src/common/assets/icons/line/PostColumn.js +34 -0
- package/dist/src/common/assets/icons/line/PostPaperPlane.d.ts +4 -0
- package/dist/src/common/assets/icons/line/PostPaperPlane.js +36 -0
- package/dist/src/common/assets/icons/line/index.d.ts +8 -0
- package/dist/src/common/assets/icons/line/index.js +16 -0
- package/dist/src/common/components/BoxLayout/Row.js +1 -1
- package/dist/src/common/components/Navigations/ContextTextLabelNav.d.ts +3 -2
- package/dist/src/common/components/Navigations/ContextTextLabelNav.js +10 -5
- package/dist/src/common/components/Navigations/NavLink.js +3 -1
- package/dist/src/common/components/Navigations/TextLabelNav.d.ts +2 -1
- package/dist/src/common/components/Navigations/TextLabelNav.js +3 -3
- package/dist/src/common/hooks/index.d.ts +1 -0
- package/dist/src/common/hooks/index.js +3 -1
- package/dist/src/common/hooks/useDetectOverflow.js +1 -1
- package/dist/src/common/hooks/usePrevious.d.ts +2 -0
- package/dist/src/common/hooks/usePrevious.js +11 -0
- package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +9 -1
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +9 -1
- package/dist/src/common/styles/colorSet/SemanticColor.json +2 -1
- package/dist/src/common/styles/colorSet/UIColor.json +30 -1
- package/dist/src/common/styles/colorSet/index.d.ts +218 -172
- package/dist/src/common/styles/colorSet/index.js +3 -3
- package/dist/src/common/styles/colorSet/ui-type.d.ts +29 -0
- package/dist/src/common/styles/theme.js +22 -22
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.d.ts +2 -1
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +6 -6
- package/dist/src/desktop/components/AdminList/AdminList.d.ts +20 -11
- package/dist/src/desktop/components/AdminList/AdminList.js +5 -28
- package/dist/src/desktop/components/AdminList/BulkActionBar.d.ts +7 -1
- package/dist/src/desktop/components/AdminList/BulkActionBar.js +4 -4
- package/dist/src/desktop/components/AdminListHeader/HeaderBar.js +1 -1
- package/dist/src/desktop/components/AdminListItem/AdminListItem.d.ts +2 -2
- package/dist/src/desktop/components/AdminListItem/AdminListItem.js +3 -3
- package/dist/src/desktop/components/BasicChatListItem/BasicChatListItem.d.ts +15 -0
- package/dist/src/desktop/components/BasicChatListItem/BasicChatListItem.js +121 -0
- package/dist/src/desktop/components/BasicChatListItem/Popup.d.ts +19 -0
- package/dist/src/desktop/components/BasicChatListItem/Popup.js +238 -0
- package/dist/src/desktop/components/BasicChatListItem/index.d.ts +1 -0
- package/dist/src/desktop/components/BasicChatListItem/index.js +8 -0
- package/dist/src/desktop/components/BasicList/BasicList.d.ts +3 -3
- package/dist/src/desktop/components/BodyTextGroup/BodyTextGroup.d.ts +4 -1
- package/dist/src/desktop/components/BodyTextGroup/BodyTextGroup.js +4 -4
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubble.d.ts +8 -0
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubble.js +76 -0
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.d.ts +17 -0
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.js +160 -0
- package/dist/src/desktop/components/ChatBubbleListItem/Popup.d.ts +19 -0
- package/dist/src/desktop/components/ChatBubbleListItem/Popup.js +238 -0
- package/dist/src/desktop/components/ChatBubbleListItem/index.d.ts +1 -0
- package/dist/src/desktop/components/ChatBubbleListItem/index.js +8 -0
- package/dist/src/desktop/components/ChatList/Body.d.ts +7 -0
- package/dist/src/desktop/components/ChatList/Body.js +108 -0
- package/dist/src/desktop/components/ChatList/ChatList.d.ts +45 -0
- package/dist/src/desktop/components/ChatList/ChatList.js +105 -0
- package/dist/src/desktop/components/ChatList/ChatTextField.d.ts +25 -0
- package/dist/src/desktop/components/ChatList/ChatTextField.js +59 -0
- package/dist/src/desktop/components/ChatList/Footer.d.ts +25 -0
- package/dist/src/desktop/components/ChatList/Footer.js +27 -0
- package/dist/src/desktop/components/ChatList/Header.d.ts +5 -0
- package/dist/src/desktop/components/ChatList/Header.js +53 -0
- package/dist/src/desktop/components/ChatList/index.d.ts +1 -0
- package/dist/src/desktop/components/ChatList/index.js +8 -0
- package/dist/src/desktop/components/ChatList/useAutoScrollToBottom.d.ts +10 -0
- package/dist/src/desktop/components/ChatList/useAutoScrollToBottom.js +53 -0
- package/dist/src/desktop/components/Chip/Chip.js +15 -15
- package/dist/src/desktop/components/ContextMenu/ContextMenu.d.ts +2 -1
- package/dist/src/desktop/components/ContextMenu/ContextMenu.js +14 -5
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.js +4 -4
- package/dist/src/desktop/components/DesktopAlertDialog/DesktopAlertDialog.d.ts +1 -1
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +41 -47
- package/dist/src/desktop/components/Dropdown/Dropdown.d.ts +4 -3
- package/dist/src/desktop/components/Dropdown/Dropdown.js +56 -16
- package/dist/src/desktop/components/DynamicDesktopNavBar/DynamicDesktopNavBar.d.ts +6 -2
- package/dist/src/desktop/components/DynamicDesktopNavBar/DynamicDesktopNavBar.js +25 -2
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/ContextMenuNavs/ContextMenuItemNav.js +9 -39
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/IconNav.d.ts +3 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/IconNav.js +2 -2
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/ImageIconNav.d.ts +2 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/ImageIconNav.js +2 -2
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/MenuItemNav.js +10 -3
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/DisplayOnlyMenuItemNav.d.ts +12 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/DisplayOnlyMenuItemNav.js +31 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/InternalLinkMenuItemNav.d.ts +12 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/InternalLinkMenuItemNav.js +65 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/PAppMenuItemNav.js +8 -6
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/WebMenuItemNav.d.ts +2 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/MenuItemNav/components/WebMenuItemNav.js +4 -4
- package/dist/src/desktop/components/DynamicDesktopNavBar/reducer.d.ts +16 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/reducer.js +23 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/types.d.ts +2 -1
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.d.ts +2 -1
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.js +13 -14
- package/dist/src/desktop/components/FilterBar/FilterBar.d.ts +1 -1
- package/dist/src/desktop/components/FilterBar/FilterBar.js +1 -1
- package/dist/src/desktop/components/MainButton/MainButton.js +17 -5
- package/dist/src/desktop/components/Select/Select.d.ts +9 -7
- package/dist/src/desktop/components/Select/Select.js +20 -15
- package/dist/src/desktop/components/StatusBlock/StatusBlock.js +11 -5
- package/dist/src/desktop/components/TextButton/TextButton.js +5 -5
- package/dist/src/desktop/components/TextField/TextField.d.ts +3 -1
- package/dist/src/desktop/components/TextField/TextField.js +18 -14
- package/dist/src/desktop/components/UploadMainButton/UploadMainButton.js +7 -7
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.js +5 -5
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.d.ts +1 -1
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.js +4 -1
- package/dist/src/desktop/components/index.d.ts +4 -1
- package/dist/src/desktop/components/index.js +7 -1
- package/dist/src/desktop/index.d.ts +2 -2
- package/dist/src/desktop/index.js +5 -2
- package/dist/src/desktop/layout/LayoutWF/Containers/ContentsContainer/ContentsContainer.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWF/Containers/ContentsContainer/ContentsContainer.js +2 -1
- package/dist/src/desktop/layout/LayoutWF/Containers/ContentsContainer/variation/WFE.d.ts +2 -1
- package/dist/src/desktop/layout/LayoutWF/Containers/ContentsContainer/variation/WFE.js +41 -11
- package/dist/src/desktop/layout/LayoutWF/ContainersBox/ContainersBox.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWF/ContainersBox/ContainersBox.js +2 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.js +2 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSG.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSG.js +16 -10
- package/dist/src/desktop/layout/LayoutWS/ContainersBox/ContainersBox.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/ContentsContainer.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/ContentsContainer.js +9 -6
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTN.d.ts +3 -2
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTN.js +2 -2
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTO.d.ts +3 -2
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTO.js +8 -10
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTP.d.ts +3 -2
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTP.js +8 -10
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTQ.js +5 -5
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTT.d.ts +11 -0
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTT.js +65 -0
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTU.d.ts +13 -0
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTU.js +96 -0
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/index.d.ts +2 -0
- package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/index.js +5 -1
- package/dist/src/desktop/layout/LayoutWT/Containers/SubMenuContainer/variation/LeftSubMenu.js +1 -1
- package/dist/src/desktop/layout/LayoutWT/ContainersBox/ContainersBox.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWT/ContainersBox/ContainersBox.js +20 -11
- package/dist/src/desktop/panels/DesktopBasicModal/DesktopBasicModal.js +7 -4
- package/dist/src/hybrid/components/Divider/Divider.js +4 -1
- package/dist/src/hybrid/components/Spacing/Spacing.js +1 -1
- package/dist/src/hybrid/components/Switch/Switch.js +4 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.d.ts +2 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +6 -6
- package/dist/src/mobile/components/BasicChatListItem/BasicChatListItem.d.ts +15 -0
- package/dist/src/mobile/components/BasicChatListItem/BasicChatListItem.js +121 -0
- package/dist/src/mobile/components/BasicChatListItem/Popup.d.ts +19 -0
- package/dist/src/mobile/components/BasicChatListItem/Popup.js +238 -0
- package/dist/src/mobile/components/BasicChatListItem/index.d.ts +1 -0
- package/dist/src/mobile/components/BasicChatListItem/index.js +8 -0
- package/dist/src/mobile/components/BasicList/BasicList.d.ts +3 -3
- package/dist/src/mobile/components/BodyTextGroup/BodyTextGroup.d.ts +4 -1
- package/dist/src/mobile/components/BodyTextGroup/BodyTextGroup.js +4 -4
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubble.d.ts +8 -0
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubble.js +76 -0
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.d.ts +17 -0
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.js +160 -0
- package/dist/src/mobile/components/ChatBubbleListItem/Popup.d.ts +19 -0
- package/dist/src/mobile/components/ChatBubbleListItem/Popup.js +238 -0
- package/dist/src/mobile/components/ChatBubbleListItem/index.d.ts +1 -0
- package/dist/src/mobile/components/ChatBubbleListItem/index.js +8 -0
- package/dist/src/mobile/components/ChatList/Body.d.ts +7 -0
- package/dist/src/mobile/components/ChatList/Body.js +109 -0
- package/dist/src/mobile/components/ChatList/ChatList.d.ts +45 -0
- package/dist/src/mobile/components/ChatList/ChatList.js +105 -0
- package/dist/src/mobile/components/ChatList/ChatTextField.d.ts +25 -0
- package/dist/src/mobile/components/ChatList/ChatTextField.js +59 -0
- package/dist/src/mobile/components/ChatList/Footer.d.ts +25 -0
- package/dist/src/mobile/components/ChatList/Footer.js +27 -0
- package/dist/src/mobile/components/ChatList/Header.d.ts +5 -0
- package/dist/src/mobile/components/ChatList/Header.js +53 -0
- package/dist/src/mobile/components/ChatList/index.d.ts +1 -0
- package/dist/src/mobile/components/ChatList/index.js +8 -0
- package/dist/src/mobile/components/ChatList/useAutoScrollToBottom.d.ts +10 -0
- package/dist/src/mobile/components/ChatList/useAutoScrollToBottom.js +53 -0
- package/dist/src/mobile/components/Chip/Chip.js +15 -15
- package/dist/src/mobile/components/ContextMenu/ContextMenu.d.ts +2 -1
- package/dist/src/mobile/components/ContextMenu/ContextMenu.js +14 -5
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.js +4 -4
- package/dist/src/mobile/components/Dropdown/Dropdown.d.ts +3 -2
- package/dist/src/mobile/components/Dropdown/Dropdown.js +56 -16
- package/dist/src/mobile/components/MainButton/MainButton.js +17 -5
- package/dist/src/mobile/components/MobileAlertDialog/MobileAlertDialog.d.ts +1 -1
- package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.d.ts +2 -1
- package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.js +23 -13
- package/dist/src/mobile/components/Select/Select.d.ts +9 -7
- package/dist/src/mobile/components/Select/Select.js +19 -14
- package/dist/src/mobile/components/StatusBlock/StatusBlock.js +4 -4
- package/dist/src/mobile/components/TextButton/TextButton.js +4 -4
- package/dist/src/mobile/components/TextField/TextField.d.ts +3 -1
- package/dist/src/mobile/components/TextField/TextField.js +18 -14
- package/dist/src/mobile/components/UploadMainButton/UploadMainButton.js +7 -7
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.js +5 -5
- package/dist/src/mobile/components/index.d.ts +4 -1
- package/dist/src/mobile/components/index.js +7 -1
- package/dist/src/mobile/index.d.ts +2 -2
- package/dist/src/mobile/index.js +4 -1
- package/package.json +1 -1
- package/release-note.md +4 -2
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
31
|
+
var MainButton_1 = require("../MainButton");
|
|
32
|
+
var useAutoScrollToBottom_1 = __importDefault(require("./useAutoScrollToBottom"));
|
|
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
|
+
var _b = (0, react_1.useState)(false), isButtonShow = _b[0], setIsButtonShow = _b[1];
|
|
36
|
+
var _c = (0, useAutoScrollToBottom_1.default)(), triggerScrollToBottom = _c.triggerScrollToBottom, EndOfList = _c.EndOfList;
|
|
37
|
+
/**
|
|
38
|
+
* @when 페이지 진입 시
|
|
39
|
+
* @expected 채팅 리스트의 맨 밑으로 스크롤 내린다.
|
|
40
|
+
* @clear -
|
|
41
|
+
*/
|
|
42
|
+
(0, react_1.useEffect)(function () {
|
|
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 () {
|
|
54
|
+
if (isSubmitted) {
|
|
55
|
+
callBackAfterScrollToBottom();
|
|
56
|
+
triggerScrollToBottom();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
setTimeout(function () { return handleTriggerScroll(); }, 0);
|
|
60
|
+
}, [children, isButtonShow, isSubmitted, callBackAfterScrollToBottom]);
|
|
61
|
+
var handleClickMBtn = function () {
|
|
62
|
+
triggerScrollToBottom();
|
|
63
|
+
};
|
|
64
|
+
var handleScroll = function (e) {
|
|
65
|
+
var _a = e.currentTarget, scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
66
|
+
if (scrollTop + clientHeight === scrollHeight) {
|
|
67
|
+
setIsButtonShow(false);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
setIsButtonShow(true);
|
|
71
|
+
};
|
|
72
|
+
return (react_1.default.createElement(S_Body, { bodySpacingMode: bodySpacingMode },
|
|
73
|
+
react_1.default.createElement(S_ChatMessageBox, { id: "chatMessageBox", onScroll: handleScroll, scrollVisibleType: scrollVisibleType, ref: ref },
|
|
74
|
+
children,
|
|
75
|
+
react_1.default.createElement(EndOfList, null)),
|
|
76
|
+
isButtonShow && (react_1.default.createElement(S_BottomButtonWrapper, null,
|
|
77
|
+
react_1.default.createElement(MainButton_1.MainButton, { text: bodyMBtnText, size: "small", onClick: handleClickMBtn })))));
|
|
78
|
+
});
|
|
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) {
|
|
80
|
+
var theme = _a.theme;
|
|
81
|
+
return theme.spacing.spacingE;
|
|
82
|
+
}, function (_a) {
|
|
83
|
+
var theme = _a.theme;
|
|
84
|
+
return theme.spacing.spacingE;
|
|
85
|
+
});
|
|
86
|
+
var S_Body = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n\n ", ";\n"], ["\n flex: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n\n ", ";\n"])), function (_a) {
|
|
87
|
+
var bodySpacingMode = _a.bodySpacingMode;
|
|
88
|
+
return bodySpacingMode === 'use' && bodySpacing;
|
|
89
|
+
});
|
|
90
|
+
var scrollVisibleStyle = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ::-webkit-scrollbar {\n display: block;\n }\n"], ["\n ::-webkit-scrollbar {\n display: block;\n }\n"])));
|
|
91
|
+
var scrollHiddenStyle = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n ::-webkit-scrollbar {\n display: none;\n }\n"], ["\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n ::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
92
|
+
var S_ChatMessageBox = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 100%;\n overflow-y: auto;\n\n ", "\n"], ["\n height: 100%;\n overflow-y: auto;\n\n ", "\n"])), function (_a) {
|
|
93
|
+
var scrollVisibleType = _a.scrollVisibleType;
|
|
94
|
+
if (!scrollVisibleType || scrollVisibleType === 'moving') {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
visible: scrollVisibleStyle,
|
|
99
|
+
hidden: scrollHiddenStyle
|
|
100
|
+
}[scrollVisibleType];
|
|
101
|
+
});
|
|
102
|
+
var S_BottomButtonWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n bottom: ", ";\n left: 50%;\n position: absolute;\n transform: translate(-50%, 0);\n"], ["\n bottom: ", ";\n left: 50%;\n position: absolute;\n transform: translate(-50%, 0);\n"])), function (_a) {
|
|
103
|
+
var theme = _a.theme;
|
|
104
|
+
return theme.spacing.spacingC;
|
|
105
|
+
});
|
|
106
|
+
exports.default = Body;
|
|
107
|
+
Body.displayName = 'Body';
|
|
108
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
styleTheme?: 'solid' | 'translucent' | 'transparent';
|
|
5
|
+
headerMode?: 'none' | 'use';
|
|
6
|
+
titleText?: PDSTextType;
|
|
7
|
+
descText?: PDSTextType;
|
|
8
|
+
captionText?: PDSTextType;
|
|
9
|
+
titleStyleTheme?: 'headingBold' | 'subTitleBold';
|
|
10
|
+
headerDisplayType?: 'none' | 'ibtn1';
|
|
11
|
+
headerIBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
12
|
+
headerIBtn1IconFillType?: 'line' | 'fill';
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
textFieldState?: 'normal' | 'read_only' | 'disabled';
|
|
15
|
+
textFieldHintText?: PDSTextType;
|
|
16
|
+
textFieldDefaultText?: PDSTextType;
|
|
17
|
+
textFieldMaxLength?: number;
|
|
18
|
+
scrollVisibleType?: 'moving' | 'hidden' | 'visible';
|
|
19
|
+
footerChildren?: React.ReactNode;
|
|
20
|
+
submitIBtnState?: 'disabled' | 'normal';
|
|
21
|
+
bodyMBtnText?: PDSTextType;
|
|
22
|
+
bodySpacingMode?: 'none' | 'use';
|
|
23
|
+
submitIBtnIconName?: FillIconNameKeys | LineIconNameKeys;
|
|
24
|
+
submitIBtnIconFillType?: 'fill' | 'line';
|
|
25
|
+
footerIBtn1State?: 'disabled' | 'normal';
|
|
26
|
+
footerIBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
27
|
+
footerIBtn1IconFillType?: 'fill' | 'line';
|
|
28
|
+
footerIBtn1Type?: 'button' | 'upload';
|
|
29
|
+
onClickFooterIBtn1?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
30
|
+
footerIBtn2State?: 'disabled' | 'normal';
|
|
31
|
+
footerIBtn2IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
32
|
+
footerIBtn2IconFillType?: 'fill' | 'line';
|
|
33
|
+
footerIBtn2Type?: 'button' | 'upload';
|
|
34
|
+
onClickFooterIBtn2?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
35
|
+
footerIBtn3State?: 'disabled' | 'normal';
|
|
36
|
+
footerIBtn3IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
37
|
+
footerIBtn3IconFillType?: 'fill' | 'line';
|
|
38
|
+
footerIBtn3Type?: 'button' | 'upload';
|
|
39
|
+
footerIBtn3Accept?: string;
|
|
40
|
+
onClickFooterIBtn3?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
41
|
+
onSubmit: (value: string) => void;
|
|
42
|
+
onClickHeaderIBtn1?: () => void;
|
|
43
|
+
};
|
|
44
|
+
declare const ChatList: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export default ChatList;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var react_1 = __importStar(require("react"));
|
|
41
|
+
var react_hook_form_1 = require("react-hook-form");
|
|
42
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
43
|
+
var hybrid_1 = require("../../../hybrid");
|
|
44
|
+
var Body_1 = __importDefault(require("./Body"));
|
|
45
|
+
var Footer_1 = __importDefault(require("./Footer"));
|
|
46
|
+
var Header_1 = __importDefault(require("./Header"));
|
|
47
|
+
var baseBackgroundColors = {
|
|
48
|
+
solid: 'ui_cpnt_list_base_area_solid',
|
|
49
|
+
translucent: 'ui_cpnt_list_base_area_translucent',
|
|
50
|
+
transparent: 'ui_cpnt_list_base_area_translucent'
|
|
51
|
+
};
|
|
52
|
+
var ChatList = react_1.default.forwardRef(function (_a, ref) {
|
|
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
|
+
var methods = (0, react_hook_form_1.useForm)({
|
|
55
|
+
mode: 'onChange',
|
|
56
|
+
defaultValues: {
|
|
57
|
+
chat: ''
|
|
58
|
+
}
|
|
59
|
+
});
|
|
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]);
|
|
71
|
+
var inputValue = (0, react_hook_form_1.useWatch)({ name: 'chat', control: control });
|
|
72
|
+
var isSubmitButtonActive = (0, react_1.useMemo)(function () {
|
|
73
|
+
if (!submitIBtnState) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return isDirty && isValid && inputValue.length > 0 && submitIBtnState === 'normal';
|
|
77
|
+
}, [isDirty, isValid, inputValue, submitIBtnState]);
|
|
78
|
+
var handleSubmitChat = function (_a) {
|
|
79
|
+
var chat = _a.chat;
|
|
80
|
+
if (!chat || !isSubmitButtonActive) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
onSubmit(chat);
|
|
84
|
+
};
|
|
85
|
+
var callBackAfterScrollToBottom = function () {
|
|
86
|
+
reset();
|
|
87
|
+
};
|
|
88
|
+
return (react_1.default.createElement(S_ChatList, { backgroundColor: baseBackgroundColors[styleTheme], id: "chatList" },
|
|
89
|
+
headerMode === 'use' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
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 }),
|
|
91
|
+
react_1.default.createElement(hybrid_1.Divider, null))),
|
|
92
|
+
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted: isSubmitSuccessful, bodyMBtnText: bodyMBtnText, bodySpacingMode: bodySpacingMode, callBackAfterScrollToBottom: callBackAfterScrollToBottom, ref: ref }, children),
|
|
93
|
+
react_1.default.createElement(hybrid_1.Divider, null),
|
|
94
|
+
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" }),
|
|
95
|
+
react_1.default.createElement(react_hook_form_1.FormProvider, __assign({}, methods),
|
|
96
|
+
react_1.default.createElement("form", { onSubmit: handleSubmit(handleSubmitChat) },
|
|
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 }))),
|
|
98
|
+
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" })));
|
|
99
|
+
});
|
|
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) {
|
|
101
|
+
var backgroundColor = _a.backgroundColor, theme = _a.theme;
|
|
102
|
+
return theme[backgroundColor];
|
|
103
|
+
});
|
|
104
|
+
exports.default = ChatList;
|
|
105
|
+
var templateObject_1;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys } from '../../../common';
|
|
3
|
+
import type { Props as ChatListProps } from './ChatList';
|
|
4
|
+
declare type Props = Pick<ChatListProps, 'textFieldDefaultText' | 'textFieldHintText' | 'textFieldState' | 'textFieldMaxLength' | 'footerIBtn3Accept'> & {
|
|
5
|
+
isSubmitBtnActive?: boolean;
|
|
6
|
+
submitIBtnIconName?: FillIconNameKeys | LineIconNameKeys;
|
|
7
|
+
submitIBtnIconFillType?: 'fill' | 'line';
|
|
8
|
+
footerIBtn1State?: 'disabled' | 'normal';
|
|
9
|
+
footerIBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
10
|
+
footerIBtn1IconFillType?: 'fill' | 'line';
|
|
11
|
+
footerIBtn1Type?: 'button' | 'upload';
|
|
12
|
+
onClickFooterIBtn1?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
footerIBtn2State?: 'disabled' | 'normal';
|
|
14
|
+
footerIBtn2IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
15
|
+
footerIBtn2IconFillType?: 'fill' | 'line';
|
|
16
|
+
footerIBtn2Type?: 'button' | 'upload';
|
|
17
|
+
onClickFooterIBtn2?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
18
|
+
footerIBtn3State?: 'disabled' | 'normal';
|
|
19
|
+
footerIBtn3IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
20
|
+
footerIBtn3IconFillType?: 'fill' | 'line';
|
|
21
|
+
footerIBtn3Type?: 'button' | 'upload';
|
|
22
|
+
onClickFooterIBtn3?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
23
|
+
};
|
|
24
|
+
declare function ChatTextField({ textFieldDefaultText, textFieldHintText, textFieldState, textFieldMaxLength, isSubmitBtnActive, submitIBtnIconName, submitIBtnIconFillType, footerIBtn1State, footerIBtn1IconName, footerIBtn1IconFillType, footerIBtn1Type, onClickFooterIBtn1, footerIBtn2State, footerIBtn2IconName, footerIBtn2IconFillType, footerIBtn2Type, onClickFooterIBtn2, footerIBtn3State, footerIBtn3IconName, footerIBtn3IconFillType, footerIBtn3Type, footerIBtn3Accept, onClickFooterIBtn3 }: Props): JSX.Element;
|
|
25
|
+
export default ChatTextField;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
var react_1 = __importDefault(require("react"));
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var IconButton_1 = require("../IconButton");
|
|
13
|
+
var TextField_1 = require("../TextField");
|
|
14
|
+
var UploadIconButton_1 = require("../UploadIconButton");
|
|
15
|
+
function ChatTextField(_a) {
|
|
16
|
+
var textFieldDefaultText = _a.textFieldDefaultText, textFieldHintText = _a.textFieldHintText, textFieldState = _a.textFieldState, textFieldMaxLength = _a.textFieldMaxLength, isSubmitBtnActive = _a.isSubmitBtnActive, _b = _a.submitIBtnIconName, submitIBtnIconName = _b === void 0 ? 'ic_paper_plane' : _b, _c = _a.submitIBtnIconFillType, submitIBtnIconFillType = _c === void 0 ? 'fill' : _c, footerIBtn1State = _a.footerIBtn1State, footerIBtn1IconName = _a.footerIBtn1IconName, footerIBtn1IconFillType = _a.footerIBtn1IconFillType, footerIBtn1Type = _a.footerIBtn1Type, onClickFooterIBtn1 = _a.onClickFooterIBtn1, footerIBtn2State = _a.footerIBtn2State, footerIBtn2IconName = _a.footerIBtn2IconName, footerIBtn2IconFillType = _a.footerIBtn2IconFillType, footerIBtn2Type = _a.footerIBtn2Type, onClickFooterIBtn2 = _a.onClickFooterIBtn2, footerIBtn3State = _a.footerIBtn3State, footerIBtn3IconName = _a.footerIBtn3IconName, footerIBtn3IconFillType = _a.footerIBtn3IconFillType, footerIBtn3Type = _a.footerIBtn3Type, footerIBtn3Accept = _a.footerIBtn3Accept, onClickFooterIBtn3 = _a.onClickFooterIBtn3;
|
|
17
|
+
var chatValidation = {
|
|
18
|
+
validate: function (value) {
|
|
19
|
+
if (!value)
|
|
20
|
+
return true;
|
|
21
|
+
return value.trim().length ? true : false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
25
|
+
react_1.default.createElement(S_FooterContentWrapper, { footerIBtn2IconName: footerIBtn2IconName, footerIBtn3IconName: footerIBtn3IconName },
|
|
26
|
+
footerIBtn3IconName && (react_1.default.createElement(react_1.default.Fragment, null, footerIBtn3Type === 'button' ? (react_1.default.createElement(IconButton_1.IconButton, { iconName: footerIBtn3IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: footerIBtn3State === 'normal'
|
|
27
|
+
? 'ui_cpnt_button_icon_primary'
|
|
28
|
+
: 'ui_cpnt_button_icon_disabled', iconFillType: footerIBtn3IconFillType, iconSize: 24, state: footerIBtn3State, onClick: onClickFooterIBtn3 })) : (react_1.default.createElement(UploadIconButton_1.UploadIconButton, { iconName: footerIBtn3IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: footerIBtn3State === 'normal'
|
|
29
|
+
? 'ui_cpnt_button_icon_primary'
|
|
30
|
+
: 'ui_cpnt_button_icon_disabled', iconFillType: footerIBtn3IconFillType, iconSize: 24, state: footerIBtn3State, onClick: onClickFooterIBtn3, accept: footerIBtn3Accept })))),
|
|
31
|
+
footerIBtn2IconName && (react_1.default.createElement(react_1.default.Fragment, null, footerIBtn2Type === 'button' ? (react_1.default.createElement(IconButton_1.IconButton, { iconName: footerIBtn2IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: footerIBtn2State === 'normal'
|
|
32
|
+
? 'ui_cpnt_button_icon_primary'
|
|
33
|
+
: 'ui_cpnt_button_icon_disabled', iconFillType: footerIBtn2IconFillType, iconSize: 24, state: footerIBtn2State, onClick: onClickFooterIBtn2 })) : (react_1.default.createElement(UploadIconButton_1.UploadIconButton, { iconName: footerIBtn2IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: footerIBtn2State === 'normal'
|
|
34
|
+
? 'ui_cpnt_button_icon_primary'
|
|
35
|
+
: 'ui_cpnt_button_icon_disabled', iconFillType: footerIBtn2IconFillType, iconSize: 24, state: footerIBtn2State, onClick: onClickFooterIBtn2 })))),
|
|
36
|
+
react_1.default.createElement(S_TextFieldWrapper, null,
|
|
37
|
+
react_1.default.createElement(TextField_1.TextField, { name: "chat", responsiveMode: "use", textLineType: "single", inputType: "text", hintText: textFieldHintText, defaultText: textFieldDefaultText, validation: chatValidation, maxLength: textFieldMaxLength, enterSubmitMode: "use", validationPoint: "onChange", state: textFieldState, autoComplete: "off" })),
|
|
38
|
+
footerIBtn1IconName && (react_1.default.createElement(react_1.default.Fragment, null, footerIBtn1Type === 'button' ? (react_1.default.createElement(IconButton_1.IconButton, { iconName: footerIBtn1IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: footerIBtn1State === 'normal'
|
|
39
|
+
? 'ui_cpnt_button_icon_primary'
|
|
40
|
+
: 'ui_cpnt_button_icon_disabled', iconFillType: footerIBtn1IconFillType, iconSize: 24, state: footerIBtn1State, onClick: onClickFooterIBtn1 })) : (react_1.default.createElement(UploadIconButton_1.UploadIconButton, { iconName: footerIBtn1IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: footerIBtn1State === 'normal'
|
|
41
|
+
? 'ui_cpnt_button_icon_primary'
|
|
42
|
+
: 'ui_cpnt_button_icon_disabled', iconFillType: footerIBtn1IconFillType, iconSize: 24, state: footerIBtn1State, onClick: onClickFooterIBtn1 })))),
|
|
43
|
+
react_1.default.createElement(IconButton_1.IconButton, { iconName: submitIBtnIconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: isSubmitBtnActive ? 'ui_cpnt_button_icon_primary' : 'ui_cpnt_button_icon_disabled', iconFillType: submitIBtnIconFillType, iconSize: 24, type: "submit", state: isSubmitBtnActive ? 'normal' : 'disabled' }))));
|
|
44
|
+
}
|
|
45
|
+
var S_FooterContentWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: center;\n display: flex;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
46
|
+
var theme = _a.theme, footerIBtn2IconName = _a.footerIBtn2IconName, footerIBtn3IconName = _a.footerIBtn3IconName;
|
|
47
|
+
return footerIBtn2IconName || footerIBtn3IconName
|
|
48
|
+
? "" + theme.spacing.spacingC
|
|
49
|
+
: "" + theme.spacing.spacingE;
|
|
50
|
+
}, function (_a) {
|
|
51
|
+
var theme = _a.theme;
|
|
52
|
+
return theme.spacing.spacingC;
|
|
53
|
+
});
|
|
54
|
+
var S_TextFieldWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n margin-right: ", ";\n"], ["\n flex: 1;\n margin-right: ", ";\n"])), function (_a) {
|
|
55
|
+
var theme = _a.theme;
|
|
56
|
+
return theme.spacing.spacingB;
|
|
57
|
+
});
|
|
58
|
+
exports.default = ChatTextField;
|
|
59
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys } from '../../../common';
|
|
3
|
+
import type { Props as ChatListProps } from './ChatList';
|
|
4
|
+
declare type Props = Pick<ChatListProps, 'footerChildren' | 'textFieldDefaultText' | 'textFieldHintText' | 'textFieldState' | 'textFieldMaxLength' | 'footerIBtn3Accept'> & {
|
|
5
|
+
isSubmitBtnActive: boolean;
|
|
6
|
+
submitIBtnIconName?: FillIconNameKeys | LineIconNameKeys;
|
|
7
|
+
submitIBtnIconFillType?: 'fill' | 'line';
|
|
8
|
+
footerIBtn1State?: 'disabled' | 'normal';
|
|
9
|
+
footerIBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
10
|
+
footerIBtn1IconFillType?: 'fill' | 'line';
|
|
11
|
+
footerIBtn1Type?: 'button' | 'upload';
|
|
12
|
+
onClickFooterIBtn1?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
footerIBtn2State?: 'disabled' | 'normal';
|
|
14
|
+
footerIBtn2IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
15
|
+
footerIBtn2IconFillType?: 'fill' | 'line';
|
|
16
|
+
footerIBtn2Type?: 'button' | 'upload';
|
|
17
|
+
onClickFooterIBtn2?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
18
|
+
footerIBtn3State?: 'disabled' | 'normal';
|
|
19
|
+
footerIBtn3IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
20
|
+
footerIBtn3IconFillType?: 'fill' | 'line';
|
|
21
|
+
footerIBtn3Type?: 'button' | 'upload';
|
|
22
|
+
onClickFooterIBtn3?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
23
|
+
};
|
|
24
|
+
declare function Footer({ footerChildren, textFieldDefaultText, textFieldHintText, textFieldState, textFieldMaxLength, submitIBtnIconName, submitIBtnIconFillType, isSubmitBtnActive, footerIBtn1State, footerIBtn1IconName, footerIBtn1IconFillType, footerIBtn1Type, onClickFooterIBtn1, footerIBtn2State, footerIBtn2IconName, footerIBtn2IconFillType, footerIBtn2Type, onClickFooterIBtn2, footerIBtn3State, footerIBtn3IconName, footerIBtn3IconFillType, footerIBtn3Type, footerIBtn3Accept, onClickFooterIBtn3 }: Props): JSX.Element;
|
|
25
|
+
export default Footer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
var react_1 = __importDefault(require("react"));
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var ChatTextField_1 = __importDefault(require("./ChatTextField"));
|
|
13
|
+
function Footer(_a) {
|
|
14
|
+
var footerChildren = _a.footerChildren, textFieldDefaultText = _a.textFieldDefaultText, textFieldHintText = _a.textFieldHintText, textFieldState = _a.textFieldState, textFieldMaxLength = _a.textFieldMaxLength, submitIBtnIconName = _a.submitIBtnIconName, submitIBtnIconFillType = _a.submitIBtnIconFillType, isSubmitBtnActive = _a.isSubmitBtnActive, footerIBtn1State = _a.footerIBtn1State, footerIBtn1IconName = _a.footerIBtn1IconName, footerIBtn1IconFillType = _a.footerIBtn1IconFillType, footerIBtn1Type = _a.footerIBtn1Type, onClickFooterIBtn1 = _a.onClickFooterIBtn1, footerIBtn2State = _a.footerIBtn2State, footerIBtn2IconName = _a.footerIBtn2IconName, footerIBtn2IconFillType = _a.footerIBtn2IconFillType, footerIBtn2Type = _a.footerIBtn2Type, onClickFooterIBtn2 = _a.onClickFooterIBtn2, footerIBtn3State = _a.footerIBtn3State, footerIBtn3IconName = _a.footerIBtn3IconName, footerIBtn3IconFillType = _a.footerIBtn3IconFillType, footerIBtn3Type = _a.footerIBtn3Type, footerIBtn3Accept = _a.footerIBtn3Accept, onClickFooterIBtn3 = _a.onClickFooterIBtn3;
|
|
15
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
16
|
+
react_1.default.createElement(ChatTextField_1.default, { textFieldDefaultText: textFieldDefaultText, textFieldHintText: textFieldHintText, textFieldState: textFieldState, textFieldMaxLength: textFieldMaxLength, isSubmitBtnActive: isSubmitBtnActive, 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 }),
|
|
17
|
+
react_1.default.createElement(S_FooterChildrenWrapper, null, footerChildren)));
|
|
18
|
+
}
|
|
19
|
+
var S_FooterChildrenWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
20
|
+
var theme = _a.theme;
|
|
21
|
+
return theme.spacing.spacingE;
|
|
22
|
+
}, function (_a) {
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return theme.spacing.spacingC;
|
|
25
|
+
});
|
|
26
|
+
exports.default = Footer;
|
|
27
|
+
var templateObject_1;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Props as ChatListProps } from './ChatList';
|
|
3
|
+
declare type Props = Required<Pick<ChatListProps, 'styleTheme'>> & Pick<ChatListProps, 'titleText' | 'descText' | 'captionText' | 'titleStyleTheme' | 'headerDisplayType' | 'headerIBtn1IconName' | 'headerIBtn1IconFillType' | 'onClickHeaderIBtn1'>;
|
|
4
|
+
declare function Header({ styleTheme, titleText, descText, captionText, titleStyleTheme, headerDisplayType, headerIBtn1IconName, headerIBtn1IconFillType, onClickHeaderIBtn1 }: Props): JSX.Element;
|
|
5
|
+
export default Header;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
var react_1 = __importDefault(require("react"));
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var hybrid_1 = require("../../../hybrid");
|
|
13
|
+
var IconButton_1 = require("../IconButton");
|
|
14
|
+
var TextLabel_1 = require("../TextLabel");
|
|
15
|
+
var titleTextColors = {
|
|
16
|
+
solid: 'sysTextPrimary',
|
|
17
|
+
translucent: 'sysTextWhite',
|
|
18
|
+
transparent: 'sysTextWhite'
|
|
19
|
+
};
|
|
20
|
+
var iconColors = {
|
|
21
|
+
solid: 'ui_cpnt_button_icon_enabled',
|
|
22
|
+
translucent: 'ui_cpnt_button_icon_white',
|
|
23
|
+
transparent: 'ui_cpnt_button_icon_white'
|
|
24
|
+
};
|
|
25
|
+
function Header(_a) {
|
|
26
|
+
var styleTheme = _a.styleTheme, titleText = _a.titleText, descText = _a.descText, captionText = _a.captionText, titleStyleTheme = _a.titleStyleTheme, headerDisplayType = _a.headerDisplayType, headerIBtn1IconName = _a.headerIBtn1IconName, headerIBtn1IconFillType = _a.headerIBtn1IconFillType, onClickHeaderIBtn1 = _a.onClickHeaderIBtn1;
|
|
27
|
+
return (react_1.default.createElement(S_HeaderContentWrapper, null,
|
|
28
|
+
react_1.default.createElement(S_HeaderLeftBox, null,
|
|
29
|
+
titleText && (react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, styleTheme: titleStyleTheme, colorTheme: titleTextColors[styleTheme], wordBreak: "break_all" })),
|
|
30
|
+
descText && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
|
+
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c" }),
|
|
32
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: descText, styleTheme: "body2Regular", colorTheme: "sysTextSecondary", colorOverride: styleTheme === 'translucent' ? 'ui_cpnt_list_text_caption_02' : undefined, wordBreak: "break_all" }))),
|
|
33
|
+
captionText && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
34
|
+
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a" }),
|
|
35
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, styleTheme: "caption1Regular", colorTheme: "sysTextTertiary", colorOverride: styleTheme === 'translucent' ? 'ui_cpnt_list_text_caption_03' : undefined, wordBreak: "break_all" })))),
|
|
36
|
+
headerDisplayType === 'ibtn1' && headerIBtn1IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: headerIBtn1IconName, baseSize: "large", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: iconColors[styleTheme], iconSize: 24, iconFillType: headerIBtn1IconFillType, onClick: onClickHeaderIBtn1 }))));
|
|
37
|
+
}
|
|
38
|
+
var S_HeaderContentWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"], ["\n align-items: center;\n display: flex;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"])), function (_a) {
|
|
39
|
+
var theme = _a.theme;
|
|
40
|
+
return theme.spacing.spacingD;
|
|
41
|
+
}, function (_a) {
|
|
42
|
+
var theme = _a.theme;
|
|
43
|
+
return theme.spacing.spacingE;
|
|
44
|
+
}, function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return theme.spacing.spacingC;
|
|
47
|
+
}, function (_a) {
|
|
48
|
+
var theme = _a.theme;
|
|
49
|
+
return theme.spacing.spacingD;
|
|
50
|
+
});
|
|
51
|
+
var S_HeaderLeftBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
|
|
52
|
+
exports.default = Header;
|
|
53
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ChatList } from './ChatList';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChatList = void 0;
|
|
7
|
+
var ChatList_1 = require("./ChatList");
|
|
8
|
+
Object.defineProperty(exports, "ChatList", { enumerable: true, get: function () { return __importDefault(ChatList_1).default; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
behavior?: 'auto' | 'smooth';
|
|
4
|
+
heightOfEndOfList?: number;
|
|
5
|
+
};
|
|
6
|
+
declare function useAutoScrollToBottom({ behavior, heightOfEndOfList }?: Props): {
|
|
7
|
+
triggerScrollToBottom: () => void;
|
|
8
|
+
EndOfList: () => JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export default useAutoScrollToBottom;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
var react_1 = __importStar(require("react"));
|
|
23
|
+
function useAutoScrollToBottom(_a) {
|
|
24
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.behavior, behavior = _c === void 0 ? 'auto' : _c, _d = _b.heightOfEndOfList, heightOfEndOfList = _d === void 0 ? 10 : _d;
|
|
25
|
+
var scrollRef = (0, react_1.useRef)(null);
|
|
26
|
+
var _e = (0, react_1.useState)(false), scrollTrigger = _e[0], setScrollTrigger = _e[1];
|
|
27
|
+
/**
|
|
28
|
+
* @when scrollTrigger가 변할 때마다(false -> true, vice versa)
|
|
29
|
+
* @expected EndOfList가 화면에 보이도록 스크롤 한다.
|
|
30
|
+
* @clear -
|
|
31
|
+
*/
|
|
32
|
+
(0, react_1.useEffect)(function () {
|
|
33
|
+
if (scrollRef.current) {
|
|
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);
|
|
40
|
+
}
|
|
41
|
+
}, [scrollTrigger]);
|
|
42
|
+
var triggerScrollToBottom = (0, react_1.useCallback)(function () {
|
|
43
|
+
setScrollTrigger(function (prev) { return !prev; });
|
|
44
|
+
}, []);
|
|
45
|
+
function EndOfList() {
|
|
46
|
+
return react_1.default.createElement("li", { style: { listStyle: 'none', height: heightOfEndOfList + "px" }, ref: scrollRef });
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
triggerScrollToBottom: triggerScrollToBottom,
|
|
50
|
+
EndOfList: EndOfList
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.default = useAutoScrollToBottom;
|