react-validate-component 0.1.2 → 0.1.3

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 (2) hide show
  1. package/README.md +48 -18
  2. package/package.json +21 -1
package/README.md CHANGED
@@ -2,10 +2,14 @@
2
2
 
3
3
  `react-validate-component`는 리액트 애플리케이션에서 입력 유효성 검사를 간편하게 처리할 수 있도록 도와주는 라이브러리입니다. 현재 `VText` 컴포넌트가 구현되어 있으며, 이 컴포넌트를 사용하여 간단하게 텍스트 입력의 유효성을 검사할 수 있습니다.
4
4
 
5
- ## 설치
5
+ `react-validate-component` is a library that helps simplify input validation in React applications. Currently, it includes the `VText` component, which allows for easy validation of text input.
6
+
7
+ ## 설치, Install
6
8
 
7
9
  `react-validate-component` 라이브러리는 npm 또는 yarn을 통해 설치할 수 있습니다.
8
10
 
11
+ The `react-validate-component` library can be installed via npm or yarn.
12
+
9
13
  ### npm
10
14
 
11
15
  ```bash
@@ -18,15 +22,19 @@ npm install react-validate-component
18
22
  yarn add react-validate-component
19
23
  ```
20
24
 
21
- ## 사용법
25
+ ## 사용법, How to use
26
+
27
+ 현재 라이브러리에는 `VText` 컴포넌트가 구현되어 있습니다. 이 컴포넌트를 사용하여 텍스트 입력 필드의 유효성 검사를 쉽게 구현할 수 있습니다.
22
28
 
23
- 현재 라이브러리에는 `VText` 컴포넌트가 포함되어 있습니다. 컴포넌트를 사용하여 텍스트 입력 필드의 유효성 검사를 쉽게 구현할 수 있습니다.
29
+ The library currently includes the `VText` component. You can use this component to easily implement validation for text input fields.
24
30
 
25
- ### VText 컴포넌트
31
+ ### VText Component
26
32
 
27
- `VText` 컴포넌트는 기본적인 텍스트 입력 필드와 유효성 검사 기능을 제공합니다.
33
+ `VText` 컴포넌트는 기본적인 텍스트 입력 필드에 유효성 검사 문구를 출력해주는 기능을 제공합니다.
28
34
 
29
- #### 기본 사용 예제
35
+ The `VText` component provides functionality to display validation messages for basic text input fields.
36
+
37
+ #### 사용 예제, Example
30
38
 
31
39
  ```jsx
32
40
  import React from 'react';
@@ -40,7 +48,7 @@ const App = () => {
40
48
  React.useEffect(() => {
41
49
  if (/[\d]/gim.exec(message)) {
42
50
  setVState(true);
43
- setVMessage('숫자는 입력이 안됩니다.');
51
+ setVMessage('DO NOT INPUT NUMBER.');
44
52
  } else {
45
53
  setVState(false);
46
54
  setVMessage('');
@@ -52,15 +60,16 @@ const App = () => {
52
60
  <h1>React-Validate-Component</h1>
53
61
  <div>
54
62
  <h2>VText</h2>
63
+ <h3>DO NOT INPUT NUMBER.</h3>
55
64
  <VText
56
65
  vState={vState}
57
- vClassName={''}
66
+ vType={'outer'}
67
+ vClassName={'test'}
58
68
  vShowMessage={true}
59
69
  vMessage={vMessage}
60
- vIsInnerMessage={true}
61
- vLocateMessage={'top-left'}
70
+ vLocateMessage={'bottom-left'}
62
71
  vMessageClass={styles.validation_message}
63
- vIsAnimate={false}
72
+ vIsAnimate={true}
64
73
  props={{
65
74
  onChange: (e: { target: { value: string } }) => {
66
75
  setMessage(e.target.value);
@@ -81,30 +90,51 @@ export default App;
81
90
  #### Props
82
91
 
83
92
  - `vState` (boolean): 유효성 상태 값입니다.
93
+ - `vType` (`inner`, `outer`, `tooltip`): 유효성 메시지를 띄우는 타입입니다.
84
94
  - `vClassName` (string): 유효성 입힐 class 명입니다.
85
95
  - `vShowMessage` (boolean): 유효성 메시지 출력 여부값입니다.
86
96
  - `vMessage` (string): 유효성 검사 실패 시 표시할 에러 메시지입니다.
87
- - `vIsInnerMessage` (boolean): 유효성 메시지를 element 안에 넣을지 (absolute 형태) 여부입니다.
88
97
  - `vLocateMessage` (`top-left`, `top`, `top-right`, `center-left`, `center`, `center-right`, `bottom-left`, `bottom`, `bottom-right`): 유효성 메시지를 element 어디에 붙일지 위치값입니다.
89
98
  - `vMessageClass` (string): 유효성 메시지에 입힐 class 명입니다.
90
- - `vIsAnimate` (boolean): 유효성 메시지 출력 시 애니메이션 적용할지 여부입니다. (개발중, 삭제될 수 있음)
99
+ - `vIsAnimate` (boolean): 유효성 메시지 출력 시 애니메이션 적용할지 여부입니다. (현재는 opacity만 적용되어있습니다.)
91
100
  - `props` (object): 기타 옵션입니다. 기본 input 태그에 attribute로 넣을 값들을 입력하시면 됩니다.
92
101
 
93
- ### 유효성 검사 규칙
102
+ - `vState` (boolean): The validity status value.
103
+ - `vType` (`inner`, `outer`, `tooltip`): The type of validation message display.
104
+ - `vClassName` (string): The class name to apply for validation styling.
105
+ - `vShowMessage` (boolean): Whether to display the validation message.
106
+ - `vMessage` (string): The error message to display when validation fails.
107
+ - `vLocateMessage` (`top-left`, `top`, `top-right`, `center-left`, `center`, `center-right`, `bottom-left`, `bottom`, `bottom-right`): The position where the validation message should be displayed relative to the element.
108
+ - `vMessageClass` (string): The class name to apply to the validation message.
109
+ - `vIsAnimate` (boolean): Whether to apply animation when displaying the validation message (currently, only opacity animation is supported).
110
+ - `props` (object): Other options. Enter values for attributes that can be added to the basic input tag.
111
+
112
+ ### 유효성 검사 규칙, Validation Rules
94
113
 
95
114
  - 지금은 사용자가 정규식 혹은 함수를 이용해 작성한 유효성검사 로직을 토대로 element에 출력하고 있습니다.
96
115
  - 상단에 예시를 확인하여 주시기 바랍니다.
97
116
 
98
- ## 개발 중인 기능
117
+ - Currently, validation messages are displayed based on validation logic written by the user using regular expressions or functions.
118
+ - Please refer to the examples provided above.
119
+
120
+ ## 개발중인 기능, Features in Development
99
121
 
100
122
  - 현재 `VText` 컴포넌트만 구현되어 있으며, 다른 입력 유형에 대한 컴포넌트도 개발할 예정입니다.
101
123
  - 추가적인 유효성 검사 규칙 및 에러 메시지 처리 기능이 계획되어 있습니다.
102
- - 현재 문서에 이미지를 추가한 문서 업데이트 예정되어있습니다.
124
+ - 현재 문서에 이미지를 추가한 문서 업데이트도 예정되어있습니다.
125
+
126
+ - Currently, only the `VText` component is implemented, but components for other input types are planned for development.
127
+ - Additional validation rules and error message handling features are also in the pipeline.
128
+ - Updates to the documentation, including the addition of images, are also planned.
103
129
 
104
- ## 기여
130
+ ## 기여, Contributions
105
131
 
106
132
  기여를 원하시는 분은 언제든지 pull request를 제출하거나 이슈를 제기해 주세요. 코드 기여 및 피드백을 환영합니다!
107
133
 
108
- ## 라이센스
134
+ If you would like to contribute, please feel free to submit a pull request or open an issue at any time. We welcome code contributions and feedback!
135
+
136
+ ## 라이센스, License
109
137
 
110
138
  이 라이브러리는 [MIT 라이센스](LICENSE) 하에 배포됩니다.
139
+
140
+ This library is distributed under the [MIT License](LICENSE).
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.2",
2
+ "version": "0.1.3",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -38,6 +38,26 @@
38
38
  },
39
39
  "name": "react-validate-component",
40
40
  "author": "JongGeun",
41
+ "description": "A component library that checks the validity of data entered into 'input' tags and displays validation messages.",
42
+ "keywords": [
43
+ "Validation",
44
+ "ErrorMessages",
45
+ "FormValidation",
46
+ "InputFields",
47
+ "ComponentLibrary",
48
+ "UserInput",
49
+ "DataValidation",
50
+ "React",
51
+ "Frontend",
52
+ "FormComponents",
53
+ "CustomValidators",
54
+ "DynamicValidation",
55
+ "FieldErrors"
56
+ ],
57
+ "bugs": {
58
+ "url": "https://github.com/dldvk9999/react-validate-component/issues"
59
+ },
60
+ "homepage": "https://github.com/dldvk9999/react-validate-component/issues",
41
61
  "module": "dist/react-validate-component.esm.js",
42
62
  "size-limit": [
43
63
  {