pds-dev-kit-web 1.4.24 → 1.4.27
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 +2 -2
- package/dist/src/common/components/BoxLayout/Row.js +1 -1
- package/dist/src/common/components/Navigations/ContextTextLabelNav.d.ts +2 -2
- package/dist/src/common/components/Navigations/ContextTextLabelNav.js +9 -4
- package/dist/src/desktop/components/AdminListHeader/HeaderBar.js +1 -1
- package/dist/src/desktop/components/BasicChatListItem/BasicChatListItem.d.ts +3 -3
- package/dist/src/desktop/components/BasicChatListItem/BasicChatListItem.js +30 -43
- 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/BodyTextGroup/BodyTextGroup.d.ts +4 -1
- package/dist/src/desktop/components/BodyTextGroup/BodyTextGroup.js +4 -4
- package/dist/src/desktop/components/ChatList/Body.d.ts +2 -2
- package/dist/src/desktop/components/ChatList/Body.js +11 -12
- package/dist/src/desktop/components/ChatList/ChatList.d.ts +5 -5
- package/dist/src/desktop/components/ChatList/ChatList.js +6 -6
- package/dist/src/desktop/components/ChatList/Header.d.ts +2 -2
- package/dist/src/desktop/components/ChatList/Header.js +2 -2
- 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 +1 -1
- package/dist/src/desktop/components/Dropdown/Dropdown.js +1 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/ContextMenuNavs/ContextMenuItemNav.js +4 -38
- 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/mobile/components/BasicChatListItem/BasicChatListItem.d.ts +3 -3
- package/dist/src/mobile/components/BasicChatListItem/BasicChatListItem.js +30 -43
- 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/BodyTextGroup/BodyTextGroup.d.ts +4 -1
- package/dist/src/mobile/components/BodyTextGroup/BodyTextGroup.js +4 -4
- package/dist/src/mobile/components/ChatList/Body.d.ts +2 -2
- package/dist/src/mobile/components/ChatList/Body.js +4 -3
- package/dist/src/mobile/components/ChatList/ChatList.d.ts +5 -5
- package/dist/src/mobile/components/ChatList/ChatList.js +7 -7
- package/dist/src/mobile/components/ChatList/Header.d.ts +2 -2
- package/dist/src/mobile/components/ChatList/Header.js +2 -2
- 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 +1 -1
- package/dist/src/mobile/components/Dropdown/Dropdown.js +1 -1
- package/package.json +1 -1
- package/release-note.md +11 -9
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
exports.Popup = exports.PopupProvider = void 0;
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
31
|
+
var react_dom_1 = require("react-dom");
|
|
32
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
33
|
+
var PopupContext = (0, react_1.createContext)({
|
|
34
|
+
current: null
|
|
35
|
+
});
|
|
36
|
+
function getHAutoPlacement(_a) {
|
|
37
|
+
var targetRect = _a.targetRect, popupRect = _a.popupRect;
|
|
38
|
+
var leftSpaced = targetRect.right + popupRect.width > window.innerWidth;
|
|
39
|
+
var topSpaced = targetRect.bottom + popupRect.height > window.innerHeight;
|
|
40
|
+
return (leftSpaced ? 'left' : 'right') + "-" + (topSpaced ? 'end' : 'start');
|
|
41
|
+
}
|
|
42
|
+
function getVAutoPlacement(_a) {
|
|
43
|
+
var targetRect = _a.targetRect, popupRect = _a.popupRect, wrapperHeight = _a.wrapperHeight;
|
|
44
|
+
var leftSpaced = targetRect.right + popupRect.width > window.innerWidth;
|
|
45
|
+
var topSpaced = targetRect.bottom + popupRect.height > (wrapperHeight || window.innerWidth);
|
|
46
|
+
return (topSpaced ? 'top' : 'bottom') + "-" + (leftSpaced ? 'end' : 'start');
|
|
47
|
+
}
|
|
48
|
+
function getVCenterPlacement(_a) {
|
|
49
|
+
var targetRect = _a.targetRect, popupRect = _a.popupRect;
|
|
50
|
+
var leftSpaced = targetRect.right + popupRect.width > window.innerWidth;
|
|
51
|
+
return leftSpaced ? 'left-center' : 'right-center';
|
|
52
|
+
}
|
|
53
|
+
function getHCenterPlacement(_a) {
|
|
54
|
+
var targetRect = _a.targetRect, popupRect = _a.popupRect;
|
|
55
|
+
var topSpaced = targetRect.bottom + popupRect.height > window.innerHeight;
|
|
56
|
+
return topSpaced ? 'top-center' : 'bottom-center';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 위치 정규화
|
|
60
|
+
*/
|
|
61
|
+
function getNormalizedPlacement(_a) {
|
|
62
|
+
var placement = _a.placement, targetRect = _a.targetRect, popupRect = _a.popupRect, wrapperHeight = _a.wrapperHeight;
|
|
63
|
+
switch (placement) {
|
|
64
|
+
case 'v-auto':
|
|
65
|
+
return getVAutoPlacement({ targetRect: targetRect, popupRect: popupRect, wrapperHeight: wrapperHeight });
|
|
66
|
+
case 'h-auto':
|
|
67
|
+
return getHAutoPlacement({ targetRect: targetRect, popupRect: popupRect, wrapperHeight: wrapperHeight });
|
|
68
|
+
case 'v-center':
|
|
69
|
+
return getVCenterPlacement({ targetRect: targetRect, popupRect: popupRect, wrapperHeight: wrapperHeight });
|
|
70
|
+
case 'h-center':
|
|
71
|
+
return getHCenterPlacement({ targetRect: targetRect, popupRect: popupRect, wrapperHeight: wrapperHeight });
|
|
72
|
+
default:
|
|
73
|
+
return placement;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function updatePosition(_a) {
|
|
77
|
+
var targetElem = _a.targetElem, popupElem = _a.popupElem, placement = _a.placement, wrapperHeight = _a.wrapperHeight;
|
|
78
|
+
var targetRect = targetElem.getBoundingClientRect();
|
|
79
|
+
var popupRect = popupElem.getBoundingClientRect();
|
|
80
|
+
var normPlacement = getNormalizedPlacement({ placement: placement, targetRect: targetRect, popupRect: popupRect, wrapperHeight: wrapperHeight });
|
|
81
|
+
switch (normPlacement) {
|
|
82
|
+
case 'top':
|
|
83
|
+
popupElem.style.top = targetRect.top - popupRect.height + "px";
|
|
84
|
+
popupElem.style.left = targetRect.left - (popupRect.width - targetRect.width) / 2 + "px";
|
|
85
|
+
popupElem.style.width = 'auto';
|
|
86
|
+
break;
|
|
87
|
+
case 'top-start':
|
|
88
|
+
popupElem.style.top = targetRect.top - popupRect.height + "px";
|
|
89
|
+
popupElem.style.left = targetRect.left + "px";
|
|
90
|
+
popupElem.style.width = 'auto';
|
|
91
|
+
break;
|
|
92
|
+
case 'top-end':
|
|
93
|
+
popupElem.style.top = targetRect.top - popupRect.height + "px";
|
|
94
|
+
popupElem.style.left = targetRect.left + targetRect.width - popupRect.width + "px";
|
|
95
|
+
popupElem.style.width = 'auto';
|
|
96
|
+
break;
|
|
97
|
+
case 'top-both':
|
|
98
|
+
popupElem.style.top = targetRect.top - popupRect.height + "px";
|
|
99
|
+
popupElem.style.left = targetRect.left + "px";
|
|
100
|
+
popupElem.style.width = targetRect.width + "px";
|
|
101
|
+
break;
|
|
102
|
+
case 'top-center':
|
|
103
|
+
popupElem.style.top = targetRect.top - popupRect.height + "px";
|
|
104
|
+
popupElem.style.left = targetRect.left - (popupRect.width - targetRect.width) / 2 + "px";
|
|
105
|
+
popupElem.style.width = 'auto';
|
|
106
|
+
break;
|
|
107
|
+
case 'bottom':
|
|
108
|
+
popupElem.style.top = targetRect.bottom + "px";
|
|
109
|
+
popupElem.style.left = targetRect.left - (popupRect.width - targetRect.width) / 2 + "px";
|
|
110
|
+
popupElem.style.width = 'auto';
|
|
111
|
+
break;
|
|
112
|
+
case 'bottom-start':
|
|
113
|
+
popupElem.style.top = targetRect.bottom + "px";
|
|
114
|
+
popupElem.style.left = targetRect.left + "px";
|
|
115
|
+
popupElem.style.width = 'auto';
|
|
116
|
+
break;
|
|
117
|
+
case 'bottom-end':
|
|
118
|
+
popupElem.style.top = targetRect.bottom + "px";
|
|
119
|
+
popupElem.style.left = targetRect.right - popupRect.width + "px";
|
|
120
|
+
popupElem.style.width = 'auto';
|
|
121
|
+
break;
|
|
122
|
+
case 'bottom-both':
|
|
123
|
+
popupElem.style.top = targetRect.bottom + "px";
|
|
124
|
+
popupElem.style.left = targetRect.left + "px";
|
|
125
|
+
popupElem.style.width = targetRect.width + "px";
|
|
126
|
+
break;
|
|
127
|
+
case 'bottom-center':
|
|
128
|
+
popupElem.style.top = targetRect.bottom + "px";
|
|
129
|
+
popupElem.style.left = targetRect.left - (popupRect.width - targetRect.width) / 2 + "px";
|
|
130
|
+
popupElem.style.width = 'auto';
|
|
131
|
+
break;
|
|
132
|
+
case 'left':
|
|
133
|
+
popupElem.style.top = targetRect.top - (popupRect.height - targetRect.height) / 2 + "px";
|
|
134
|
+
popupElem.style.left = targetRect.left - popupRect.width + "px";
|
|
135
|
+
popupElem.style.width = 'auto';
|
|
136
|
+
break;
|
|
137
|
+
case 'left-start':
|
|
138
|
+
popupElem.style.top = targetRect.top + "px";
|
|
139
|
+
popupElem.style.left = targetRect.left - popupRect.width + "px";
|
|
140
|
+
popupElem.style.width = 'auto';
|
|
141
|
+
break;
|
|
142
|
+
case 'left-end':
|
|
143
|
+
popupElem.style.top = targetRect.top - (popupRect.height - targetRect.height) + "px";
|
|
144
|
+
popupElem.style.left = targetRect.left - popupRect.width + "px";
|
|
145
|
+
popupElem.style.width = 'auto';
|
|
146
|
+
break;
|
|
147
|
+
case 'left-center':
|
|
148
|
+
popupElem.style.top = targetRect.top - (popupRect.height - targetRect.height) / 2 + "px";
|
|
149
|
+
popupElem.style.left = targetRect.left - popupRect.width + "px";
|
|
150
|
+
popupElem.style.width = 'auto';
|
|
151
|
+
break;
|
|
152
|
+
case 'right':
|
|
153
|
+
popupElem.style.top = targetRect.top - (popupRect.height - targetRect.height) / 2 + "px";
|
|
154
|
+
popupElem.style.left = targetRect.left + targetRect.width + "px";
|
|
155
|
+
popupElem.style.width = 'auto';
|
|
156
|
+
break;
|
|
157
|
+
case 'right-start':
|
|
158
|
+
popupElem.style.top = targetRect.top + "px";
|
|
159
|
+
popupElem.style.left = targetRect.left + targetRect.width + "px";
|
|
160
|
+
popupElem.style.width = 'auto';
|
|
161
|
+
break;
|
|
162
|
+
case 'right-end':
|
|
163
|
+
popupElem.style.top = targetRect.top - (popupRect.height - targetRect.height) + "px";
|
|
164
|
+
popupElem.style.left = targetRect.left + targetRect.width + "px";
|
|
165
|
+
popupElem.style.width = 'auto';
|
|
166
|
+
break;
|
|
167
|
+
case 'right-center':
|
|
168
|
+
popupElem.style.top = targetRect.top - (popupRect.height - targetRect.height) / 2 + "px";
|
|
169
|
+
popupElem.style.left = targetRect.left + targetRect.width + "px";
|
|
170
|
+
popupElem.style.width = 'auto';
|
|
171
|
+
break;
|
|
172
|
+
default:
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
return normPlacement;
|
|
176
|
+
}
|
|
177
|
+
function Popup(_a) {
|
|
178
|
+
var targetRef = _a.targetRef, _b = _a.isOpen, isOpen = _b === void 0 ? false : _b, onClickOutside = _a.onClickOutside, onClick = _a.onClick, _c = _a.placement, placement = _c === void 0 ? 'bottom-start' : _c, wrapperHeight = _a.wrapperHeight, children = _a.children;
|
|
179
|
+
var popupRootRef = (0, react_1.useContext)(PopupContext);
|
|
180
|
+
var _d = (0, react_1.useState)('bottom'), normPlacement = _d[0], setNormPlacement = _d[1];
|
|
181
|
+
var popupRef = (0, react_1.useRef)(null);
|
|
182
|
+
/**
|
|
183
|
+
* 팝업 외의 다른 요소 클릭시 팝업이 닫히도록 합니다.
|
|
184
|
+
*/
|
|
185
|
+
(0, react_1.useEffect)(function () {
|
|
186
|
+
function handleClickOutside(e) {
|
|
187
|
+
if (popupRootRef.current && !popupRootRef.current.contains(e.target)) {
|
|
188
|
+
if (onClickOutside) {
|
|
189
|
+
onClickOutside();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
window.document.addEventListener('mousedown', handleClickOutside);
|
|
194
|
+
return function () {
|
|
195
|
+
window.document.removeEventListener('mousedown', handleClickOutside);
|
|
196
|
+
};
|
|
197
|
+
}, [popupRootRef, onClickOutside]);
|
|
198
|
+
/**
|
|
199
|
+
* 전체 UI 렌더링이 한 프레임 완료된 후에 팝업 위치를 결정합니다.
|
|
200
|
+
*/
|
|
201
|
+
(0, react_1.useEffect)(function () {
|
|
202
|
+
window.requestAnimationFrame(function () {
|
|
203
|
+
if (!targetRef.current || !popupRef.current) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
var targetElem = targetRef.current;
|
|
207
|
+
var popupElem = popupRef.current;
|
|
208
|
+
var updatedPlacement = updatePosition({ targetElem: targetElem, popupElem: popupElem, placement: placement, wrapperHeight: wrapperHeight });
|
|
209
|
+
setNormPlacement(updatedPlacement);
|
|
210
|
+
});
|
|
211
|
+
}, [isOpen, placement, wrapperHeight, targetRef, popupRef]);
|
|
212
|
+
function handlePopupClick(e) {
|
|
213
|
+
e.stopPropagation();
|
|
214
|
+
if (onClick) {
|
|
215
|
+
onClick(e);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (!popupRootRef || !popupRootRef.current || !isOpen) {
|
|
219
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
220
|
+
}
|
|
221
|
+
var popupComponent = (react_1.default.createElement(S_Popup, { ref: popupRef, onClick: function (e) { return handlePopupClick(e); } }, typeof children === 'function' ? children(normPlacement) : children));
|
|
222
|
+
return (0, react_dom_1.createPortal)(popupComponent, popupRootRef.current);
|
|
223
|
+
}
|
|
224
|
+
exports.Popup = Popup;
|
|
225
|
+
var S_Popup = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n left: -1000px;\n position: fixed;\n top: -1000px;\n z-index: 1000;\n"], ["\n left: -1000px;\n position: fixed;\n top: -1000px;\n z-index: 1000;\n"])));
|
|
226
|
+
/**
|
|
227
|
+
* 팝업 루트 프로바이더
|
|
228
|
+
* 팝업을 사용하기 위해서는 팝업 프로바이더가 상위 컴포넌트로 있어야 합니다.
|
|
229
|
+
*/
|
|
230
|
+
function PopupProvider(_a) {
|
|
231
|
+
var children = _a.children;
|
|
232
|
+
var ref = (0, react_1.useRef)();
|
|
233
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
234
|
+
react_1.default.createElement(PopupContext.Provider, { value: ref }, children),
|
|
235
|
+
react_1.default.createElement("div", { ref: ref })));
|
|
236
|
+
}
|
|
237
|
+
exports.PopupProvider = PopupProvider;
|
|
238
|
+
var templateObject_1;
|
|
@@ -4,7 +4,10 @@ declare type BodyTextGroupProps = {
|
|
|
4
4
|
titleText: PDSTextType;
|
|
5
5
|
descText?: PDSTextType;
|
|
6
6
|
contentText?: PDSTextType;
|
|
7
|
+
titleTextWordBreak?: 'normal' | 'break_all' | 'keep_all' | 'break_word';
|
|
8
|
+
descTextWordBreak?: 'normal' | 'break_all' | 'keep_all' | 'break_word';
|
|
9
|
+
contentTextWordBreak?: 'normal' | 'break_all' | 'keep_all' | 'break_word';
|
|
7
10
|
contentFontWeight?: 'regular' | 'bold';
|
|
8
11
|
};
|
|
9
|
-
declare function BodyTextGroup({ titleText, descText, contentText, contentFontWeight }: BodyTextGroupProps): JSX.Element;
|
|
12
|
+
declare function BodyTextGroup({ titleText, descText, contentText, titleTextWordBreak, descTextWordBreak, contentTextWordBreak, contentFontWeight }: BodyTextGroupProps): JSX.Element;
|
|
10
13
|
export default BodyTextGroup;
|
|
@@ -7,14 +7,14 @@ var react_1 = __importDefault(require("react"));
|
|
|
7
7
|
var hybrid_1 = require("../../../hybrid");
|
|
8
8
|
var TextLabel_1 = require("../TextLabel");
|
|
9
9
|
function BodyTextGroup(_a) {
|
|
10
|
-
var titleText = _a.titleText, descText = _a.descText, contentText = _a.contentText, _b = _a.contentFontWeight, contentFontWeight =
|
|
10
|
+
var titleText = _a.titleText, descText = _a.descText, contentText = _a.contentText, _b = _a.titleTextWordBreak, titleTextWordBreak = _b === void 0 ? 'keep_all' : _b, _c = _a.descTextWordBreak, descTextWordBreak = _c === void 0 ? 'keep_all' : _c, _d = _a.contentTextWordBreak, contentTextWordBreak = _d === void 0 ? 'keep_all' : _d, _e = _a.contentFontWeight, contentFontWeight = _e === void 0 ? 'regular' : _e;
|
|
11
11
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, styleTheme: "subTitleBold", colorTheme: "sysTextPrimary" }),
|
|
12
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, wordBreak: titleTextWordBreak, styleTheme: "subTitleBold", colorTheme: "sysTextPrimary" }),
|
|
13
13
|
descText && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
14
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" }),
|
|
15
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: descText, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary" }))),
|
|
15
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: descText, wordBreak: descTextWordBreak, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary" }))),
|
|
16
16
|
contentText && (react_1.default.createElement("div", null,
|
|
17
17
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" }),
|
|
18
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: contentText, styleTheme: contentFontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorTheme: "sysTextPrimary" })))));
|
|
18
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: contentText, wordBreak: contentTextWordBreak, styleTheme: contentFontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorTheme: "sysTextPrimary" })))));
|
|
19
19
|
}
|
|
20
20
|
exports.default = BodyTextGroup;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Props as ChatListProps } from './ChatList';
|
|
3
|
-
declare type Props = Pick<ChatListProps, 'scrollVisibleType' | 'children' | '
|
|
3
|
+
declare type Props = Pick<ChatListProps, 'scrollVisibleType' | 'children' | 'bodyMBtnText'> & {
|
|
4
4
|
isSubmitted: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare function Body({ scrollVisibleType, children, isSubmitted,
|
|
6
|
+
declare function Body({ scrollVisibleType, children, isSubmitted, bodyMBtnText }: Props): JSX.Element;
|
|
7
7
|
export default Body;
|
|
@@ -32,10 +32,11 @@ var MainButton_1 = require("../MainButton");
|
|
|
32
32
|
var useAutoScrollToBottom_1 = __importDefault(require("./useAutoScrollToBottom"));
|
|
33
33
|
var useTimeout_1 = __importDefault(require("./useTimeout"));
|
|
34
34
|
function Body(_a) {
|
|
35
|
-
var scrollVisibleType = _a.scrollVisibleType, children = _a.children, isSubmitted = _a.isSubmitted,
|
|
35
|
+
var scrollVisibleType = _a.scrollVisibleType, children = _a.children, isSubmitted = _a.isSubmitted, bodyMBtnText = _a.bodyMBtnText;
|
|
36
36
|
var _b = (0, react_1.useState)(false), isButtonShow = _b[0], setIsButtonShow = _b[1];
|
|
37
37
|
var _c = (0, useAutoScrollToBottom_1.default)(), triggerScrollToBottom = _c.triggerScrollToBottom, EndOfList = _c.EndOfList;
|
|
38
38
|
var scrollRef = (0, react_1.useRef)(null);
|
|
39
|
+
var childrenLength = react_1.default.Children.count(children);
|
|
39
40
|
var handleTriggerScroll = function () {
|
|
40
41
|
if (isButtonShow) {
|
|
41
42
|
if (isSubmitted) {
|
|
@@ -50,7 +51,7 @@ function Body(_a) {
|
|
|
50
51
|
* @expected 채팅 리스트의 맨 밑으로 스크롤 내린다.
|
|
51
52
|
* @clear -
|
|
52
53
|
*/
|
|
53
|
-
(0, useTimeout_1.default)({ callback: handleTriggerScroll, target:
|
|
54
|
+
(0, useTimeout_1.default)({ callback: handleTriggerScroll, target: childrenLength }, 200);
|
|
54
55
|
var handleClickMBtn = function () {
|
|
55
56
|
triggerScrollToBottom();
|
|
56
57
|
};
|
|
@@ -70,7 +71,7 @@ function Body(_a) {
|
|
|
70
71
|
children,
|
|
71
72
|
react_1.default.createElement(EndOfList, null)),
|
|
72
73
|
isButtonShow && (react_1.default.createElement(S_BottomButtonWrapper, null,
|
|
73
|
-
react_1.default.createElement(MainButton_1.MainButton, { text:
|
|
74
|
+
react_1.default.createElement(MainButton_1.MainButton, { text: bodyMBtnText, size: "small", onClick: handleClickMBtn })))));
|
|
74
75
|
}
|
|
75
76
|
var S_Body = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n"], ["\n flex: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n"])));
|
|
76
77
|
var scrollVisibleStyle = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ::-webkit-scrollbar {\n display: block;\n }\n"], ["\n ::-webkit-scrollbar {\n display: block;\n }\n"])));
|
|
@@ -6,8 +6,8 @@ export declare type Props = {
|
|
|
6
6
|
titleText?: PDSTextType;
|
|
7
7
|
captionText?: PDSTextType;
|
|
8
8
|
headerDisplayType?: 'none' | 'ibtn1';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
headerIBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
10
|
+
headerIBtn1IconFillType?: 'line' | 'fill';
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
textFieldState?: 'normal' | 'read_only' | 'disabled';
|
|
13
13
|
textFieldHintText?: PDSTextType;
|
|
@@ -15,9 +15,9 @@ export declare type Props = {
|
|
|
15
15
|
textFieldMaxLength?: number;
|
|
16
16
|
scrollVisibleType?: 'moving' | 'hidden' | 'visible';
|
|
17
17
|
footerChildren?: React.ReactNode;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
submitIBtnState?: 'disabled' | 'normal';
|
|
19
|
+
bodyMBtnText?: PDSTextType;
|
|
20
20
|
onSubmit: (value: string) => void;
|
|
21
21
|
};
|
|
22
|
-
declare function ChatList({ styleTheme, headerMode, titleText, captionText, headerDisplayType,
|
|
22
|
+
declare function ChatList({ styleTheme, headerMode, titleText, captionText, headerDisplayType, headerIBtn1IconName, headerIBtn1IconFillType, children, textFieldState, textFieldHintText, textFieldDefaultText, textFieldMaxLength, scrollVisibleType, footerChildren, submitIBtnState, bodyMBtnText, onSubmit }: Props): JSX.Element;
|
|
23
23
|
export default ChatList;
|
|
@@ -50,21 +50,21 @@ var baseBackgroundColors = {
|
|
|
50
50
|
transparent: 'ui_cpnt_list_base_area_translucent'
|
|
51
51
|
};
|
|
52
52
|
function ChatList(_a) {
|
|
53
|
-
var _b = _a.styleTheme, styleTheme = _b === void 0 ? 'solid' : _b, _c = _a.headerMode, headerMode = _c === void 0 ? 'use' : _c, titleText = _a.titleText, captionText = _a.captionText, _d = _a.headerDisplayType, headerDisplayType = _d === void 0 ? 'none' : _d, _e = _a.
|
|
53
|
+
var _b = _a.styleTheme, styleTheme = _b === void 0 ? 'solid' : _b, _c = _a.headerMode, headerMode = _c === void 0 ? 'use' : _c, titleText = _a.titleText, captionText = _a.captionText, _d = _a.headerDisplayType, headerDisplayType = _d === void 0 ? 'none' : _d, _e = _a.headerIBtn1IconName, headerIBtn1IconName = _e === void 0 ? 'ic_xmark' : _e, _f = _a.headerIBtn1IconFillType, headerIBtn1IconFillType = _f === void 0 ? 'line' : _f, children = _a.children, _g = _a.textFieldState, textFieldState = _g === void 0 ? 'normal' : _g, textFieldHintText = _a.textFieldHintText, textFieldDefaultText = _a.textFieldDefaultText, textFieldMaxLength = _a.textFieldMaxLength, _h = _a.scrollVisibleType, scrollVisibleType = _h === void 0 ? 'moving' : _h, footerChildren = _a.footerChildren, _j = _a.submitIBtnState, submitIBtnState = _j === void 0 ? 'normal' : _j, bodyMBtnText = _a.bodyMBtnText, onSubmit = _a.onSubmit;
|
|
54
54
|
var methods = (0, react_hook_form_1.useForm)({
|
|
55
55
|
mode: 'onChange',
|
|
56
56
|
defaultValues: {
|
|
57
57
|
chat: ''
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
var reset = methods.reset, handleSubmit = methods.handleSubmit, control = methods.control,
|
|
60
|
+
var reset = methods.reset, handleSubmit = methods.handleSubmit, control = methods.control, _k = methods.formState, isSubmitted = _k.isSubmitted, isValid = _k.isValid, isDirty = _k.isDirty;
|
|
61
61
|
var inputValue = (0, react_hook_form_1.useWatch)({ name: 'chat', control: control });
|
|
62
62
|
var isSubmitButtonActive = (0, react_1.useMemo)(function () {
|
|
63
|
-
if (!
|
|
63
|
+
if (!submitIBtnState) {
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
|
-
return isDirty && isValid && inputValue.length > 0 &&
|
|
67
|
-
}, [isDirty, isValid, inputValue,
|
|
66
|
+
return isDirty && isValid && inputValue.length > 0 && submitIBtnState === 'normal';
|
|
67
|
+
}, [isDirty, isValid, inputValue, submitIBtnState]);
|
|
68
68
|
var handleSubmitChat = function (_a) {
|
|
69
69
|
var chat = _a.chat;
|
|
70
70
|
if (!chat || !isSubmitButtonActive) {
|
|
@@ -75,9 +75,9 @@ function ChatList(_a) {
|
|
|
75
75
|
};
|
|
76
76
|
return (react_1.default.createElement(S_ChatList, { backgroundColor: baseBackgroundColors[styleTheme], id: "chatList" },
|
|
77
77
|
headerMode === 'use' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
78
|
-
react_1.default.createElement(Header_1.default, { styleTheme: styleTheme, titleText: titleText, captionText: captionText, headerDisplayType: headerDisplayType,
|
|
78
|
+
react_1.default.createElement(Header_1.default, { styleTheme: styleTheme, titleText: titleText, captionText: captionText, headerDisplayType: headerDisplayType, headerIBtn1IconName: headerIBtn1IconName, headerIBtn1IconFillType: headerIBtn1IconFillType }),
|
|
79
79
|
react_1.default.createElement(hybrid_1.Divider, null))),
|
|
80
|
-
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted: isSubmitted,
|
|
80
|
+
react_1.default.createElement(Body_1.default, { scrollVisibleType: scrollVisibleType, isSubmitted: isSubmitted, bodyMBtnText: bodyMBtnText }, children),
|
|
81
81
|
react_1.default.createElement(hybrid_1.Divider, null),
|
|
82
82
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d" }),
|
|
83
83
|
react_1.default.createElement(react_hook_form_1.FormProvider, __assign({}, methods),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Props as ChatListProps } from './ChatList';
|
|
3
|
-
declare type Props = Required<Pick<ChatListProps, 'styleTheme'>> & Pick<ChatListProps, 'titleText' | 'captionText' | 'headerDisplayType' | '
|
|
4
|
-
declare function Header({ styleTheme, titleText, captionText, headerDisplayType,
|
|
3
|
+
declare type Props = Required<Pick<ChatListProps, 'styleTheme'>> & Pick<ChatListProps, 'titleText' | 'captionText' | 'headerDisplayType' | 'headerIBtn1IconName' | 'headerIBtn1IconFillType'>;
|
|
4
|
+
declare function Header({ styleTheme, titleText, captionText, headerDisplayType, headerIBtn1IconName, headerIBtn1IconFillType }: Props): JSX.Element;
|
|
5
5
|
export default Header;
|
|
@@ -23,14 +23,14 @@ var iconColors = {
|
|
|
23
23
|
transparent: 'ui_cpnt_button_icon_white'
|
|
24
24
|
};
|
|
25
25
|
function Header(_a) {
|
|
26
|
-
var styleTheme = _a.styleTheme, titleText = _a.titleText, captionText = _a.captionText, headerDisplayType = _a.headerDisplayType,
|
|
26
|
+
var styleTheme = _a.styleTheme, titleText = _a.titleText, captionText = _a.captionText, headerDisplayType = _a.headerDisplayType, headerIBtn1IconName = _a.headerIBtn1IconName, headerIBtn1IconFillType = _a.headerIBtn1IconFillType;
|
|
27
27
|
return (react_1.default.createElement(S_HeaderContentWrapper, null,
|
|
28
28
|
react_1.default.createElement(S_HeaderLeftBox, null,
|
|
29
29
|
titleText && (react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, styleTheme: "body1Bold", colorTheme: titleTextColors[styleTheme] })),
|
|
30
30
|
captionText && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
31
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a" }),
|
|
32
32
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary", colorOverride: styleTheme === 'translucent' ? 'ui_cpnt_list_text_caption_02' : undefined })))),
|
|
33
|
-
headerDisplayType === 'ibtn1' &&
|
|
33
|
+
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 }))));
|
|
34
34
|
}
|
|
35
35
|
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) {
|
|
36
36
|
var theme = _a.theme;
|
|
@@ -3,6 +3,7 @@ declare type ContextMenuProps = {
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
autoWidthMode?: 'none' | 'use';
|
|
5
5
|
maxHeight?: number;
|
|
6
|
+
customWidth?: string;
|
|
6
7
|
};
|
|
7
|
-
declare function ContextMenu({ children, autoWidthMode, maxHeight }: ContextMenuProps): JSX.Element;
|
|
8
|
+
declare function ContextMenu({ children, autoWidthMode, maxHeight, customWidth }: ContextMenuProps): JSX.Element;
|
|
8
9
|
export default ContextMenu;
|
|
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
var react_1 = __importDefault(require("react"));
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
function ContextMenu(_a) {
|
|
13
|
-
var children = _a.children, _b = _a.autoWidthMode, autoWidthMode = _b === void 0 ? 'none' : _b, maxHeight = _a.maxHeight;
|
|
14
|
-
return (react_1.default.createElement(S_ContextMenu, { autoWidth: autoWidthMode === 'use', maxHeight: maxHeight }, children));
|
|
13
|
+
var children = _a.children, _b = _a.autoWidthMode, autoWidthMode = _b === void 0 ? 'none' : _b, maxHeight = _a.maxHeight, customWidth = _a.customWidth;
|
|
14
|
+
return (react_1.default.createElement(S_ContextMenu, { autoWidth: autoWidthMode === 'use', maxHeight: maxHeight, customWidth: customWidth }, children));
|
|
15
15
|
}
|
|
16
|
-
var S_ContextMenu = styled_components_1.default.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 14px;\n box-sizing: border-box;\n box-shadow: ", ";\n list-style: none;\n margin: 0;\n min-width: 128px;\n overflow-y: auto;\n padding: ", " 0;\n vertical-align: baseline;\n width: ", ";\n max-height: ", ";\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 14px;\n box-sizing: border-box;\n box-shadow: ", ";\n list-style: none;\n margin: 0;\n min-width: 128px;\n overflow-y: auto;\n padding: ", " 0;\n vertical-align: baseline;\n width: ", ";\n max-height: ", ";\n"])), function (_a) {
|
|
16
|
+
var S_ContextMenu = styled_components_1.default.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 14px;\n box-sizing: border-box;\n box-shadow: ", ";\n list-style: none;\n margin: 0;\n min-width: 128px;\n overflow-y: auto;\n padding: ", " 0;\n vertical-align: baseline;\n width: ", ";\n max-height: ", ";\n\n ", "\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 14px;\n box-sizing: border-box;\n box-shadow: ", ";\n list-style: none;\n margin: 0;\n min-width: 128px;\n overflow-y: auto;\n padding: ", " 0;\n vertical-align: baseline;\n width: ", ";\n max-height: ", ";\n\n ", "\n"])), function (_a) {
|
|
17
17
|
var theme = _a.theme;
|
|
18
18
|
return theme.ui_cpnt_contextmenu_base;
|
|
19
19
|
}, function (_a) {
|
|
@@ -26,11 +26,20 @@ var S_ContextMenu = styled_components_1.default.ul(templateObject_1 || (template
|
|
|
26
26
|
var theme = _a.theme;
|
|
27
27
|
return theme.spacing.spacingB;
|
|
28
28
|
}, function (_a) {
|
|
29
|
-
var autoWidth = _a.autoWidth;
|
|
30
|
-
|
|
29
|
+
var autoWidth = _a.autoWidth, customWidth = _a.customWidth;
|
|
30
|
+
if (autoWidth) {
|
|
31
|
+
return 'inherit';
|
|
32
|
+
}
|
|
33
|
+
if (customWidth) {
|
|
34
|
+
return 'auto';
|
|
35
|
+
}
|
|
36
|
+
return 'max-content';
|
|
31
37
|
}, function (_a) {
|
|
32
38
|
var maxHeight = _a.maxHeight;
|
|
33
39
|
return (maxHeight ? maxHeight + "px" : 'none');
|
|
40
|
+
}, function (_a) {
|
|
41
|
+
var customWidth = _a.customWidth;
|
|
42
|
+
return customWidth && "width: " + customWidth + ";min-width: " + customWidth + ";";
|
|
34
43
|
});
|
|
35
44
|
exports.default = ContextMenu;
|
|
36
45
|
var templateObject_1;
|
|
@@ -53,7 +53,7 @@ function ContextMenuItem(_a) {
|
|
|
53
53
|
textColorTheme = 'sysTextTertiary';
|
|
54
54
|
}
|
|
55
55
|
return (react_1.default.createElement(S_ContextMenuItem, { size: size, onClick: handleClick, selected: isSelected, disabled: state === 'disabled' },
|
|
56
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: (option === null || option === void 0 ? void 0 : option.text) || text, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: textColorTheme })));
|
|
56
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: (option === null || option === void 0 ? void 0 : option.text) || text, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: textColorTheme, lineLimit: 1, ellipsisMode: "use", wordBreak: "break_all" })));
|
|
57
57
|
}
|
|
58
58
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n padding: 0 ", ";\n"], ["\n height: 48px;\n padding: 0 ", ";\n"])), function (_a) {
|
|
59
59
|
var theme = _a.theme;
|
|
@@ -155,7 +155,7 @@ function Dropdown(_a) {
|
|
|
155
155
|
react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getIconColorKey() }),
|
|
156
156
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d", spacingType: "width" })),
|
|
157
157
|
isFocused && (react_1.default.createElement(S_ContextMenuWrapper, null,
|
|
158
|
-
react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use", maxHeight: maxHeight }, valueArray.map(function (el) { return (react_1.default.createElement(react_1.Fragment, { key: el.value },
|
|
158
|
+
react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use", maxHeight: maxHeight, customWidth: customWidth }, valueArray.map(function (el) { return (react_1.default.createElement(react_1.Fragment, { key: el.value },
|
|
159
159
|
react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { option: el, size: size, isSelected: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) === el.value, onClick: handleClickOption, state: el.state }))); }))))));
|
|
160
160
|
}
|
|
161
161
|
var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n flex: 1;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
package/package.json
CHANGED
package/release-note.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# PDS-DEV-KIT-WEB Release Notes
|
|
2
|
-
## [v1.4.
|
|
2
|
+
## [v1.4.27]
|
|
3
3
|
|
|
4
4
|
### Component
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
5
|
+
* BasicChatListitem
|
|
6
|
+
* 1차 수정 사항 반영
|
|
7
|
+
* BodyTextGroup
|
|
8
|
+
* titleTextWordBreak prop 추가
|
|
9
|
+
* descTextWordBreak prop 추가
|
|
10
|
+
* contentTextWordBreak prop 추가
|
|
11
|
+
* ContextMenu
|
|
12
|
+
* autoWidth, customWidth가 없을 시에 width가 ContextMenuItem의 길이에 맞게 늘어나도록 수정
|
|
13
|
+
* ContextMenuItem
|
|
14
|
+
* 한줄로 표시에 최적화
|