@creative-web-solution/front-library 7.1.36 → 7.1.37
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 +4 -0
- package/Modules/Validator/Internal/Input.ts +7 -4
- package/Modules/Validator/index.ts +2 -1
- package/README.md +1 -1
- package/Types/Validator.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,7 @@ import { getRadioList } from '../Tools/RadioButton';
|
|
|
10
10
|
*/
|
|
11
11
|
export default class Input implements FLib.Validator.Input {
|
|
12
12
|
#isRadio: boolean;
|
|
13
|
-
#inputType:
|
|
13
|
+
#inputType: "optin" | "hidden" | "select" | "file" | "inputText";
|
|
14
14
|
#inputId: string;
|
|
15
15
|
#$input: HTMLElement;
|
|
16
16
|
#$group: FLib.Validator.CustomValidatorRadioInput[] | undefined;
|
|
@@ -67,6 +67,9 @@ export default class Input implements FLib.Validator.Input {
|
|
|
67
67
|
else if ( $input.nodeName === 'SELECT' ) {
|
|
68
68
|
this.#inputType = 'select';
|
|
69
69
|
}
|
|
70
|
+
else if ( $input.type === 'file' ) {
|
|
71
|
+
this.#inputType = 'file';
|
|
72
|
+
}
|
|
70
73
|
else {
|
|
71
74
|
this.#inputType = 'inputText';
|
|
72
75
|
}
|
|
@@ -121,9 +124,9 @@ export default class Input implements FLib.Validator.Input {
|
|
|
121
124
|
this.#hasError = false;
|
|
122
125
|
|
|
123
126
|
|
|
124
|
-
if ( this.#hasValidator && options.hasLiveValidation && this.#inputType !== 'hidden' ) {
|
|
127
|
+
if ( this.#hasValidator && options.hasLiveValidation && this.#inputType !== 'hidden' && typeof options.liveValidation?.eventsName?.[ this.#inputType ] === "string" ) {
|
|
125
128
|
on( this.#isRadio ? this.#$group : $input, {
|
|
126
|
-
"eventsName": options.liveValidation
|
|
129
|
+
"eventsName": options.liveValidation.eventsName[ this.#inputType ]!,
|
|
127
130
|
"callback": this.#onLiveValidation
|
|
128
131
|
} );
|
|
129
132
|
}
|
|
@@ -324,7 +327,7 @@ export default class Input implements FLib.Validator.Input {
|
|
|
324
327
|
*/
|
|
325
328
|
destroy(): this {
|
|
326
329
|
|
|
327
|
-
if ( this.#hasValidator && this.#options.hasLiveValidation && this.#inputType !== 'hidden' ) {
|
|
330
|
+
if ( this.#hasValidator && this.#options.hasLiveValidation && this.#inputType !== 'hidden' && typeof this.#options.liveValidation.eventsName[ this.#inputType ] === "string" ) {
|
|
328
331
|
off( this.#isRadio ? this.#$group : this.#$input, {
|
|
329
332
|
"eventsName": this.#options.liveValidation.eventsName[ this.#inputType ],
|
|
330
333
|
"callback": this.#onLiveValidation
|
package/README.md
CHANGED
package/Types/Validator.d.ts
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.37",
|
|
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": [],
|