@team-monolith/cds 1.13.1 → 1.14.0

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.
@@ -2,6 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from "@emotion/react";
4
4
  import styled from "@emotion/styled";
5
+ import SquareButton from "../components/SquareButton";
5
6
  import { ArrowDownSLineIcon, ArrowUpSLineIcon } from "../icons";
6
7
  /** 배너같이 생겼으나 누를 때마다 하단내용이 접힘(보이지않음)/펼침(보임) 상태가 바뀌는 컴포넌트입니다. */
7
8
  export function Accordion(props) {
@@ -10,7 +11,7 @@ export function Accordion(props) {
10
11
  display: flex;
11
12
  flex-direction: column;
12
13
  gap: 2px;
13
- ` }, { children: [_jsxs(Container, Object.assign({ className: className, onClick: onClick }, { children: [_jsxs(Title, { children: [icon, title] }), open ? _jsx(ArrowUpSLineIcon, {}) : _jsx(ArrowDownSLineIcon, {})] })), open && children] })));
14
+ ` }, { children: [_jsxs(Container, Object.assign({ className: className, onClick: onClick }, { children: [_jsxs(Title, { children: [icon, title] }), _jsx(SquareButton, { icon: open ? _jsx(ArrowUpSLineIcon, {}) : _jsx(ArrowDownSLineIcon, {}), size: "xsmall", color: "icon" })] })), open && children] })));
14
15
  }
15
16
  const Title = styled.div(({ theme }) => css `
16
17
  display: flex;
@@ -33,7 +33,21 @@ export default function SegmentedInput(props) {
33
33
  }
34
34
  }, onChange: (event) => {
35
35
  var _a;
36
- onChange(event.target.value);
36
+ // 입력한 값중 공백을 강제로 제거합니다.
37
+ const despacedValue = event.target.value.replace(/ /g, "");
38
+ // format에 따라 공백을 추가합니다. 선언적으로 작성할시 비직관적이라 이렇게 작성했습니다.
39
+ let formattedValue = "";
40
+ let answerIndex = 0;
41
+ for (const element of splitedFormat) {
42
+ if (element === " ") {
43
+ formattedValue += " ";
44
+ }
45
+ else {
46
+ formattedValue += despacedValue[answerIndex] || "";
47
+ answerIndex++;
48
+ }
49
+ }
50
+ onChange(formattedValue);
37
51
  const selectionStart = (_a = hiddenRef.current) === null || _a === void 0 ? void 0 : _a.selectionStart;
38
52
  setFocusedIndex(selectionStart ? selectionStart - 1 : null);
39
53
  }, onBlur: (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,