@creative-web-solution/front-library 7.1.36 → 7.1.38
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 +8 -0
- package/Modules/Popin/Popin.ts +18 -0
- package/Modules/Popin/Tools.ts +1 -0
- package/Modules/Validator/Internal/Input.ts +7 -4
- package/Modules/Validator/index.ts +2 -1
- package/README.md +1 -1
- package/Types/Popin.d.ts +2 -0
- package/Types/Validator.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 7.1.38
|
|
4
|
+
|
|
5
|
+
* [Slider]: Handle popin inside the background layer
|
|
6
|
+
|
|
7
|
+
## 7.1.37
|
|
8
|
+
|
|
9
|
+
* [Validator]: Add specific event handling in live validation for input file.
|
|
10
|
+
|
|
3
11
|
## 7.1.36
|
|
4
12
|
|
|
5
13
|
* [DragSlider]: Fix end positioning when margin right and left are not equals
|
package/Modules/Popin/Popin.ts
CHANGED
|
@@ -115,6 +115,16 @@ export default class Popin {
|
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
117
|
|
|
118
|
+
if (!this.#options.isBackgroundAside && !this.#options.modal) {
|
|
119
|
+
on(
|
|
120
|
+
this.#$popin,
|
|
121
|
+
{
|
|
122
|
+
"eventsName": CLICK_EVENT_NAME,
|
|
123
|
+
"callback": this.#clickBgHandler
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
118
128
|
|
|
119
129
|
if ( this.#options.enableKeyboard ) {
|
|
120
130
|
this.#keyboardControls = new KeyboardHandler( this.#$popin, {
|
|
@@ -432,6 +442,14 @@ export default class Popin {
|
|
|
432
442
|
this.#closePopin();
|
|
433
443
|
}
|
|
434
444
|
|
|
445
|
+
#clickBgHandler = ( e: Event ): void => {
|
|
446
|
+
const $target = e.target as HTMLElement;
|
|
447
|
+
|
|
448
|
+
if (!$target?.closest(this.#options.selectors.popinBody)) {
|
|
449
|
+
this.#closePopinHandler(e);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
435
453
|
|
|
436
454
|
#resize = (): void => {
|
|
437
455
|
if ( !this.#options.autoResize ) {
|
package/Modules/Popin/Tools.ts
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/Popin.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ declare namespace FLib {
|
|
|
35
35
|
interface SelectorsOptions {
|
|
36
36
|
/** @defaultValue .popin */
|
|
37
37
|
popin: string;
|
|
38
|
+
/** @defaultValue .popin */
|
|
39
|
+
popinBody: string;
|
|
38
40
|
/** @defaultValue .popin-content */
|
|
39
41
|
popinContent: string;
|
|
40
42
|
/** @defaultValue a[data-popin] */
|
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.38",
|
|
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": [],
|