@tide-design/components 0.21.0 → 0.22.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.
|
@@ -11,10 +11,14 @@ export interface NumberFormatInputOwnProps extends NumericFormatOptions {
|
|
|
11
11
|
/** 처음 값(비제어). `value`와 같은 형태다. */
|
|
12
12
|
defaultValue?: number | string | null;
|
|
13
13
|
/**
|
|
14
|
-
* 사용자가 값을 바꾸면 부른다. `value`는 숫자(빈 칸 `null`), `formattedValue`는 화면 글자,
|
|
14
|
+
* 사용자가 값을 바꾸면 객체 하나로 부른다. `value`는 숫자(빈 칸 `null`), `formattedValue`는 화면 글자,
|
|
15
15
|
* `digits`는 숫자만 남긴 문자열이다. 앞자리 0·큰 자릿수(전화·카드번호)는 `digits`를 쓴다.
|
|
16
16
|
*/
|
|
17
|
-
onValueChange?: (
|
|
17
|
+
onValueChange?: (values: {
|
|
18
|
+
value: number | null;
|
|
19
|
+
formattedValue: string;
|
|
20
|
+
digits: string;
|
|
21
|
+
}) => void;
|
|
18
22
|
/** 높이 `sm` 32px, `md` 40px, `lg` 48px. 같은 size의 Input과 같다. 기본값은 `md`다. */
|
|
19
23
|
size?: InputSize;
|
|
20
24
|
/** 오류 상태. `aria-invalid="true"`와 `data-invalid`가 붙는다. Field 값보다 여기 준 값이 이긴다. */
|
|
@@ -33,7 +33,11 @@ function NumberFormatInput({ mask, value, defaultValue, onValueChange, prefix, s
|
|
|
33
33
|
value: next,
|
|
34
34
|
digits: values.value
|
|
35
35
|
};
|
|
36
|
-
onValueChange?.(
|
|
36
|
+
onValueChange?.({
|
|
37
|
+
value: next,
|
|
38
|
+
formattedValue: values.formattedValue,
|
|
39
|
+
digits: values.value
|
|
40
|
+
});
|
|
37
41
|
};
|
|
38
42
|
const shared = {
|
|
39
43
|
...props,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tide-design/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Tide 디자인 시스템의 React Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"./styles.css": "./dist/styles.css"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tide-design/foundation": "0.
|
|
38
|
-
"@tide-design/icons": "0.
|
|
37
|
+
"@tide-design/foundation": "0.22.0",
|
|
38
|
+
"@tide-design/icons": "0.22.0",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"react-aria": "^3.53.1",
|
|
41
41
|
"react-number-format": "^5.4.5",
|