@creative-web-solution/front-library 7.0.6 → 7.1.2
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 +30 -0
- package/DOM/Class.ts +10 -12
- package/DOM/DocumentSize.ts +3 -1
- package/DOM/Filter.ts +0 -2
- package/DOM/Index.ts +1 -3
- package/DOM/Manipulation.ts +0 -3
- package/DOM/Matrix.ts +12 -12
- package/DOM/Offset.ts +4 -5
- package/DOM/OuterSize.ts +12 -12
- package/DOM/PageToDOM.ts +2 -2
- package/DOM/Position.ts +3 -3
- package/DOM/Size.ts +3 -7
- package/DOM/StrToDOM.ts +0 -1
- package/DOM/Styles.ts +3 -12
- package/DOM/Traversing.ts +0 -6
- package/DOM/WindowScroll.ts +3 -1
- package/DOM/WindowSize.ts +3 -1
- package/DOM/Wrap.ts +0 -1
- package/Events/DeviceOrientation.ts +27 -31
- package/Events/EventsManager.ts +10 -25
- package/Events/Gesture.ts +36 -37
- package/Events/HistoryController.ts +11 -17
- package/Events/ImageLoad.ts +35 -19
- package/Events/IntersectObserver.ts +15 -19
- package/Events/KeyboardHandler.ts +10 -8
- package/Events/MediaQueriesEvents.ts +53 -51
- package/Events/OnAnimationEnd.ts +5 -6
- package/Events/OnTransitionEnd.ts +3 -3
- package/Events/PubSub.ts +5 -8
- package/Events/TouchHover.ts +18 -21
- package/Events/WindowEvents.ts +26 -30
- package/Helpers/Colors.ts +7 -23
- package/Helpers/Cookie.ts +5 -12
- package/Helpers/Coordinates.ts +0 -7
- package/Helpers/Debounce.ts +3 -7
- package/Helpers/Defer.ts +1 -1
- package/Helpers/GetValue.ts +0 -2
- package/Helpers/Insert.ts +0 -1
- package/Helpers/Sequential.ts +0 -2
- package/Helpers/Slice.ts +0 -3
- package/Helpers/Throttle.ts +0 -1
- package/Helpers/TransitionHelpers.ts +95 -0
- package/Helpers/Type.ts +1 -14
- package/Helpers/Unique.ts +3 -3
- package/Helpers/UrlParser.ts +14 -23
- package/Helpers/Wait.ts +1 -1
- package/Modules/Accordion/Tab.ts +19 -17
- package/Modules/Accordion/index.ts +27 -19
- package/Modules/Autocomplete.ts +95 -101
- package/Modules/DragSlider.ts +72 -63
- package/Modules/GlobalState.ts +60 -53
- package/Modules/LoadGMap.ts +4 -7
- package/Modules/Notifications/Notification.ts +28 -32
- package/Modules/Notifications/index.ts +43 -36
- package/Modules/Popin/Popin.ts +100 -110
- package/Modules/Popin/PopinAccessibility.ts +8 -8
- package/Modules/Popin/PopinBackground.ts +12 -12
- package/Modules/Popin/PopinController.ts +24 -30
- package/Modules/Popin/Tools.ts +18 -19
- package/Modules/QuickTemplate.ts +4 -6
- package/Modules/ScrollSnap.ts +110 -104
- package/Modules/SkinCheckbox.ts +52 -38
- package/Modules/SkinFile.ts +63 -53
- package/Modules/SkinRadio.ts +63 -43
- package/Modules/SkinSelect.ts +117 -101
- package/Modules/Slider/Slide.ts +49 -52
- package/Modules/Slider/Slider.ts +100 -136
- package/Modules/Slider/SliderControls.ts +60 -59
- package/Modules/Tabs/Tab.ts +28 -24
- package/Modules/Tabs/index.ts +36 -26
- package/Modules/Validator/Date.ts +2 -1
- package/Modules/Validator/Equals.ts +1 -1
- package/Modules/Validator/Internal/Input.ts +366 -0
- package/Modules/Validator/Internal/InputValidator.ts +99 -0
- package/Modules/Validator/Internal/ValidatorFunctionsController.ts +58 -0
- package/Modules/Validator/Max.ts +1 -1
- package/Modules/Validator/Min.ts +1 -1
- package/Modules/Validator/MultiRequired.ts +5 -5
- package/Modules/Validator/Number.ts +1 -0
- package/Modules/Validator/Pattern.ts +1 -1
- package/Modules/Validator/Recaptcha.ts +1 -0
- package/Modules/Validator/Required.ts +3 -2
- package/Modules/Validator/ServerCheck.ts +23 -15
- package/Modules/Validator/Tools/GetQueryFromForm.ts +1 -6
- package/Modules/Validator/Tools/IsDate.ts +2 -3
- package/Modules/Validator/Tools/IsEmail.ts +2 -5
- package/Modules/Validator/Tools/IsEmpty.ts +0 -2
- package/Modules/Validator/Tools/IsNumber.ts +0 -2
- package/Modules/Validator/Tools/IsUrl.ts +1 -3
- package/Modules/Validator/Tools/Label.ts +5 -15
- package/Modules/Validator/Tools/RadioButton.ts +4 -10
- package/Modules/Validator/Url.ts +1 -0
- package/Modules/Validator/index.ts +36 -36
- package/Modules/YouTubePlayer.ts +18 -16
- package/README.md +1 -1
- package/Types/Accordion.d.ts +41 -0
- package/Types/Autocomplete.d.ts +94 -0
- package/Types/DOM.d.ts +69 -0
- package/Types/DragSlider.d.ts +56 -0
- package/Types/EventsHelpers.d.ts +390 -0
- package/Types/GLImageTransition.d.ts +47 -43
- package/Types/GlobalState.d.ts +9 -0
- package/Types/Helpers.d.ts +63 -0
- package/Types/Notifications.d.ts +48 -44
- package/Types/Popin.d.ts +113 -0
- package/Types/ScrollSnap.d.ts +66 -0
- package/Types/SkinCheckbox.d.ts +35 -0
- package/Types/SkinFile.d.ts +45 -0
- package/Types/SkinRadio.d.ts +37 -0
- package/Types/SkinSelect.d.ts +72 -0
- package/Types/Slider.d.ts +106 -0
- package/Types/Tabs.d.ts +33 -0
- package/Types/Validator.d.ts +99 -0
- package/Types/YouTubePlayer.d.ts +27 -0
- package/Types/index.d.ts +22 -21
- package/WebGL/GLImageTransition/GLImageTransition.ts +83 -80
- package/WebGL/GLImageTransition/Presets/Cellular.ts +11 -11
- package/WebGL/GLImageTransition/Presets/Fade.ts +2 -3
- package/WebGL/GLImageTransition/Presets/HorizontalMovingGrid.ts +9 -9
- package/WebGL/GLImageTransition/Presets/PresetSample.ts +11 -9
- package/WebGL/GLImageTransition/Presets/Solarisation.ts +7 -12
- package/package.json +1 -1
- package/Modules/Template.ts +0 -209
- package/Types/AccordionTypes.d.ts +0 -29
- package/Types/AutocompleteTypes.d.ts +0 -85
- package/Types/DOMTypes.d.ts +0 -62
- package/Types/DragSliderTypes.d.ts +0 -52
- package/Types/EventsHelpersTypes.d.ts +0 -370
- package/Types/GlobalStateTypes.d.ts +0 -5
- package/Types/HelpersTypes.d.ts +0 -23
- package/Types/MediaPreloaderTypes.d.ts +0 -12
- package/Types/PopinTypes.d.ts +0 -83
- package/Types/ScrollSnapTypes.d.ts +0 -62
- package/Types/SkinCheckboxTypes.d.ts +0 -23
- package/Types/SkinFileTypes.d.ts +0 -34
- package/Types/SkinRadioTypes.d.ts +0 -24
- package/Types/SkinSelectTypes.d.ts +0 -48
- package/Types/SliderTypes.d.ts +0 -97
- package/Types/TabsTypes.d.ts +0 -22
- package/Types/ValidatorTypes.d.ts +0 -61
- package/Types/YouTubePlayerTypes.d.ts +0 -23
package/Modules/Slider/Slide.ts
CHANGED
|
@@ -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:
|
|
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
|
|
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
|
-
|
|
93
|
+
#getNextSlideId = (): string => {
|
|
94
94
|
return `__mdl_sld_${ ++customeSlideId }`;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
167
|
+
this.#x = this.#getXMax( this.offsetToGo );
|
|
171
168
|
}
|
|
172
169
|
else if ( this.#offsetToGo < 0 ) {
|
|
173
|
-
this.#x = this
|
|
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:
|
|
185
|
+
initMoveTo( direction: FLib.Slider.SlideDirection ): void {
|
|
189
186
|
let x;
|
|
190
187
|
|
|
191
188
|
if (
|
|
192
189
|
this.isVisible( this.#lastOffset ) ||
|
|
193
|
-
!this
|
|
190
|
+
!this.#willMove( this.#offsetToGo, direction )
|
|
194
191
|
) {
|
|
195
192
|
return;
|
|
196
193
|
}
|
|
197
194
|
|
|
198
195
|
if ( direction === -1 ) {
|
|
199
|
-
x = this
|
|
196
|
+
x = this.#getXMax( this.#offsetToGo - 1 );
|
|
200
197
|
}
|
|
201
198
|
else {
|
|
202
|
-
x = this
|
|
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:
|
|
215
|
-
let
|
|
211
|
+
moveTo( direction: FLib.Slider.SlideDirection, easing ): Promise<any> {
|
|
212
|
+
let _resolve;
|
|
216
213
|
|
|
217
214
|
if (
|
|
218
215
|
!(
|
|
219
|
-
this
|
|
220
|
-
this
|
|
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
|
|
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
|
|
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():
|
|
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
|
}
|