@creative-web-solution/front-library 7.1.35 → 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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 7.1.37
4
+
5
+ * [Validator]: Add specific event handling in live validation for input file.
6
+
7
+ ## 7.1.36
8
+
9
+ * [DragSlider]: Fix end positioning when margin right and left are not equals
10
+
3
11
  ## 7.1.35
4
12
 
5
13
  * [Accordion]: Rework
@@ -395,7 +395,7 @@ export default class DragSlider {
395
395
  return (
396
396
  this.#viewportInfo.width -
397
397
  this.#$list!.scrollWidth -
398
- this.#siteOffsetLeft
398
+ Math.max(this.#siteOffsetLeft, this.#siteOffsetRight)
399
399
  );
400
400
  }
401
401
 
@@ -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: string;
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?.eventsName?.[ this.#inputType ] as string,
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
@@ -21,7 +21,8 @@ const defaultOptions = {
21
21
  "eventsName": {
22
22
  "optin": "change",
23
23
  "select": "change",
24
- "inputText": "input"
24
+ "inputText": "input",
25
+ "file": "change"
25
26
  },
26
27
  "eventsHook": null
27
28
  }
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Front Library
2
2
 
3
- @version: 7.1.35
3
+ @version: 7.1.37
4
4
 
5
5
 
6
6
  ## Use
@@ -84,6 +84,8 @@ declare namespace FLib {
84
84
  select?: string;
85
85
  /** @defaultValue input */
86
86
  inputText?: string;
87
+ /** @defaultValue change */
88
+ file?: string;
87
89
  };
88
90
  eventsHook?;
89
91
  }
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.35",
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": [],