@creative-web-solution/front-library 7.1.20 → 7.1.21
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/CHANGELOG.md
CHANGED
|
@@ -5,18 +5,15 @@ import InputValidator from './InputValidator';
|
|
|
5
5
|
* Object managing all validation functions
|
|
6
6
|
*/
|
|
7
7
|
class ValidatorFunctions {
|
|
8
|
-
#validators: FLib.Validator.Validator
|
|
8
|
+
#validators: Map<string, FLib.Validator.Validator> = new Map();
|
|
9
9
|
|
|
10
|
-
/*
|
|
11
|
-
* Add new validator to the list
|
|
12
|
-
*/
|
|
13
10
|
addValidator = ( name: string, selector: string, isAsynch: boolean | FLib.Validator.ValidateFunction, func?: FLib.Validator.ValidateFunction ) => {
|
|
14
11
|
if ( typeof func === 'undefined' ) {
|
|
15
12
|
func = (isAsynch as unknown) as FLib.Validator.ValidateFunction;
|
|
16
13
|
isAsynch = false;
|
|
17
14
|
}
|
|
18
15
|
|
|
19
|
-
this.#validators.
|
|
16
|
+
this.#validators.set(name, {
|
|
20
17
|
name,
|
|
21
18
|
selector,
|
|
22
19
|
"validate": func,
|
|
@@ -25,6 +22,11 @@ class ValidatorFunctions {
|
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
|
|
25
|
+
removeValidator = ( name: string ) => {
|
|
26
|
+
this.#validators.delete(name);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
28
30
|
/*
|
|
29
31
|
* Create and return all validators that apply to an inputs
|
|
30
32
|
*/
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@creative-web-solution/front-library",
|
|
3
3
|
"title": "Frontend library",
|
|
4
4
|
"description": "Frontend functions and modules",
|
|
5
|
-
"version": "7.1.
|
|
5
|
+
"version": "7.1.21",
|
|
6
6
|
"homepage": "https://github.com/creative-web-solution/front-library",
|
|
7
7
|
"author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
|
|
8
8
|
"keywords": [],
|