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.
Files changed (31) hide show
  1. package/dist/src/common/styles/colorSet/UIColor.json +1 -1
  2. package/dist/src/common/styles/colorSet/index.d.ts +772 -772
  3. package/dist/src/common/styles/colorSet/index.js +3 -3
  4. package/dist/src/desktop/components/Chip/Chip.d.ts +4 -2
  5. package/dist/src/desktop/components/Chip/Chip.js +17 -17
  6. package/dist/src/desktop/components/ComboBox/ComboBox.d.ts +42 -0
  7. package/dist/src/desktop/components/ComboBox/ComboBox.js +463 -0
  8. package/dist/src/desktop/components/ComboBox/index.d.ts +1 -0
  9. package/dist/src/desktop/components/ComboBox/index.js +8 -0
  10. package/dist/src/desktop/components/ContextMenu/ContextMenu.d.ts +2 -1
  11. package/dist/src/desktop/components/ContextMenu/ContextMenu.js +2 -2
  12. package/dist/src/desktop/components/index.d.ts +2 -1
  13. package/dist/src/desktop/components/index.js +4 -2
  14. package/dist/src/desktop/index.d.ts +1 -1
  15. package/dist/src/desktop/index.js +3 -2
  16. package/dist/src/mobile/components/Chip/Chip.d.ts +4 -2
  17. package/dist/src/mobile/components/Chip/Chip.js +17 -17
  18. package/dist/src/mobile/components/ComboBox/ComboBox.d.ts +42 -0
  19. package/dist/src/mobile/components/ComboBox/ComboBox.js +463 -0
  20. package/dist/src/mobile/components/ComboBox/index.d.ts +1 -0
  21. package/dist/src/mobile/components/ComboBox/index.js +8 -0
  22. package/dist/src/mobile/components/ContextMenu/ContextMenu.d.ts +2 -1
  23. package/dist/src/mobile/components/ContextMenu/ContextMenu.js +2 -2
  24. package/dist/src/mobile/components/index.d.ts +2 -1
  25. package/dist/src/mobile/components/index.js +3 -1
  26. package/dist/src/mobile/index.d.ts +1 -1
  27. package/dist/src/mobile/index.js +3 -2
  28. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +69 -1
  29. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +4 -1
  30. package/package.json +1 -1
  31. 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(/&gt;/gi, '>')
213
+ .replace(/&lt;/gi, '<')
214
+ .replace(/&amp;/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 = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.311",
3
+ "version": "2.2.313",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.311]
2
+ ## [v2.2.313]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### 업데이트 사항
6
- * SNS line icon 추가
6
+ * [PDS-1423] ComboBox 추가