@creative-web-solution/front-library 7.0.7 → 7.1.3

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/DOM/Class.ts +10 -12
  3. package/DOM/DocumentSize.ts +3 -1
  4. package/DOM/Filter.ts +0 -2
  5. package/DOM/Index.ts +1 -3
  6. package/DOM/Manipulation.ts +0 -3
  7. package/DOM/Matrix.ts +12 -12
  8. package/DOM/Offset.ts +4 -5
  9. package/DOM/OuterSize.ts +12 -12
  10. package/DOM/PageToDOM.ts +2 -2
  11. package/DOM/Position.ts +3 -3
  12. package/DOM/Size.ts +3 -7
  13. package/DOM/StrToDOM.ts +0 -1
  14. package/DOM/Styles.ts +3 -12
  15. package/DOM/Traversing.ts +0 -6
  16. package/DOM/WindowScroll.ts +3 -1
  17. package/DOM/WindowSize.ts +3 -1
  18. package/DOM/Wrap.ts +0 -1
  19. package/Events/DeviceOrientation.ts +27 -31
  20. package/Events/EventsManager.ts +10 -25
  21. package/Events/Gesture.ts +36 -37
  22. package/Events/HistoryController.ts +12 -18
  23. package/Events/ImageLoad.ts +35 -19
  24. package/Events/IntersectObserver.ts +15 -19
  25. package/Events/KeyboardHandler.ts +10 -8
  26. package/Events/MediaQueriesEvents.ts +53 -51
  27. package/Events/OnAnimationEnd.ts +2 -3
  28. package/Events/OnTransitionEnd.ts +3 -3
  29. package/Events/PubSub.ts +5 -8
  30. package/Events/TouchHover.ts +18 -21
  31. package/Events/WindowEvents.ts +26 -30
  32. package/Helpers/Colors.ts +7 -23
  33. package/Helpers/Cookie.ts +5 -12
  34. package/Helpers/Coordinates.ts +0 -7
  35. package/Helpers/Debounce.ts +3 -7
  36. package/Helpers/Defer.ts +1 -1
  37. package/Helpers/GetValue.ts +0 -2
  38. package/Helpers/Insert.ts +0 -1
  39. package/Helpers/Sequential.ts +0 -2
  40. package/Helpers/Slice.ts +0 -3
  41. package/Helpers/Throttle.ts +0 -1
  42. package/Helpers/TransitionHelpers.ts +8 -6
  43. package/Helpers/Type.ts +1 -14
  44. package/Helpers/Unique.ts +3 -3
  45. package/Helpers/UrlParser.ts +14 -23
  46. package/Helpers/Wait.ts +1 -1
  47. package/Modules/Accordion/Tab.ts +19 -17
  48. package/Modules/Accordion/index.ts +27 -19
  49. package/Modules/Autocomplete.ts +95 -101
  50. package/Modules/DragSlider.ts +72 -63
  51. package/Modules/GlobalState.ts +60 -53
  52. package/Modules/LoadGMap.ts +4 -7
  53. package/Modules/Notifications/Notification.ts +28 -32
  54. package/Modules/Notifications/index.ts +43 -36
  55. package/Modules/Popin/Popin.ts +100 -110
  56. package/Modules/Popin/PopinAccessibility.ts +8 -8
  57. package/Modules/Popin/PopinBackground.ts +12 -12
  58. package/Modules/Popin/PopinController.ts +24 -30
  59. package/Modules/Popin/Tools.ts +18 -19
  60. package/Modules/QuickTemplate.ts +4 -6
  61. package/Modules/ScrollSnap.ts +110 -104
  62. package/Modules/SkinCheckbox.ts +52 -38
  63. package/Modules/SkinFile.ts +63 -53
  64. package/Modules/SkinRadio.ts +63 -43
  65. package/Modules/SkinSelect.ts +117 -101
  66. package/Modules/Slider/Slide.ts +49 -52
  67. package/Modules/Slider/Slider.ts +100 -136
  68. package/Modules/Slider/SliderControls.ts +60 -59
  69. package/Modules/Tabs/Tab.ts +28 -24
  70. package/Modules/Tabs/index.ts +36 -26
  71. package/Modules/Validator/Date.ts +2 -1
  72. package/Modules/Validator/Equals.ts +1 -1
  73. package/Modules/Validator/Internal/Input.ts +366 -0
  74. package/Modules/Validator/Internal/InputValidator.ts +99 -0
  75. package/Modules/Validator/Internal/ValidatorFunctionsController.ts +58 -0
  76. package/Modules/Validator/Max.ts +1 -1
  77. package/Modules/Validator/Min.ts +1 -1
  78. package/Modules/Validator/MultiRequired.ts +5 -5
  79. package/Modules/Validator/Number.ts +1 -0
  80. package/Modules/Validator/Pattern.ts +1 -1
  81. package/Modules/Validator/Recaptcha.ts +1 -0
  82. package/Modules/Validator/Required.ts +3 -2
  83. package/Modules/Validator/ServerCheck.ts +23 -15
  84. package/Modules/Validator/Tools/GetQueryFromForm.ts +1 -6
  85. package/Modules/Validator/Tools/IsDate.ts +2 -3
  86. package/Modules/Validator/Tools/IsEmail.ts +2 -5
  87. package/Modules/Validator/Tools/IsEmpty.ts +0 -2
  88. package/Modules/Validator/Tools/IsNumber.ts +0 -2
  89. package/Modules/Validator/Tools/IsUrl.ts +1 -3
  90. package/Modules/Validator/Tools/Label.ts +5 -15
  91. package/Modules/Validator/Tools/RadioButton.ts +4 -10
  92. package/Modules/Validator/Url.ts +1 -0
  93. package/Modules/Validator/index.ts +36 -36
  94. package/Modules/YouTubePlayer.ts +18 -16
  95. package/README.md +1 -1
  96. package/Types/Accordion.d.ts +41 -0
  97. package/Types/Autocomplete.d.ts +94 -0
  98. package/Types/DOM.d.ts +69 -0
  99. package/Types/DragSlider.d.ts +56 -0
  100. package/Types/EventsHelpers.d.ts +390 -0
  101. package/Types/GLImageTransition.d.ts +47 -43
  102. package/Types/GlobalState.d.ts +9 -0
  103. package/Types/Helpers.d.ts +63 -0
  104. package/Types/Notifications.d.ts +48 -44
  105. package/Types/Popin.d.ts +113 -0
  106. package/Types/ScrollSnap.d.ts +66 -0
  107. package/Types/SkinCheckbox.d.ts +35 -0
  108. package/Types/SkinFile.d.ts +45 -0
  109. package/Types/SkinRadio.d.ts +37 -0
  110. package/Types/SkinSelect.d.ts +72 -0
  111. package/Types/Slider.d.ts +106 -0
  112. package/Types/Tabs.d.ts +33 -0
  113. package/Types/Validator.d.ts +99 -0
  114. package/Types/YouTubePlayer.d.ts +27 -0
  115. package/Types/index.d.ts +22 -21
  116. package/WebGL/GLImageTransition/GLImageTransition.ts +83 -80
  117. package/WebGL/GLImageTransition/Presets/Cellular.ts +11 -11
  118. package/WebGL/GLImageTransition/Presets/Fade.ts +2 -3
  119. package/WebGL/GLImageTransition/Presets/HorizontalMovingGrid.ts +9 -9
  120. package/WebGL/GLImageTransition/Presets/PresetSample.ts +11 -9
  121. package/WebGL/GLImageTransition/Presets/Solarisation.ts +7 -12
  122. package/package.json +1 -1
  123. package/Modules/Template.ts +0 -209
  124. package/Types/AccordionTypes.d.ts +0 -29
  125. package/Types/AutocompleteTypes.d.ts +0 -85
  126. package/Types/DOMTypes.d.ts +0 -62
  127. package/Types/DragSliderTypes.d.ts +0 -52
  128. package/Types/EventsHelpersTypes.d.ts +0 -370
  129. package/Types/GlobalStateTypes.d.ts +0 -5
  130. package/Types/HelpersTypes.d.ts +0 -23
  131. package/Types/MediaPreloaderTypes.d.ts +0 -12
  132. package/Types/PopinTypes.d.ts +0 -83
  133. package/Types/ScrollSnapTypes.d.ts +0 -62
  134. package/Types/SkinCheckboxTypes.d.ts +0 -23
  135. package/Types/SkinFileTypes.d.ts +0 -34
  136. package/Types/SkinRadioTypes.d.ts +0 -24
  137. package/Types/SkinSelectTypes.d.ts +0 -48
  138. package/Types/SliderTypes.d.ts +0 -97
  139. package/Types/TabsTypes.d.ts +0 -22
  140. package/Types/ValidatorTypes.d.ts +0 -61
  141. package/Types/YouTubePlayerTypes.d.ts +0 -23
@@ -18,44 +18,44 @@ export class Slide {
18
18
  #id: string;
19
19
 
20
20
 
21
- get id() {
21
+ get id(): string {
22
22
  return this.#id;
23
23
  }
24
24
 
25
- get index() {
25
+ get index(): number {
26
26
  return this.#options.index;
27
27
  }
28
28
 
29
- get position() {
29
+ get position(): number {
30
30
  return this.#options.index + 1;
31
31
  }
32
32
 
33
- get currentPage() {
33
+ get currentPage(): number {
34
34
  return this.#currentPage;
35
35
  }
36
36
 
37
- get isFirst() {
37
+ get isFirst(): boolean {
38
38
  return this.#options.index === 0;
39
39
  }
40
40
 
41
- get isLast() {
41
+ get isLast(): boolean {
42
42
  return this.#isLast;
43
43
  }
44
44
 
45
- get offsetToGo() {
45
+ get offsetToGo(): number {
46
46
  return this.#offsetToGo;
47
47
  }
48
48
 
49
- get delay() {
49
+ get delay(): number {
50
50
  return this.#delay;
51
51
  }
52
52
 
53
- get x() {
53
+ get x(): number {
54
54
  return this.#x;
55
55
  }
56
56
 
57
57
 
58
- constructor( options: SlideOptionsType ) {
58
+ constructor( options: FLib.Slider.SlideOptions ) {
59
59
  this.#options = options;
60
60
  this.#$slide = options.$slide;
61
61
  this.#id = options.$slide.id;
@@ -82,7 +82,7 @@ export class Slide {
82
82
  this.#x = 0;
83
83
 
84
84
  if ( !this.#id ) {
85
- this.#id = this.#$slide.id = this.getNextSlideId();
85
+ this.#id = this.#$slide.id = this.#getNextSlideId();
86
86
  }
87
87
 
88
88
  this.#$slide.setAttribute( 'role', 'tabpanel' )
@@ -90,14 +90,14 @@ export class Slide {
90
90
  }
91
91
 
92
92
 
93
- private getNextSlideId() {
93
+ #getNextSlideId = (): string => {
94
94
  return `__mdl_sld_${ ++customeSlideId }`;
95
95
  }
96
96
 
97
97
 
98
- private toggleElementsFocusability( activate: boolean ) {
98
+ #toggleElementsFocusability = ( activate: boolean ): void => {
99
99
  if ( !this.#$links.length ) {
100
- return
100
+ return;
101
101
  }
102
102
 
103
103
  this.#$links.forEach( $link => {
@@ -106,23 +106,23 @@ export class Slide {
106
106
  }
107
107
 
108
108
 
109
- isVisible( offset?: number ) {
109
+ isVisible( offset?: number ): boolean {
110
110
  offset = offset || this.#lastOffset;
111
111
 
112
112
  return (
113
113
  offset >= -1 * this.#options.nbSlideVisibleBefore &&
114
114
  offset < this.#options.nbSlideVisibleAfter + this.#options.slidePerPage
115
115
  );
116
- };
116
+ }
117
117
 
118
118
 
119
- isActive( offset?: number ) {
119
+ isActive( offset?: number ): boolean {
120
120
  offset = offset || this.#lastOffset
121
121
  return offset >= 0 && offset < this.#options.slidePerPage
122
122
  }
123
123
 
124
124
 
125
- private willMove( offset: number, direction: SlideDirectionType ) {
125
+ #willMove = ( offset: number, direction: FLib.Slider.SlideDirection ): boolean => {
126
126
  if ( direction === -1 ) {
127
127
  return (
128
128
  offset >= -1 * this.#options.nbSlideVisibleBefore - 1 &&
@@ -138,39 +138,36 @@ export class Slide {
138
138
  }
139
139
 
140
140
 
141
- private getXMax( offset: number ) {
142
- return (
143
- this.#size *
144
- Math.min( offset, this.#options.nbSlideVisibleAfter + this.#options.slidePerPage )
145
- );
141
+ #getXMax = ( offset: number ): number => {
142
+ return this.#size * Math.min( offset, this.#options.nbSlideVisibleAfter + this.#options.slidePerPage );
146
143
  }
147
144
 
148
145
 
149
- private getXMin( offset: number ) {
146
+ #getXMin = ( offset: number ): number => {
150
147
  return this.#size * Math.max( offset, -1 * this.#options.nbSlideVisibleBefore - 1 );
151
148
  }
152
149
 
153
150
 
154
- getHeight() {
151
+ getHeight(): number {
155
152
  return outerHeight( this.#$slide );
156
- };
153
+ }
157
154
 
158
155
 
159
- setOffsetToGo( offset ) {
156
+ setOffsetToGo( offset: number ): void {
160
157
  this.#lastOffset = this.#offsetToGo;
161
158
  this.#offsetToGo = offset;
162
- };
159
+ }
163
160
 
164
161
 
165
- init() {
162
+ init(): void {
166
163
  if ( this.#offsetToGo === 0 ) {
167
164
  this.#x = 0;
168
165
  }
169
166
  else if ( this.#offsetToGo > 0 ) {
170
- this.#x = this.getXMax( this.offsetToGo );
167
+ this.#x = this.#getXMax( this.offsetToGo );
171
168
  }
172
169
  else if ( this.#offsetToGo < 0 ) {
173
- this.#x = this.getXMin( this.offsetToGo );
170
+ this.#x = this.#getXMin( this.offsetToGo );
174
171
  }
175
172
 
176
173
  this.#options._setStyle( this.#$slide, {
@@ -185,21 +182,21 @@ export class Slide {
185
182
  }
186
183
 
187
184
 
188
- initMoveTo( direction: SlideDirectionType ) {
185
+ initMoveTo( direction: FLib.Slider.SlideDirection ): void {
189
186
  let x;
190
187
 
191
188
  if (
192
189
  this.isVisible( this.#lastOffset ) ||
193
- !this.willMove( this.#offsetToGo, direction )
190
+ !this.#willMove( this.#offsetToGo, direction )
194
191
  ) {
195
192
  return;
196
193
  }
197
194
 
198
195
  if ( direction === -1 ) {
199
- x = this.getXMax( this.#offsetToGo - 1 );
196
+ x = this.#getXMax( this.#offsetToGo - 1 );
200
197
  }
201
198
  else {
202
- x = this.getXMin( this.#offsetToGo + 1 );
199
+ x = this.#getXMin( this.#offsetToGo + 1 );
203
200
  }
204
201
 
205
202
  this.#x = x;
@@ -211,13 +208,13 @@ export class Slide {
211
208
  }
212
209
 
213
210
 
214
- moveTo( direction: SlideDirectionType, easing ) {
215
- let x, positionning, _resolve;
211
+ moveTo( direction: FLib.Slider.SlideDirection, easing ): Promise<any> {
212
+ let _resolve;
216
213
 
217
214
  if (
218
215
  !(
219
- this.willMove( this.#offsetToGo, direction ) ||
220
- this.willMove( this.#lastOffset, direction )
216
+ this.#willMove( this.#offsetToGo, direction ) ||
217
+ this.#willMove( this.#lastOffset, direction )
221
218
  )
222
219
  ) {
223
220
  this.#lastOffset = this.#offsetToGo;
@@ -225,8 +222,8 @@ export class Slide {
225
222
  }
226
223
 
227
224
  this.#lastOffset = this.#offsetToGo;
228
- positionning = this.#offsetToGo === 0 ? 'relative' : 'absolute';
229
- x = this.offsetToGo * this.#size;
225
+ const positionning = this.#offsetToGo === 0 ? 'relative' : 'absolute';
226
+ const x = this.offsetToGo * this.#size;
230
227
 
231
228
  this.#x = x;
232
229
 
@@ -251,22 +248,22 @@ export class Slide {
251
248
  } );
252
249
 
253
250
  return promise;
254
- };
251
+ }
255
252
 
256
253
 
257
- activate() {
254
+ activate(): void {
258
255
  this.#$slide.setAttribute( 'aria-hidden', "false" );
259
- this.toggleElementsFocusability( true );
260
- };
256
+ this.#toggleElementsFocusability( true );
257
+ }
261
258
 
262
259
 
263
- deactivate() {
260
+ deactivate(): void {
264
261
  this.#$slide.setAttribute( 'aria-hidden', "true" );
265
- this.toggleElementsFocusability( false );
266
- };
262
+ this.#toggleElementsFocusability( false );
263
+ }
267
264
 
268
265
 
269
- destroy() {
266
+ destroy(): void {
270
267
  this.#$slide.removeAttribute( 'aria-hidden' );
271
268
  this.#$links.forEach( $link => {
272
269
  ( $link as HTMLElement ).removeAttribute( 'tabindex' );
@@ -276,10 +273,10 @@ export class Slide {
276
273
  this.#options._setStyle( this.#$slide, {
277
274
  "clearProps": "all"
278
275
  } );
279
- };
276
+ }
280
277
 
281
278
 
282
- getSlideProperties(): SlidePropertiesType {
279
+ getSlideProperties(): FLib.Slider.SlideProperties {
283
280
  return {
284
281
  "$slide": this.#$slide,
285
282
  "id": this.id,
@@ -293,5 +290,5 @@ export class Slide {
293
290
  "page": this.currentPage,
294
291
  "pageIndex": this.currentPage - 1,
295
292
  }
296
- };
293
+ }
297
294
  }