@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
declare namespace FLib {
|
|
2
|
+
namespace Slider {
|
|
3
|
+
type SlideDirection = -1 | 1;
|
|
4
|
+
|
|
5
|
+
type SlideProperties = {
|
|
6
|
+
$slide: HTMLElement;
|
|
7
|
+
id: string;
|
|
8
|
+
delay: number;
|
|
9
|
+
index: number;
|
|
10
|
+
position: number;
|
|
11
|
+
isFirst: boolean;
|
|
12
|
+
isLast: boolean;
|
|
13
|
+
isVisible: boolean;
|
|
14
|
+
isActive: boolean;
|
|
15
|
+
page: number;
|
|
16
|
+
pageIndex: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
type SlideOptions = {
|
|
21
|
+
nbSlideVisibleBefore: number;
|
|
22
|
+
nbSlideVisibleAfter: number;
|
|
23
|
+
slidePerPage: number;
|
|
24
|
+
moveByPage: boolean;
|
|
25
|
+
nbSlides: number;
|
|
26
|
+
nbPages: number;
|
|
27
|
+
speed: number;
|
|
28
|
+
$slide: HTMLElement;
|
|
29
|
+
index: number;
|
|
30
|
+
/** Internal function using GSAP to set CSS styles. Can be override to use another library */
|
|
31
|
+
_setStyle?: ( $elem, styles ) => void;
|
|
32
|
+
/** Internal function using GSAP to tween element. Can be override to use another library */
|
|
33
|
+
_tweenTo?: ( $elem, styles ) => void;
|
|
34
|
+
/** Internal function using GSAP to initialize and tween element. Can be override to use another library */
|
|
35
|
+
_tweenFromTo?: ( $elem, init, styles ) => void;
|
|
36
|
+
/** Internal function using GSAP to remove tweens from element. Can be override to use another library */
|
|
37
|
+
_killTweens?: ( $elem ) => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type CallbackParam = {
|
|
41
|
+
currentSlide: SlideProperties;
|
|
42
|
+
targetSlide: SlideProperties;
|
|
43
|
+
direction?: SlideDirection;
|
|
44
|
+
$button?: HTMLElement
|
|
45
|
+
}
|
|
46
|
+
type Callback = ( data: CallbackParam ) => void;
|
|
47
|
+
type InitCallback = ({ currentSlide: SlidePropertiesType }) => void;
|
|
48
|
+
|
|
49
|
+
type Options = {
|
|
50
|
+
/** @defaultValue 0 */
|
|
51
|
+
startSlide: number;
|
|
52
|
+
/** @defaultValue 0 */
|
|
53
|
+
nbSlideVisibleBefore: number;
|
|
54
|
+
/** @defaultValue 0 */
|
|
55
|
+
nbSlideVisibleAfter: number;
|
|
56
|
+
/** @defaultValue 1 */
|
|
57
|
+
slidePerPage: number;
|
|
58
|
+
/** @defaultValue true */
|
|
59
|
+
moveByPage: boolean;
|
|
60
|
+
/** In second
|
|
61
|
+
* @defaultValue 0.5
|
|
62
|
+
*/
|
|
63
|
+
speed: number;
|
|
64
|
+
/** @defaultValue true */
|
|
65
|
+
smoothHeight: boolean;
|
|
66
|
+
/** @defaultValue .list */
|
|
67
|
+
listSelector: string;
|
|
68
|
+
/** @defaultValue .item */
|
|
69
|
+
itemsSelector: string;
|
|
70
|
+
/** @defaultValue active-slide */
|
|
71
|
+
activeClass: string;
|
|
72
|
+
/** @defaultValue true*/
|
|
73
|
+
loop: boolean;
|
|
74
|
+
/** Called one time at the begining of the animation */
|
|
75
|
+
onBefore?: Callback;
|
|
76
|
+
/** Called for every slide that will come in the 1st position during the animation */
|
|
77
|
+
onBeforeEach?: Callback;
|
|
78
|
+
/** Called one time at the end of the animation */
|
|
79
|
+
onAfter?: Callback;
|
|
80
|
+
/** Called for every slide that is came in the 1st position during the animation */
|
|
81
|
+
onAfterEach?: Callback;
|
|
82
|
+
/** Called one time at the initialisation of the slider */
|
|
83
|
+
onStart?: InitCallback;
|
|
84
|
+
/** Internal function using GSAP to set CSS styles. Can be override to use another library */
|
|
85
|
+
_setStyle: ( $elem, styles ) => void;
|
|
86
|
+
/** Internal function using GSAP to tween element. Can be override to use another library */
|
|
87
|
+
_tweenTo: ( $elem, styles ) => void;
|
|
88
|
+
/** Internal function using GSAP to initialize and tween element. Can be override to use another library */
|
|
89
|
+
_tweenFromTo: ( $elem, init, styles ) => void;
|
|
90
|
+
/** Internal function using GSAP to remove tweens from element. Can be override to use another library */
|
|
91
|
+
_killTweens: ( $elem ) => void;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type ControlsOptions = {
|
|
95
|
+
$btPrev?: HTMLElement;
|
|
96
|
+
$btNext?: HTMLElement;
|
|
97
|
+
$pagination?: HTMLElement;
|
|
98
|
+
paginationItemsSelector?: string;
|
|
99
|
+
/** In second */
|
|
100
|
+
autoslide?: number | boolean;
|
|
101
|
+
swipe?: boolean;
|
|
102
|
+
enableKeyboard?: boolean;
|
|
103
|
+
gestureOptions?: FLib.Events.Gesture.Options;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
package/Types/Tabs.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare namespace FLib {
|
|
2
|
+
namespace Tabs {
|
|
3
|
+
type AnimationFunction = ( $tab: HTMLElement, $panel: HTMLElement ) => Promise<void>;
|
|
4
|
+
type Callback = ( $tab: HTMLElement, $panel: HTMLElement, autoClose?: boolean ) => void;
|
|
5
|
+
|
|
6
|
+
interface Tab {
|
|
7
|
+
isOpened: boolean;
|
|
8
|
+
index: number;
|
|
9
|
+
close( autoClose?: boolean ): this;
|
|
10
|
+
open( autoOpen?: boolean ): this;
|
|
11
|
+
destroy(): this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type Options = {
|
|
15
|
+
/** @defaultValue 'li[aria-selected]' */
|
|
16
|
+
tabSelector: string;
|
|
17
|
+
onOpenAtStart?: Callback;
|
|
18
|
+
onOpen?: Callback;
|
|
19
|
+
onClose?: Callback;
|
|
20
|
+
animations: {
|
|
21
|
+
open: AnimationFunction;
|
|
22
|
+
close: AnimationFunction;
|
|
23
|
+
destroy: AnimationFunction;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
type TabOptions = Options & {
|
|
29
|
+
onOpenTab?: ( tab: Tab ) => void;
|
|
30
|
+
index: number;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
declare namespace FLib {
|
|
2
|
+
namespace Validator {
|
|
3
|
+
type ValidationState = {
|
|
4
|
+
$input: HTMLElement;
|
|
5
|
+
value: string | string[];
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
data?: any;
|
|
9
|
+
isLiveValidation: boolean;
|
|
10
|
+
extraErrorMessages?: string[];
|
|
11
|
+
extraMessages?: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type Validator = {
|
|
15
|
+
name: string;
|
|
16
|
+
selector: string;
|
|
17
|
+
isAsynch: boolean;
|
|
18
|
+
validate: ValidateFunction;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface InputValidator {
|
|
22
|
+
$input: HTMLElement;
|
|
23
|
+
name: string;
|
|
24
|
+
isAsynch: boolean;
|
|
25
|
+
extraMessages: string[];
|
|
26
|
+
extraErrorMessages: string[];
|
|
27
|
+
data: any;
|
|
28
|
+
validate( isLiveValidation: boolean ): Promise<void>;
|
|
29
|
+
isValid(): boolean;
|
|
30
|
+
getData(): any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Input {
|
|
34
|
+
$input: HTMLElement;
|
|
35
|
+
$label: HTMLElement | undefined;
|
|
36
|
+
hasError: boolean;
|
|
37
|
+
isLiveValidation: boolean;
|
|
38
|
+
$radioGroup: CustomValidatorRadioInput[] | undefined;
|
|
39
|
+
$otherRadioOfGroup: CustomValidatorRadioInput[];
|
|
40
|
+
hasValidator: boolean;
|
|
41
|
+
getErrors(): InputValidator[];
|
|
42
|
+
getErrorMessages( _locale?: { [ key: string ]: string } ): { message: string, label: string, type: string }[];
|
|
43
|
+
isValid(): Promise<void>;
|
|
44
|
+
getData(): any[];
|
|
45
|
+
destroy(): this
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
type ValidateFunction = ( $input: HTMLElement, value: string | string[], isLiveValidation: boolean, validatorOptions ) => Promise<ValidationState>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
type ValidationReturnType = {
|
|
53
|
+
"inputs": Input[];
|
|
54
|
+
"errors": Input[];
|
|
55
|
+
"$form": HTMLElement;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type FieldValidationReturnType = {
|
|
59
|
+
"input": Input;
|
|
60
|
+
"error": Input | null;
|
|
61
|
+
"$form": HTMLElement;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
type Options = {
|
|
66
|
+
/** @defaultValue input,textarea,select */
|
|
67
|
+
fields: string;
|
|
68
|
+
/** @defaultValue input[type="button"], input[type="submit"], input[type="reset"], input */
|
|
69
|
+
filter: string;
|
|
70
|
+
/** @defaultValue data-error-label */
|
|
71
|
+
customErrorLabelPrefix: string;
|
|
72
|
+
/** @defaultValue `{}` */
|
|
73
|
+
errorMessages: { [ key: string ]: string };
|
|
74
|
+
validatorsOptions?: { [ key: string ]: any };
|
|
75
|
+
onValidate?: ( data: ValidationReturnType ) => void;
|
|
76
|
+
onInvalidate?: ( data: ValidationReturnType ) => void;
|
|
77
|
+
liveValidation?: {
|
|
78
|
+
onValidate?: ( input: Input, event ) => void;
|
|
79
|
+
onInvalidate?: ( input: Input, event ) => void;
|
|
80
|
+
eventsName?: {
|
|
81
|
+
/** @defaultValue change */
|
|
82
|
+
optin?: string;
|
|
83
|
+
/** @defaultValue change */
|
|
84
|
+
select?: string;
|
|
85
|
+
/** @defaultValue input */
|
|
86
|
+
inputText?: string;
|
|
87
|
+
}
|
|
88
|
+
eventsHook
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
type CustomValidatorRadioInput = HTMLInputElement & {
|
|
94
|
+
__$radioMaster: CustomValidatorRadioInput;
|
|
95
|
+
__$radioGroup: CustomValidatorRadioInput[];
|
|
96
|
+
__$otherRadioOfGroup: CustomValidatorRadioInput[];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare namespace FLib {
|
|
2
|
+
namespace YouTubePlayer {
|
|
3
|
+
type Options = {
|
|
4
|
+
height: number;
|
|
5
|
+
width: number;
|
|
6
|
+
videoId: string;
|
|
7
|
+
$wrapper: HTMLElement;
|
|
8
|
+
/**
|
|
9
|
+
* @defaultValue //www.youtube.com/iframe_api
|
|
10
|
+
*/
|
|
11
|
+
apiUrl: string;
|
|
12
|
+
onPlayerStateChange?: ( e: YT.PlayerEvent ) => void;
|
|
13
|
+
/**
|
|
14
|
+
* @defaultValue `{ "autoplay": 0, "controls": 2, "autohide": 1, "modestbranding": 1, "showinfo": 0 }`
|
|
15
|
+
*/
|
|
16
|
+
playerVars: YT.PlayerVars;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type PlayerWindow = Window & typeof globalThis & {
|
|
20
|
+
onYouTubeIframeAPIReady: (() => void) | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type PlayerWrapper = HTMLElement & {
|
|
24
|
+
YTPlayer: YT.Player;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/Types/index.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
declare namespace FLib {}
|
|
2
|
+
|
|
3
|
+
import './Accordion';
|
|
4
|
+
import './Autocomplete';
|
|
5
|
+
import './DOM';
|
|
6
|
+
import './DragSlider';
|
|
7
|
+
import './EventsHelpers';
|
|
8
|
+
import './GLImageTransition';
|
|
9
|
+
import './Global';
|
|
10
|
+
import './GlobalState';
|
|
11
|
+
import './Helpers';
|
|
12
|
+
import './Notifications';
|
|
13
|
+
import './Popin';
|
|
14
|
+
import './ScrollSnap';
|
|
15
|
+
import './SkinCheckbox';
|
|
16
|
+
import './SkinFile';
|
|
17
|
+
import './SkinRadio';
|
|
18
|
+
import './SkinSelect';
|
|
19
|
+
import './Slider';
|
|
20
|
+
import './Tabs';
|
|
21
|
+
import './Validator';
|
|
22
|
+
import './YouTubePlayer';
|