@nuka9510/simple-validation 1.0.4 → 1.0.6
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/README.md +88 -27
- package/package.json +3 -2
- package/tsconfig.json +16 -16
package/README.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
|
-
[![
|
|
2
|
-
[![
|
|
1
|
+
[![LICENSE][license]][license-url]
|
|
2
|
+
[![GITHUB-VERSION][github-version]][github-version-url]
|
|
3
|
+
[![NPM-VERSION][npm-version]][npm-version-url]
|
|
4
|
+
![GITHUB-LAST-COMMIT][github-last-commit]
|
|
5
|
+
![NPM-LAST-UPDATE][npm-last-update]
|
|
6
|
+
![GITHUB-REPO-SIZE][github-repo-size]
|
|
7
|
+
![NPM-UNPACKED-SIZE][npm-unpacked-size]
|
|
8
|
+
![JSDELIVR-DOWNLOAD][jsdelivr-download]
|
|
9
|
+
![NPM-DOWNLOAD][npm-download]
|
|
10
|
+
![TOP-LANGUAGE][top-language]
|
|
11
|
+
|
|
12
|
+
[license]: https://img.shields.io/npm/l/%40nuka9510%2Fsimple-validation
|
|
13
|
+
[license-url]: https://github.com/nuka9510/simple-validation/blob/main/LICENSE
|
|
14
|
+
|
|
15
|
+
[github-version]: https://img.shields.io/github/package-json/v/nuka9510/simple-validation?logo=github
|
|
16
|
+
[github-version-url]: https://github.com/nuka9510/simple-validation
|
|
17
|
+
|
|
18
|
+
[npm-version]: https://img.shields.io/npm/v/%40nuka9510%2Fsimple-validation?logo=npm
|
|
19
|
+
[npm-version-url]: https://www.npmjs.com/package/@nuka9510/simple-validation
|
|
20
|
+
|
|
21
|
+
[github-last-commit]: https://img.shields.io/github/last-commit/nuka9510/simple-validation?logo=github
|
|
22
|
+
|
|
23
|
+
[npm-last-update]: https://img.shields.io/npm/last-update/%40nuka9510%2Fsimple-validation?logo=npm
|
|
24
|
+
|
|
25
|
+
[github-repo-size]: https://img.shields.io/github/repo-size/nuka9510/simple-validation?logo=github
|
|
26
|
+
|
|
27
|
+
[npm-unpacked-size]: https://img.shields.io/npm/unpacked-size/%40nuka9510%2Fsimple-validation?logo=npm
|
|
28
|
+
|
|
29
|
+
[jsdelivr-download]: https://img.shields.io/jsdelivr/npm/hm/%40nuka9510/simple-validation?logo=jsdelivr
|
|
30
|
+
|
|
31
|
+
[npm-download]: https://img.shields.io/npm/dm/%40nuka9510%2Fsimple-validation?logo=npm
|
|
32
|
+
|
|
33
|
+
[top-language]: https://img.shields.io/github/languages/top/nuka9510/simple-validation
|
|
3
34
|
|
|
4
35
|
# simple-validation
|
|
5
36
|
## Installation
|
|
@@ -7,26 +38,61 @@
|
|
|
7
38
|
npm i @nuka9510/simple-validation
|
|
8
39
|
```
|
|
9
40
|
## Usage
|
|
41
|
+
### npm
|
|
42
|
+
```
|
|
43
|
+
<script type="importmap">
|
|
44
|
+
{
|
|
45
|
+
"imports": {
|
|
46
|
+
"@nuka9510/js-util": "<path>/node_modules/@nuka9510/js-util/dist/index.js",
|
|
47
|
+
"@nuka9510/simple-validation": "<path>/node_modules/@nuka9510/simple-validation/dist/index.js"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
52
|
+
### cdn
|
|
53
|
+
```
|
|
54
|
+
<script type="importmap">
|
|
55
|
+
{
|
|
56
|
+
"imports": {
|
|
57
|
+
"@nuka9510/js-util": "https://cdn.jsdelivr.net/npm/@nuka9510/js-util/dist/index.js",
|
|
58
|
+
"@nuka9510/simple-validation": "https://cdn.jsdelivr.net/npm/@nuka9510/simple-validation/dist/index.js"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
```
|
|
63
|
+
or
|
|
64
|
+
```
|
|
65
|
+
<script type="importmap">
|
|
66
|
+
{
|
|
67
|
+
"imports": {
|
|
68
|
+
"@nuka9510/js-util": "https://cdn.jsdelivr.net/npm/@nuka9510/js-util@latest/dist/index.js",
|
|
69
|
+
"@nuka9510/simple-validation": "https://cdn.jsdelivr.net/npm/@nuka9510/simple-validation@latest/dist/index.js"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
10
73
|
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
74
|
+
or
|
|
75
|
+
```
|
|
76
|
+
<script type="importmap">
|
|
77
|
+
{
|
|
78
|
+
"imports": {
|
|
79
|
+
"@nuka9510/js-util": "https://cdn.jsdelivr.net/npm/@nuka9510/js-util@<specific-version>/dist/index.js",
|
|
80
|
+
"@nuka9510/simple-validation": "https://cdn.jsdelivr.net/npm/@nuka9510/simple-validation@<specific-version>/dist/index.js"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
```
|
|
85
|
+
### example
|
|
86
|
+
```
|
|
87
|
+
example
|
|
88
|
+
├── js
|
|
89
|
+
│ └── index.js
|
|
90
|
+
└── view
|
|
91
|
+
└── index.html
|
|
26
92
|
```
|
|
27
93
|
* example/js/index.js
|
|
28
94
|
```
|
|
29
|
-
import { SValidation } from "@
|
|
95
|
+
import { SValidation } from "@nuka9510/simple-validation";
|
|
30
96
|
|
|
31
97
|
class Index {
|
|
32
98
|
constructor() {
|
|
@@ -36,7 +102,7 @@ class Index {
|
|
|
36
102
|
}
|
|
37
103
|
|
|
38
104
|
init() {
|
|
39
|
-
document.querySelectorAll('[data-action]').forEach((...arg) => { arg[0].addEventListener('click', this.onValidationCheckClick); });
|
|
105
|
+
document.querySelectorAll('[data-action="validation-check-click"]').forEach((...arg) => { arg[0].addEventListener('click', this.onValidationCheckClick); });
|
|
40
106
|
}
|
|
41
107
|
|
|
42
108
|
onValidationCheckClick(ev) {
|
|
@@ -73,16 +139,11 @@ new Index();
|
|
|
73
139
|
<script type="importmap">
|
|
74
140
|
{
|
|
75
141
|
"imports": {
|
|
76
|
-
"@nuka9510/js-util": "/
|
|
77
|
-
"@
|
|
142
|
+
"@nuka9510/js-util": "https://cdn.jsdelivr.net/npm/@nuka9510/js-util/dist/index.js",
|
|
143
|
+
"@nuka9510/simple-validation": "https://cdn.jsdelivr.net/npm/@nuka9510/simple-validation/dist/index.js"
|
|
78
144
|
}
|
|
79
145
|
}
|
|
80
146
|
</script>
|
|
81
147
|
<script type="module" src="../js/index.js"></script>
|
|
82
148
|
</html>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
[github]: https://img.shields.io/badge/github-blue.svg?style=flat&logo=github
|
|
86
|
-
[github-url]: https://github.com/nuka9510/simple-validation
|
|
87
|
-
[npm]: https://img.shields.io/badge/npm-1.0.4-blue.svg?style=flat&logo=nodedotjs
|
|
88
|
-
[npm-url]: https://www.npmjs.com/package/@nuka9510/simple-validation
|
|
149
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuka9510/simple-validation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "simple validation util for web front-end",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"directories": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"web",
|
|
18
|
+
"module",
|
|
18
19
|
"front-end",
|
|
19
20
|
"util",
|
|
20
21
|
"validation"
|
|
@@ -26,6 +27,6 @@
|
|
|
26
27
|
},
|
|
27
28
|
"homepage": "https://github.com/nuka9510/simple-validation",
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@nuka9510/js-util": "^1.0.
|
|
30
|
+
"@nuka9510/js-util": "^1.0.23"
|
|
30
31
|
}
|
|
31
32
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"typeRoots": ["@types"],
|
|
4
|
+
"checkJs": true,
|
|
5
|
+
"strictNullChecks": false,
|
|
6
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"useDefineForClassFields": true,
|
|
10
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
11
|
+
"target": "ESNext",
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"outDir": "dist"
|
|
14
|
+
},
|
|
15
|
+
"include": [
|
|
16
|
+
"src/index.ts"
|
|
17
|
+
]
|
|
18
18
|
}
|