@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.
- package/@types/validation.d.ts +13 -9
- package/README.md +3 -16
- package/dist/cjs/index.cjs +300 -185
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/enums/phase.d.ts +16 -0
- package/dist/enums/phase.js +24 -0
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.mjs +302 -186
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/js/index.js +300 -185
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.min.js +1 -1
- package/dist/validation.d.ts +24 -16
- package/dist/validation.js +243 -185
- package/package.json +3 -2
package/@types/validation.d.ts
CHANGED
|
@@ -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?:
|
|
15
|
-
E?:
|
|
18
|
+
S?: HTMLInputElement;
|
|
19
|
+
E?: HTMLInputElement;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface date {
|
|
23
|
+
[name: string]: dateEl;
|
|
16
24
|
}
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
[
|
|
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
|
-
|
|
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
|
-
|
|
96
|
+
simpleValidation.Validation;
|
|
110
97
|
```
|