@creative-web-solution/front-library 6.1.3 → 6.2.9
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 +52 -1
- package/DOM/Class.js +1 -1
- package/DOM/OuterSize.js +1 -1
- package/DOM/matrix.js +1 -1
- package/DOM/size.js +1 -1
- package/DOM/wrap.js +2 -2
- package/Events/EventsManager.js +39 -81
- package/Events/HistoryController.js +3 -3
- package/Events/ImageLoad.js +1 -1
- package/Events/IntersectObserver.js +3 -2
- package/Events/KeyboardHandler.js +2 -2
- package/Events/MediaQueriesEvents.js +2 -2
- package/Events/TouchHover.js +3 -3
- package/Events/WindowEvents.js +3 -3
- package/Events/gesture.js +2 -2
- package/Events/onAnimationEnd.js +37 -33
- package/Events/onTransitionEnd.js +38 -29
- package/Events/pubSub.js +2 -2
- package/Helpers/Cookie.js +1 -1
- package/Helpers/TransitionHelpers.js +95 -0
- package/Helpers/extend.js +1 -1
- package/Helpers/getValue.js +1 -1
- package/Helpers/sequential.js +1 -1
- package/Helpers/wait.js +1 -1
- package/ModernizrAddons/css-var-support.js +3 -0
- package/ModernizrAddons/touchdevice.js +1 -1
- package/Modules/Accordion.js +12 -6
- package/Modules/Autocomplete.js +7 -7
- package/Modules/DragSlider.js +583 -0
- package/Modules/Notifications.js +8 -8
- package/Modules/Popin.js +8 -8
- package/Modules/ScrollSnap.js +8 -8
- package/Modules/SkinCheckbox.js +2 -2
- package/Modules/SkinFile.js +4 -4
- package/Modules/SkinRadio.js +3 -3
- package/Modules/SkinSelect.js +12 -12
- package/Modules/Slider.js +100 -32
- package/Modules/Tabs.js +5 -5
- package/Modules/Validator/Tools/RadioButton.js +1 -1
- package/Modules/Validator/Tools/ValidationState.js +1 -1
- package/Modules/Validator/Tools/getQueryFromForm.js +1 -1
- package/Modules/Validator/date.js +3 -3
- package/Modules/Validator/email.js +3 -3
- package/Modules/Validator/equals.js +3 -3
- package/Modules/Validator/index.js +6 -6
- package/Modules/Validator/max.js +2 -2
- package/Modules/Validator/maxlength.js +2 -2
- package/Modules/Validator/min.js +2 -2
- package/Modules/Validator/minlength.js +2 -2
- package/Modules/Validator/multiRequired.js +5 -5
- package/Modules/Validator/number.js +3 -3
- package/Modules/Validator/pattern.js +2 -2
- package/Modules/Validator/recaptcha.js +2 -2
- package/Modules/Validator/required.js +4 -4
- package/Modules/Validator/serverCheck.js +3 -3
- package/Modules/Validator/url.js +3 -3
- package/Modules/YouTubePlayer.js +2 -2
- package/Modules/globalState.js +1 -1
- package/README.md +3 -3
- package/Tools/PrefixedProperties.js +54 -0
- package/Tools/TouchDeviceSupport.js +1 -0
- package/WebGL/GLImageTransition/GLImageTransition.js +4 -4
- package/documentation/extra/events.md +2 -2
- package/documentation/extra/modernizr.md +1 -0
- package/documentation/extra/modules/DragSlider.md +111 -0
- package/documentation/extra/modules/YouTubePlayer.md +1 -1
- package/documentation/extra/modules/autocomplete.md +1 -1
- package/documentation/extra/modules/popin.md +3 -3
- package/documentation/extra/modules/slider.md +7 -3
- package/documentation/extra/modules/template.md +1 -1
- package/documentation/extra/modules/validator.md +13 -13
- package/documentation/extra/webgl/GLImageTransition.md +1 -1
- package/documentation/jsdocs/dom/global.html +389 -2
- package/documentation/jsdocs/dom/index.html +2 -2
- package/documentation/jsdocs/dom/quicksearch.html +1 -1
- package/documentation/jsdocs/events/common/DeviceOrientation.html +1 -1
- package/documentation/jsdocs/events/common/HistoryController.html +1 -1
- package/documentation/jsdocs/events/common/IntersectObserver.html +1 -1
- package/documentation/jsdocs/events/common/KeyboardHandler.html +1 -1
- package/documentation/jsdocs/events/common/MediaQueriesEvents.html +1 -1
- package/documentation/jsdocs/events/common/TouchHover.html +1 -1
- package/documentation/jsdocs/events/common/WindowEvents.html +1 -1
- package/documentation/jsdocs/events/common/classes.list.html +1 -1
- package/documentation/jsdocs/events/common/global.html +1 -1
- package/documentation/jsdocs/events/common/index.html +1 -1
- package/documentation/jsdocs/events/common/namespaces.list.html +1 -1
- package/documentation/jsdocs/events/common/pubSub.html +1 -1
- package/documentation/jsdocs/events/common/quicksearch.html +1 -1
- package/documentation/jsdocs/events/events-manager/global.html +1 -1
- package/documentation/jsdocs/events/events-manager/index.html +1 -1
- package/documentation/jsdocs/events/events-manager/quicksearch.html +1 -1
- package/documentation/jsdocs/events/gesture/global.html +1 -1
- package/documentation/jsdocs/events/gesture/index.html +1 -1
- package/documentation/jsdocs/events/gesture/quicksearch.html +1 -1
- package/documentation/jsdocs/helpers/array/global.html +1 -1
- package/documentation/jsdocs/helpers/array/index.html +1 -1
- package/documentation/jsdocs/helpers/array/quicksearch.html +1 -1
- package/documentation/jsdocs/helpers/colors/global.html +1 -1
- package/documentation/jsdocs/helpers/colors/index.html +1 -1
- package/documentation/jsdocs/helpers/colors/quicksearch.html +1 -1
- package/documentation/jsdocs/helpers/common/Cookie.html +2 -2
- package/documentation/jsdocs/helpers/common/UrlParser.html +1 -1
- package/documentation/jsdocs/helpers/common/classes.list.html +1 -1
- package/documentation/jsdocs/helpers/common/global.html +8 -2
- package/documentation/jsdocs/helpers/common/index.html +1 -1
- package/documentation/jsdocs/helpers/common/quicksearch.html +1 -1
- package/documentation/jsdocs/helpers/types/global.html +1 -1
- package/documentation/jsdocs/helpers/types/index.html +1 -1
- package/documentation/jsdocs/helpers/types/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/accordion/Accordion.html +1 -1
- package/documentation/jsdocs/modules/accordion/classes.list.html +1 -1
- package/documentation/jsdocs/modules/accordion/index.html +1 -1
- package/documentation/jsdocs/modules/accordion/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/autocomplete/Autocomplete.html +1 -1
- package/documentation/jsdocs/modules/autocomplete/classes.list.html +1 -1
- package/documentation/jsdocs/modules/autocomplete/index.html +1 -1
- package/documentation/jsdocs/modules/autocomplete/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/common/DragSlider.html +946 -0
- package/documentation/jsdocs/modules/common/classes.list.html +310 -0
- package/documentation/jsdocs/modules/common/global.html +8 -1
- package/documentation/jsdocs/modules/common/globalState.html +8 -1
- package/documentation/jsdocs/modules/common/index.html +8 -1
- package/documentation/jsdocs/modules/common/namespaces.list.html +15 -1
- package/documentation/jsdocs/modules/common/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/form-skin/SkinCheckbox.html +1 -1
- package/documentation/jsdocs/modules/form-skin/SkinFile.html +1 -1
- package/documentation/jsdocs/modules/form-skin/SkinRadio.html +1 -1
- package/documentation/jsdocs/modules/form-skin/SkinSelect.html +1 -1
- package/documentation/jsdocs/modules/form-skin/classes.list.html +1 -1
- package/documentation/jsdocs/modules/form-skin/global.html +1 -1
- package/documentation/jsdocs/modules/form-skin/index.html +1 -1
- package/documentation/jsdocs/modules/form-skin/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/media-preloader/MediaPreloader.html +1 -1
- package/documentation/jsdocs/modules/media-preloader/classes.list.html +1 -1
- package/documentation/jsdocs/modules/media-preloader/index.html +1 -1
- package/documentation/jsdocs/modules/media-preloader/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/notifications/Notifications.html +1 -1
- package/documentation/jsdocs/modules/notifications/classes.list.html +1 -1
- package/documentation/jsdocs/modules/notifications/index.html +1 -1
- package/documentation/jsdocs/modules/notifications/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/popin/Popin.html +1 -1
- package/documentation/jsdocs/modules/popin/PopinController.html +1 -1
- package/documentation/jsdocs/modules/popin/classes.list.html +1 -1
- package/documentation/jsdocs/modules/popin/index.html +1 -1
- package/documentation/jsdocs/modules/popin/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/scroll-snap/ScrollSnap.html +1 -1
- package/documentation/jsdocs/modules/scroll-snap/classes.list.html +1 -1
- package/documentation/jsdocs/modules/scroll-snap/index.html +1 -1
- package/documentation/jsdocs/modules/scroll-snap/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/slider/Slider.html +1 -1
- package/documentation/jsdocs/modules/slider/SliderControls.html +159 -2
- package/documentation/jsdocs/modules/slider/classes.list.html +1 -1
- package/documentation/jsdocs/modules/slider/index.html +1 -1
- package/documentation/jsdocs/modules/slider/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/tabs/Tabs.html +1 -1
- package/documentation/jsdocs/modules/tabs/classes.list.html +1 -1
- package/documentation/jsdocs/modules/tabs/index.html +1 -1
- package/documentation/jsdocs/modules/tabs/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/validator/Validator.html +1 -1
- package/documentation/jsdocs/modules/validator/classes.list.html +1 -1
- package/documentation/jsdocs/modules/validator/global.html +1 -1
- package/documentation/jsdocs/modules/validator/index.html +1 -1
- package/documentation/jsdocs/modules/validator/quicksearch.html +1 -1
- package/documentation/jsdocs/modules/youtube-player/YouTubePlayer.html +1 -1
- package/documentation/jsdocs/modules/youtube-player/classes.list.html +1 -1
- package/documentation/jsdocs/modules/youtube-player/index.html +1 -1
- package/documentation/jsdocs/modules/youtube-player/quicksearch.html +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import onTransitionEnd from '../Events/OnTransitionEnd';
|
|
2
|
+
import onAnimationEnd from '../Events/OnAnimationEnd';
|
|
3
|
+
import { wait } from './Wait';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const KEY = Symbol( 'TransitionHelper' );
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function addWatcher( $element, styleChange, isAnimation, options = {} ) {
|
|
10
|
+
if ( $element[ KEY ] ) {
|
|
11
|
+
$element[ KEY ].off();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if ( typeof options.delay !== undefined ) {
|
|
15
|
+
options.delay = 'idle'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
$element[ KEY ] = isAnimation ?
|
|
19
|
+
onAnimationEnd( $element, {
|
|
20
|
+
"animationName": options.animationName,
|
|
21
|
+
"pseudoElement": options.pseudoElement
|
|
22
|
+
} ) :
|
|
23
|
+
onTransitionEnd( $element, {
|
|
24
|
+
"property": options.property,
|
|
25
|
+
"pseudoElement": options.pseudoElement
|
|
26
|
+
} );
|
|
27
|
+
|
|
28
|
+
wait( options.delay ).then( () => styleChange( $element ) );
|
|
29
|
+
|
|
30
|
+
$element[ KEY ].then( () => {
|
|
31
|
+
$element[ KEY ] = null;
|
|
32
|
+
return $element;
|
|
33
|
+
} );
|
|
34
|
+
|
|
35
|
+
return $element[ KEY ];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param styleChange - Change the style of $element inside this function by adding a class or set a style property
|
|
41
|
+
* @param delay - Delay betwwen the add of the listener and call of styleChange.
|
|
42
|
+
*
|
|
43
|
+
* delay = 'idle' : window.requestIdleCallback
|
|
44
|
+
* delay < 0 : window.requestAnimationFrame
|
|
45
|
+
* delay >= 0 : setTimeout
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```js
|
|
49
|
+
* // Watch for the end of the transition of the property "opacity" on the pseudo element ::after on $element
|
|
50
|
+
*
|
|
51
|
+
* const myWatcher = transitionWatcher( $elment, () => $element.classList.add('some-class'), {
|
|
52
|
+
* "pseudoElement": "after",
|
|
53
|
+
* "property": "opacity"
|
|
54
|
+
* } );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export function transitionWatcher( $element, styleChange, options ) {
|
|
58
|
+
return addWatcher( $element, styleChange, false, options );
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param animationStart - Start the animation of $element inside this function by adding a class or set a style property
|
|
64
|
+
* @param delay - Delay betwwen the add of the listener and call of animationStart.
|
|
65
|
+
*
|
|
66
|
+
* delay = 'idle' : window.requestIdleCallback
|
|
67
|
+
* delay < 0 : window.requestAnimationFrame
|
|
68
|
+
* delay >= 0 : setTimeout
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```js
|
|
72
|
+
* //Watch for the end of the animation "my-animation" on the pseudo element ::after on $element
|
|
73
|
+
*
|
|
74
|
+
* const myWatcher = animationWatcher( $elment, () => $element.classList.add('some-class'), {
|
|
75
|
+
* "pseudoElement": "after",
|
|
76
|
+
* "animationName": ["my-animation"]
|
|
77
|
+
* } );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export function animationWatcher( $element, animationStart, options ) {
|
|
81
|
+
return addWatcher( $element, animationStart, true, options );
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @example Kill a transition or animation watcher on $element
|
|
87
|
+
*
|
|
88
|
+
* killWatcher( $elment )
|
|
89
|
+
*/
|
|
90
|
+
export function killWatcher( $element ) {
|
|
91
|
+
if ( $element[ KEY ] ) {
|
|
92
|
+
$element[ KEY ].off();
|
|
93
|
+
$element[ KEY ] = null;
|
|
94
|
+
}
|
|
95
|
+
}
|
package/Helpers/extend.js
CHANGED
package/Helpers/getValue.js
CHANGED
package/Helpers/sequential.js
CHANGED
package/Helpers/wait.js
CHANGED
package/Modules/Accordion.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { aClass, rClass } from 'front-library/DOM/Class';
|
|
2
|
-
import { on, off } from 'front-library/Events/EventsManager';
|
|
3
|
-
import { extend } from 'front-library/Helpers/Extend';
|
|
4
|
-
import { next } from 'front-library/DOM/Traversing';
|
|
1
|
+
import { aClass, rClass } from '@creative-web-solution/front-library/DOM/Class';
|
|
2
|
+
import { on, off } from '@creative-web-solution/front-library/Events/EventsManager';
|
|
3
|
+
import { extend } from '@creative-web-solution/front-library/Helpers/Extend';
|
|
4
|
+
import { next } from '@creative-web-solution/front-library/DOM/Traversing';
|
|
5
5
|
|
|
6
6
|
const STATUS_ON = 'STATUS_ON';
|
|
7
7
|
const STATUS_OFF = 'STATUS_OFF';
|
|
@@ -66,10 +66,10 @@ function Tab( $TAB, options ) {
|
|
|
66
66
|
function toggleTab( e ) {
|
|
67
67
|
e.preventDefault();
|
|
68
68
|
|
|
69
|
-
if( isOpen ) {
|
|
69
|
+
if( isOpen && ( !options.atLeastOneOpen || options.allowMultipleTab ) ) {
|
|
70
70
|
closeTab();
|
|
71
71
|
}
|
|
72
|
-
else {
|
|
72
|
+
else if( !isOpen ) {
|
|
73
73
|
openTab();
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -108,6 +108,7 @@ function Tab( $TAB, options ) {
|
|
|
108
108
|
const DEFAULT_OPTIONS = {
|
|
109
109
|
"tabSelector": "button[aria-expanded]",
|
|
110
110
|
"allowMultipleTab": false,
|
|
111
|
+
"atLeastOneOpen": false,
|
|
111
112
|
"animations": {
|
|
112
113
|
"open": function( $TAB, $TAB_PANNEL ) {
|
|
113
114
|
aClass( [ $TAB, $TAB_PANNEL ], 'on' );
|
|
@@ -155,6 +156,7 @@ const DEFAULT_OPTIONS = {
|
|
|
155
156
|
* @param {Object} [userOptions]
|
|
156
157
|
* @param {String} [userOptions.tabSelector='button[aria-expanded]']
|
|
157
158
|
* @param {Boolean} [userOptions.allowMultipleTab=false]
|
|
159
|
+
* @param {Boolean} [userOptions.atLeastOneOpen=false]
|
|
158
160
|
* @param {Accordion_callback} [userOptions.onOpenAtStart]
|
|
159
161
|
* @param {Accordion_callback} [userOptions.onOpen]
|
|
160
162
|
* @param {Accordion_callback} [userOptions.onClose]
|
|
@@ -166,6 +168,7 @@ const DEFAULT_OPTIONS = {
|
|
|
166
168
|
* @example new Accordion( document.querySelector( '.accordion' ), {
|
|
167
169
|
* "tabSelector": ".tab",
|
|
168
170
|
* "allowMultipleTab": false,
|
|
171
|
+
* "atLeastOneOpen": false,
|
|
169
172
|
* "animations": {
|
|
170
173
|
* "open": function( $tab, $panel ) {
|
|
171
174
|
* aClass( [ $tab, $panel ], 'on' );
|
|
@@ -233,6 +236,7 @@ export function Accordion( $accordionWrapper, userOptions = {} ) {
|
|
|
233
236
|
if( status === STATUS_ON ){
|
|
234
237
|
return;
|
|
235
238
|
}
|
|
239
|
+
|
|
236
240
|
status = STATUS_ON;
|
|
237
241
|
|
|
238
242
|
$tabs.forEach( ( $tab, index ) => {
|
|
@@ -254,6 +258,8 @@ export function Accordion( $accordionWrapper, userOptions = {} ) {
|
|
|
254
258
|
tablist.forEach( tab => {
|
|
255
259
|
tab.destroy();
|
|
256
260
|
} );
|
|
261
|
+
|
|
262
|
+
tablist.length = 0;
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
|
package/Modules/Autocomplete.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { gesture, gestureOff } from 'front-library/Events/Gesture';
|
|
2
|
-
import { extend } from 'front-library/Helpers/Extend';
|
|
3
|
-
import { append, remove } from 'front-library/DOM/Manipulation';
|
|
4
|
-
import { height } from 'front-library/DOM/Size';
|
|
5
|
-
import { offset } from 'front-library/DOM/offset';
|
|
6
|
-
import { outerHeight, outerWidth } from 'front-library/DOM/OuterSize';
|
|
7
|
-
import { position } from 'front-library/DOM/position';
|
|
1
|
+
import { gesture, gestureOff } from '@creative-web-solution/front-library/Events/Gesture';
|
|
2
|
+
import { extend } from '@creative-web-solution/front-library/Helpers/Extend';
|
|
3
|
+
import { append, remove } from '@creative-web-solution/front-library/DOM/Manipulation';
|
|
4
|
+
import { height } from '@creative-web-solution/front-library/DOM/Size';
|
|
5
|
+
import { offset } from '@creative-web-solution/front-library/DOM/offset';
|
|
6
|
+
import { outerHeight, outerWidth } from '@creative-web-solution/front-library/DOM/OuterSize';
|
|
7
|
+
import { position } from '@creative-web-solution/front-library/DOM/position';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Autocomplete
|