pds-dev-kit-web 2.2.311 → 2.2.313
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/common/styles/colorSet/UIColor.json +1 -1
- package/dist/src/common/styles/colorSet/index.d.ts +772 -772
- package/dist/src/common/styles/colorSet/index.js +3 -3
- package/dist/src/desktop/components/Chip/Chip.d.ts +4 -2
- package/dist/src/desktop/components/Chip/Chip.js +17 -17
- package/dist/src/desktop/components/ComboBox/ComboBox.d.ts +42 -0
- package/dist/src/desktop/components/ComboBox/ComboBox.js +463 -0
- package/dist/src/desktop/components/ComboBox/index.d.ts +1 -0
- package/dist/src/desktop/components/ComboBox/index.js +8 -0
- package/dist/src/desktop/components/ContextMenu/ContextMenu.d.ts +2 -1
- package/dist/src/desktop/components/ContextMenu/ContextMenu.js +2 -2
- package/dist/src/desktop/components/index.d.ts +2 -1
- package/dist/src/desktop/components/index.js +4 -2
- package/dist/src/desktop/index.d.ts +1 -1
- package/dist/src/desktop/index.js +3 -2
- package/dist/src/mobile/components/Chip/Chip.d.ts +4 -2
- package/dist/src/mobile/components/Chip/Chip.js +17 -17
- package/dist/src/mobile/components/ComboBox/ComboBox.d.ts +42 -0
- package/dist/src/mobile/components/ComboBox/ComboBox.js +463 -0
- package/dist/src/mobile/components/ComboBox/index.d.ts +1 -0
- package/dist/src/mobile/components/ComboBox/index.js +8 -0
- package/dist/src/mobile/components/ContextMenu/ContextMenu.d.ts +2 -1
- package/dist/src/mobile/components/ContextMenu/ContextMenu.js +2 -2
- package/dist/src/mobile/components/index.d.ts +2 -1
- package/dist/src/mobile/components/index.js +3 -1
- package/dist/src/mobile/index.d.ts +1 -1
- package/dist/src/mobile/index.js +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +69 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +4 -1
- package/package.json +1 -1
- package/release-note.md +2 -2
|
@@ -173,9 +173,77 @@ function Button(props) {
|
|
|
173
173
|
var _o = extractBorderStyles(propsStyle), borderNormalStyle = _o.borderStyleProps, cleanedNormalStyle = _o.remainingStyle;
|
|
174
174
|
// hover 스타일 분리
|
|
175
175
|
var _p = extractBorderStyles(propsHoverStyle), borderHoverStyle = _p.borderStyleProps, cleanedHoverStyle = _p.remainingStyle;
|
|
176
|
+
/**
|
|
177
|
+
* 텍스트가 Rich Text(HTML)인지 Plain Text인지 판별합니다.
|
|
178
|
+
* @param {string} text - 확인할 문자열
|
|
179
|
+
* @returns {boolean} - HTML 태그가 포함되어 있으면 true
|
|
180
|
+
*/
|
|
181
|
+
var isRichText = function (text) {
|
|
182
|
+
if (typeof text !== 'string')
|
|
183
|
+
return false;
|
|
184
|
+
// HTML 태그를 찾는 정규 표현식
|
|
185
|
+
var htmlRegex = /<[a-z][\s\S]*>/i;
|
|
186
|
+
return htmlRegex.test(text);
|
|
187
|
+
};
|
|
188
|
+
function domstringToPlain(domstring, ellipsis, useEnter) {
|
|
189
|
+
var tempDivElement = document.createElement('div');
|
|
190
|
+
tempDivElement.innerHTML = domstring;
|
|
191
|
+
// 1. 제거하고 싶은 '비-텍스트' 태그들을 정의하고 모두 삭제합니다.
|
|
192
|
+
var tagsToRemove = ['iframe', 'img', 'video', 'audio', 'script', 'style', 'canvas', 'svg'];
|
|
193
|
+
tagsToRemove.forEach(function (tagName) {
|
|
194
|
+
var elements = tempDivElement.querySelectorAll(tagName);
|
|
195
|
+
elements.forEach(function (el) { return el.remove(); });
|
|
196
|
+
});
|
|
197
|
+
// 2. 텍스트 추출 (위에서 태그를 지웠으므로 순수 텍스트만 남음)
|
|
198
|
+
var plainText = tempDivElement.textContent || tempDivElement.innerText || '';
|
|
199
|
+
// 3. 공백 처리
|
|
200
|
+
var processedText = plainText.replace(/\s{2,}/gi, ' ');
|
|
201
|
+
// 4. 말줄임표 처리
|
|
202
|
+
if (ellipsis && processedText.length > ellipsis) {
|
|
203
|
+
return "".concat(processedText.slice(0, ellipsis), "...");
|
|
204
|
+
}
|
|
205
|
+
// 5. 줄바꿈 처리 로직
|
|
206
|
+
if (useEnter) {
|
|
207
|
+
// innerHTML에서 br과 p 태그를 변환하기 전에,
|
|
208
|
+
// 이미 1번 단계에서 이미지/이프레임 등이 제거된 상태의 innerHTML을 사용합니다.
|
|
209
|
+
processedText = tempDivElement.innerHTML
|
|
210
|
+
.replace(/<br\s*\/?>/gi, '\n')
|
|
211
|
+
.replace(/<\/p>/gi, '\n')
|
|
212
|
+
.replace(/>/gi, '>')
|
|
213
|
+
.replace(/</gi, '<')
|
|
214
|
+
.replace(/&/gi, '&')
|
|
215
|
+
.replace(/<p[^>]*>/gi, '')
|
|
216
|
+
.replace(/<\/?[^>]+(>|$)/g, ''); // 남은 모든 HTML 태그 제거 (정규식 추가)
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
// 줄바꿈을 공백으로 치환하거나 <br>로 치환 (상황에 따라 선택)
|
|
220
|
+
processedText = processedText.replace(/\n/gi, ' ').trim();
|
|
221
|
+
}
|
|
222
|
+
return processedText;
|
|
223
|
+
}
|
|
224
|
+
var getTruncatedText = function (text) {
|
|
225
|
+
var _a;
|
|
226
|
+
if (!text || typeof text !== 'string') {
|
|
227
|
+
return text;
|
|
228
|
+
}
|
|
229
|
+
// const maxLength = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
|
|
230
|
+
var maxLength = device === 'MOBILE'
|
|
231
|
+
? (_a = props.CB_STYLE_PROP_TEXT['CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:MOBILE']) !== null && _a !== void 0 ? _a : props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS
|
|
232
|
+
: props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
|
|
233
|
+
if (isRichText(text)) {
|
|
234
|
+
return domstringToPlain(text, maxLength, true);
|
|
235
|
+
}
|
|
236
|
+
if (!maxLength) {
|
|
237
|
+
return text;
|
|
238
|
+
}
|
|
239
|
+
if (text.length > maxLength) {
|
|
240
|
+
return "".concat(text.slice(0, maxLength), "...");
|
|
241
|
+
}
|
|
242
|
+
return text;
|
|
243
|
+
};
|
|
176
244
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle, style: { paddingLeft: paddingLeft, paddingRight: paddingRight, paddingBottom: paddingBottom, paddingTop: paddingTop } }, { children: (0, jsx_runtime_1.jsx)(S_ShadowBox, __assign({ "$normalStyle": __assign(__assign(__assign({ height: '100%', display: 'flex', alignItems: "".concat(btnTextStyle.alignItems), overflowY: 'hidden', scrollbarWidth: btnTextStyle.scrollbarWidth }, effectCssProperties), normalShadowStyle), borderNormalStyle), "$hoverStyle": __assign(__assign({}, hoverShadowStyle), borderHoverStyle) }, { children: (0, jsx_runtime_1.jsxs)(S_CB_Box_1.S_CB_Box, __assign({ onMouseLeave: function (e) {
|
|
177
245
|
e.currentTarget.classList.remove('hovered');
|
|
178
|
-
}, className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), cleanedNormalStyle), layoutStyle), btnColorStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, overflowY: 'unset', scrollbarWidth: 'unset' }), hoverStyle: __assign(__assign(__assign(__assign({}, btnTextHoverStyle), cleanedHoverStyle), btnColorHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: [textPrefix, textValue(), textSuffix] })) })) }))] }));
|
|
246
|
+
}, className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), cleanedNormalStyle), layoutStyle), btnColorStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, overflowY: 'unset', scrollbarWidth: 'unset' }), hoverStyle: __assign(__assign(__assign(__assign({}, btnTextHoverStyle), cleanedHoverStyle), btnColorHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: [textPrefix, textValue() === 'ERROR' ? 'EDITOR:FALLBACK_TEXT' : getTruncatedText(textValue()), textSuffix] })) })) }))] }));
|
|
179
247
|
}
|
|
180
248
|
function extractBorderStyles(style) {
|
|
181
249
|
var
|
|
@@ -158,10 +158,13 @@ function Text(props) {
|
|
|
158
158
|
return props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT;
|
|
159
159
|
};
|
|
160
160
|
var getTruncatedText = function (text) {
|
|
161
|
+
var _a;
|
|
161
162
|
if (!text || typeof text !== 'string') {
|
|
162
163
|
return text;
|
|
163
164
|
}
|
|
164
|
-
var maxLength =
|
|
165
|
+
var maxLength = device === 'MOBILE'
|
|
166
|
+
? (_a = props.CB_STYLE_PROP_TEXT['CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:MOBILE']) !== null && _a !== void 0 ? _a : props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS
|
|
167
|
+
: props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
|
|
165
168
|
if (isRichText(text)) {
|
|
166
169
|
return domstringToPlain(text, maxLength, true);
|
|
167
170
|
}
|
package/package.json
CHANGED
package/release-note.md
CHANGED