@nuka9510/simple-validation 1.2.8 → 1.4.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.
@@ -1,3 +1,5 @@
1
+ import { Phase } from "@nuka9510/simple-validation";
2
+
1
3
  export type InputElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
2
4
 
3
5
  /** 결과 값 객체 */
@@ -8,23 +10,25 @@ export interface result {
8
10
  alertMsg: string | null;
9
11
  /** #default `null` */
10
12
  el: InputElement | null;
13
+ /** #default `Phase.INIT` */
14
+ phase: Phase;
11
15
  }
12
16
 
13
17
  export interface dateEl {
14
- S?: InputElement;
15
- E?: InputElement;
18
+ S?: HTMLInputElement;
19
+ E?: HTMLInputElement;
20
+ }
21
+
22
+ export interface date {
23
+ [name: string]: dateEl;
16
24
  }
17
25
 
18
- /** validation check할 Element를 담는 객체 */
19
- export interface el {
20
- el?: InputElement[];
21
- date?: {
22
- [date: string]: dateEl;
23
- };
26
+ export interface checkbox {
27
+ [name: string]: HTMLInputElement[];
24
28
  }
25
29
 
26
30
  export interface radio {
27
- [required: string]: InputElement[];
31
+ [name: string]: HTMLInputElement[];
28
32
  }
29
33
 
30
34
  /** validation에 사용할 정규식을 담은 객체 */
package/README.md CHANGED
@@ -79,32 +79,19 @@ npm i @nuka9510/simple-validation
79
79
  - js
80
80
 
81
81
  ```js
82
- const validation = new simpleValidation.Validation({ regex: { test: /^test/ } });
83
-
84
- validation.run(form);
85
-
86
- console.debug(validation.result);
82
+ simpleValidation.Validation;
87
83
  ```
88
84
 
89
85
  - mjs
90
86
 
91
87
  ```js
92
88
  import { Validation } from "@nuka9510/simple-validation";
93
-
94
- const validation = new Validation({ regex: { test: /^test/ } });
95
-
96
- validation.run(form);
97
-
98
- console.debug(validation.result);
99
89
  ```
100
90
 
101
91
  - cjs
102
92
 
103
93
  ```js
104
- const simpleValidation = require('@nuka9510/simple-validation'),
105
- validation = new simpleValidation.Validation({ regex: { test: /^test/ } });
106
-
107
- validation.run(form);
94
+ const simpleValidation = require('@nuka9510/simple-validation');
108
95
 
109
- console.debug(validation.result);
96
+ simpleValidation.Validation;
110
97
  ```