@creative-web-solution/front-library 7.1.37 → 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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 7.1.38
4
+
5
+ * [Slider]: Handle popin inside the background layer
6
+
3
7
  ## 7.1.37
4
8
 
5
9
  * [Validator]: Add specific event handling in live validation for input file.
@@ -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 ) {
@@ -45,6 +45,7 @@ export const defaultOptions = {
45
45
  },
46
46
  "selectors": {
47
47
  "popin": ".popin",
48
+ "popinBody": ".popin",
48
49
  "popinContent": ".popin-content",
49
50
  "links": "a[data-popin]",
50
51
  "forms": "form[data-popin]",
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Front Library
2
2
 
3
- @version: 7.1.37
3
+ @version: 7.1.38
4
4
 
5
5
 
6
6
  ## Use
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/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.37",
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": [],