@brandocms/jupiter 4.0.0-beta.1 → 4.0.0-beta.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/README.md +191 -2
- package/package.json +20 -18
- package/src/index.js +10 -10
- package/src/modules/Application/index.js +203 -157
- package/src/modules/Cookies/index.js +34 -55
- package/src/modules/CoverOverlay/index.js +20 -13
- package/src/modules/Dataloader/index.js +71 -24
- package/src/modules/Dataloader/url-sync.js +238 -0
- package/src/modules/Dom/index.js +18 -0
- package/src/modules/DoubleHeader/index.js +571 -0
- package/src/modules/Dropdown/index.js +101 -75
- package/src/modules/EqualHeightElements/index.js +5 -7
- package/src/modules/EqualHeightImages/index.js +7 -2
- package/src/modules/FixedHeader/index.js +60 -30
- package/src/modules/FooterReveal/index.js +3 -3
- package/src/modules/HeroSlider/index.js +207 -91
- package/src/modules/HeroVideo/index.js +15 -27
- package/src/modules/Lazyload/index.js +101 -80
- package/src/modules/Lightbox/index.js +17 -55
- package/src/modules/Links/index.js +54 -49
- package/src/modules/Looper/index.js +1737 -0
- package/src/modules/Marquee/index.js +106 -37
- package/src/modules/MobileMenu/index.js +70 -124
- package/src/modules/Moonwalk/index.js +349 -150
- package/src/modules/Popover/index.js +186 -28
- package/src/modules/Popup/index.js +27 -34
- package/src/modules/StackedBoxes/index.js +3 -3
- package/src/modules/StickyHeader/index.js +364 -155
- package/src/modules/Toggler/index.js +184 -27
- package/src/utils/motion-helpers.js +330 -0
- package/types/index.d.ts +1 -30
- package/types/modules/Application/index.d.ts +6 -6
- package/types/modules/Breakpoints/index.d.ts +2 -0
- package/types/modules/Dataloader/index.d.ts +5 -2
- package/types/modules/Dataloader/url-sync.d.ts +36 -0
- package/types/modules/Dom/index.d.ts +7 -0
- package/types/modules/DoubleHeader/index.d.ts +63 -0
- package/types/modules/Dropdown/index.d.ts +7 -30
- package/types/modules/EqualHeightImages/index.d.ts +1 -1
- package/types/modules/FixedHeader/index.d.ts +1 -1
- package/types/modules/Lazyload/index.d.ts +9 -9
- package/types/modules/Lightbox/index.d.ts +0 -5
- package/types/modules/Looper/index.d.ts +127 -0
- package/types/modules/Moonwalk/index.d.ts +6 -15
- package/types/modules/Parallax/index.d.ts +10 -32
- package/types/modules/Popover/index.d.ts +12 -0
- package/types/modules/Popup/index.d.ts +6 -19
- package/types/modules/ScrollSpy/index.d.ts +1 -1
- package/types/modules/StickyHeader/index.d.ts +171 -14
- package/types/modules/Toggler/index.d.ts +24 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL synchronization module for Dataloader
|
|
3
|
+
* Handles bidirectional sync between dataloader parameters and browser URL
|
|
4
|
+
*/
|
|
5
|
+
export default class DataloaderUrlSync {
|
|
6
|
+
constructor(dataloader: any, config: any);
|
|
7
|
+
dataloader: any;
|
|
8
|
+
config: any;
|
|
9
|
+
language: string;
|
|
10
|
+
languageInPath: any;
|
|
11
|
+
hideDefaultLanguage: boolean;
|
|
12
|
+
defaultLanguage: any;
|
|
13
|
+
omitFromUrl: any;
|
|
14
|
+
initialize(): void;
|
|
15
|
+
popstateHandler: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Build URL from parameters using template
|
|
18
|
+
*/
|
|
19
|
+
buildUrl(params: any): any;
|
|
20
|
+
/**
|
|
21
|
+
* Parse current URL and extract parameters based on template
|
|
22
|
+
*/
|
|
23
|
+
parseUrl(): any;
|
|
24
|
+
/**
|
|
25
|
+
* Update browser URL with current parameters
|
|
26
|
+
*/
|
|
27
|
+
updateUrl(params: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* Sync dataloader parameters from current URL
|
|
30
|
+
*/
|
|
31
|
+
syncFromUrl(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Clean up event listeners
|
|
34
|
+
*/
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
@@ -37,4 +37,11 @@ declare class DOM {
|
|
|
37
37
|
* @param {*} el
|
|
38
38
|
*/
|
|
39
39
|
inViewport(el: any): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Strict viewport check - element must be fully contained within viewport bounds
|
|
42
|
+
* Useful for popovers/tooltips that need to be completely visible
|
|
43
|
+
*
|
|
44
|
+
* @param {*} el
|
|
45
|
+
*/
|
|
46
|
+
inViewportStrict(el: any): boolean;
|
|
40
47
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export default class DoubleHeader {
|
|
2
|
+
constructor(app: any, opts?: {});
|
|
3
|
+
app: any;
|
|
4
|
+
mainOpts: any;
|
|
5
|
+
preventUnpin: boolean;
|
|
6
|
+
el: any;
|
|
7
|
+
opts: any;
|
|
8
|
+
auxEl: any;
|
|
9
|
+
lis: any;
|
|
10
|
+
preventPin: boolean;
|
|
11
|
+
_isResizing: boolean;
|
|
12
|
+
_firstLoad: boolean;
|
|
13
|
+
_pinned: boolean;
|
|
14
|
+
_top: boolean;
|
|
15
|
+
_bottom: boolean;
|
|
16
|
+
_small: boolean;
|
|
17
|
+
_hiding: boolean;
|
|
18
|
+
lastKnownScrollY: number;
|
|
19
|
+
currentScrollY: number;
|
|
20
|
+
mobileMenuOpen: boolean;
|
|
21
|
+
timer: any;
|
|
22
|
+
resetResizeTimer: any;
|
|
23
|
+
firstReveal: boolean;
|
|
24
|
+
initialize(): void;
|
|
25
|
+
setupObserver(): void;
|
|
26
|
+
observer: IntersectionObserver;
|
|
27
|
+
_navVisible: boolean;
|
|
28
|
+
bindObserver(): void;
|
|
29
|
+
setResizeTimer(): void;
|
|
30
|
+
_hideAlt(): void;
|
|
31
|
+
_showAlt(): void;
|
|
32
|
+
update(): void;
|
|
33
|
+
lock(): void;
|
|
34
|
+
unlock(): void;
|
|
35
|
+
checkSize(force: any): void;
|
|
36
|
+
checkTop(force: any): void;
|
|
37
|
+
checkBot(force: any): void;
|
|
38
|
+
checkPin(force: any, toleranceExceeded: any): void;
|
|
39
|
+
redraw(force?: boolean): void;
|
|
40
|
+
notTop(): void;
|
|
41
|
+
top(): void;
|
|
42
|
+
notBottom(): void;
|
|
43
|
+
bottom(): void;
|
|
44
|
+
unpin(): void;
|
|
45
|
+
pin(): void;
|
|
46
|
+
notSmall(): void;
|
|
47
|
+
small(): void;
|
|
48
|
+
shouldUnpin(toleranceExceeded: any): any;
|
|
49
|
+
shouldPin(toleranceExceeded: any): any;
|
|
50
|
+
isOutOfBounds(): boolean;
|
|
51
|
+
getScrollerPhysicalHeight(): number;
|
|
52
|
+
getScrollerHeight(): number;
|
|
53
|
+
getDocumentHeight(): number;
|
|
54
|
+
getViewportHeight(): number;
|
|
55
|
+
getElementHeight(el: any): number;
|
|
56
|
+
getElementPhysicalHeight(el: any): number;
|
|
57
|
+
getScrollY(): any;
|
|
58
|
+
toleranceExceeded(): boolean;
|
|
59
|
+
_getOptionsForSection(section: any, opts: any): any;
|
|
60
|
+
_bindMobileMenuListeners(): void;
|
|
61
|
+
_onMobileMenuOpen(): void;
|
|
62
|
+
_onMobileMenuClose(): void;
|
|
63
|
+
}
|
|
@@ -1,37 +1,14 @@
|
|
|
1
|
-
interface DropdownOptions {
|
|
2
|
-
multipleActive?: boolean;
|
|
3
|
-
selectors?: {
|
|
4
|
-
trigger: string;
|
|
5
|
-
menu: string;
|
|
6
|
-
menuItems: string;
|
|
7
|
-
};
|
|
8
|
-
overlapTweens?: boolean;
|
|
9
|
-
menuOpenDuration?: number;
|
|
10
|
-
tweens?: {
|
|
11
|
-
items: {
|
|
12
|
-
duration: number;
|
|
13
|
-
autoAlpha: number;
|
|
14
|
-
stagger: number;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
onBeforeOpen?: (dropdown: Dropdown) => Promise<void>;
|
|
18
|
-
onAfterOpen?: (dropdown: Dropdown) => Promise<void>;
|
|
19
|
-
onBeforeClose?: (dropdown: Dropdown) => Promise<void>;
|
|
20
|
-
onAfterClose?: (dropdown: Dropdown) => Promise<void>;
|
|
21
|
-
el?: HTMLElement;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
1
|
export default class Dropdown {
|
|
25
|
-
constructor(app: any, opts?:
|
|
2
|
+
constructor(app: any, opts?: {});
|
|
26
3
|
app: any;
|
|
27
|
-
opts:
|
|
28
|
-
elements:
|
|
4
|
+
opts: any;
|
|
5
|
+
elements: {};
|
|
29
6
|
open: boolean;
|
|
30
|
-
element:
|
|
31
|
-
timeline:
|
|
32
|
-
handleDocumentClick(event:
|
|
7
|
+
element: any;
|
|
8
|
+
timeline: any;
|
|
9
|
+
handleDocumentClick(event: any): void;
|
|
33
10
|
initialize(): void;
|
|
34
|
-
onClick(event:
|
|
11
|
+
onClick(event: any): Promise<void>;
|
|
35
12
|
openMenu(): Promise<void>;
|
|
36
13
|
closeMenu(): Promise<void>;
|
|
37
14
|
checkForInitialOpen(): void;
|
|
@@ -5,7 +5,7 @@ export default class EqualHeightImages {
|
|
|
5
5
|
opts: any;
|
|
6
6
|
run(): void;
|
|
7
7
|
initialize(): void;
|
|
8
|
-
canvases: any
|
|
8
|
+
canvases: any;
|
|
9
9
|
getRenderedSize(contains: any, cWidth: any, cHeight: any, width: any, height: any, pos: any): any;
|
|
10
10
|
getImgSizeInfo(img: any): any;
|
|
11
11
|
}
|
|
@@ -10,22 +10,22 @@ export default class Lazyload {
|
|
|
10
10
|
constructor(app: any, opts?: LazyloadOptions);
|
|
11
11
|
app: any;
|
|
12
12
|
opts: any;
|
|
13
|
+
target: any;
|
|
14
|
+
resizePending: Map<any, any>;
|
|
15
|
+
rafId: number;
|
|
16
|
+
srcsetReadyObserver: MutationObserver;
|
|
13
17
|
watch(): void;
|
|
14
18
|
initialize(): void;
|
|
15
|
-
lazyPictures:
|
|
19
|
+
lazyPictures: any;
|
|
16
20
|
loadObserver: IntersectionObserver;
|
|
17
21
|
revealObserver: IntersectionObserver;
|
|
18
22
|
imageObserver: IntersectionObserver;
|
|
19
|
-
lazyImages:
|
|
23
|
+
lazyImages: any;
|
|
20
24
|
initObserver(observer: any, setAttrs?: boolean): void;
|
|
21
25
|
forceLoad($container?: HTMLElement): void;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* Set sizes attribute for all imgs with `data-sizes="auto"` and source within the <picture>
|
|
26
|
-
*/
|
|
27
|
-
autoSizes(): void;
|
|
28
|
-
getWidth(img: any): any;
|
|
26
|
+
initializeResizeObserver(): void;
|
|
27
|
+
sizeObserver: ResizeObserver;
|
|
28
|
+
flushSizeUpdates(): void;
|
|
29
29
|
initializeSections(): void;
|
|
30
30
|
handleLoadEntries(elements: any): void;
|
|
31
31
|
handleRevealEntries(elements: any): void;
|
|
@@ -36,7 +36,6 @@ export default class Lightbox {
|
|
|
36
36
|
onKeyup(e: any, section: any): void;
|
|
37
37
|
onMouseMove(e: any): void;
|
|
38
38
|
pointerDirection: string;
|
|
39
|
-
attachSwiper(section: any, el: any, initialIdx: any): void;
|
|
40
39
|
}
|
|
41
40
|
export type LightboxElements = {
|
|
42
41
|
/**
|
|
@@ -65,10 +64,6 @@ export type LightboxOptions = {
|
|
|
65
64
|
* - Enable index numbers
|
|
66
65
|
*/
|
|
67
66
|
numbers?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* - Enable swipe - this breaks native zoom
|
|
70
|
-
*/
|
|
71
|
-
swipe?: boolean;
|
|
72
67
|
/**
|
|
73
68
|
* - Selector for trigger element to open the lightbox
|
|
74
69
|
*/
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for configuring the Looper module
|
|
3
|
+
*/
|
|
4
|
+
export interface LooperOptions {
|
|
5
|
+
/** Center the loop container. Can be true, false, or a selector string */
|
|
6
|
+
center?: boolean | string;
|
|
7
|
+
/** Enable snap-to-item behavior. Can be true, false, or a number for custom snap distance */
|
|
8
|
+
snap?: boolean | number;
|
|
9
|
+
/** Enable continuous auto-scrolling */
|
|
10
|
+
crawl?: boolean;
|
|
11
|
+
/** Enable infinite looping. If false, creates linear scrolling */
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/** Enable drag interaction with mouse/touch */
|
|
14
|
+
draggable?: boolean;
|
|
15
|
+
/** Speed multipliers for different breakpoints */
|
|
16
|
+
speed?: {
|
|
17
|
+
sm?: number;
|
|
18
|
+
lg?: number;
|
|
19
|
+
};
|
|
20
|
+
/** Easing configuration for hover interactions */
|
|
21
|
+
ease?: {
|
|
22
|
+
mouseOver?: {
|
|
23
|
+
speed?: number;
|
|
24
|
+
duration?: number;
|
|
25
|
+
};
|
|
26
|
+
mouseOut?: {
|
|
27
|
+
speed?: number;
|
|
28
|
+
duration?: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** CSS selector for looper elements */
|
|
32
|
+
selector?: string;
|
|
33
|
+
/** Extra padding on the right side in pixels */
|
|
34
|
+
paddingRight?: number | string;
|
|
35
|
+
/** Start in reversed direction */
|
|
36
|
+
reversed?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Loop controller returned by horizontalLoop function
|
|
41
|
+
*/
|
|
42
|
+
export interface LoopController {
|
|
43
|
+
/** Motion value tracking the current position */
|
|
44
|
+
position: any;
|
|
45
|
+
/** Main animation instance */
|
|
46
|
+
animation: any;
|
|
47
|
+
/** Array of item elements */
|
|
48
|
+
items: HTMLElement[];
|
|
49
|
+
/** Array of snap time positions */
|
|
50
|
+
times: number[];
|
|
51
|
+
/** Whether the loop is reversed */
|
|
52
|
+
isReversed: boolean;
|
|
53
|
+
/** Whether the loop is in looping mode */
|
|
54
|
+
isLooping: boolean;
|
|
55
|
+
|
|
56
|
+
/** Start/resume the loop animation */
|
|
57
|
+
play(): void;
|
|
58
|
+
|
|
59
|
+
/** Pause the loop animation */
|
|
60
|
+
pause(): void;
|
|
61
|
+
|
|
62
|
+
/** Get the current active item index */
|
|
63
|
+
current(): number;
|
|
64
|
+
|
|
65
|
+
/** Find the closest item index to current position */
|
|
66
|
+
closestIndex(setCurrent?: boolean): number;
|
|
67
|
+
|
|
68
|
+
/** Navigate to the next item */
|
|
69
|
+
next(vars?: { duration?: number; easing?: string }): any;
|
|
70
|
+
|
|
71
|
+
/** Navigate to the previous item */
|
|
72
|
+
previous(vars?: { duration?: number; easing?: string }): any;
|
|
73
|
+
|
|
74
|
+
/** Navigate to a specific item index */
|
|
75
|
+
toIndex(index: number, vars?: { duration?: number; easing?: string }): any;
|
|
76
|
+
|
|
77
|
+
/** Refresh measurements and recalculate (useful after resize) */
|
|
78
|
+
refresh(deep?: boolean): void;
|
|
79
|
+
|
|
80
|
+
/** Clean up and destroy the loop */
|
|
81
|
+
destroy(): void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Looper Module
|
|
86
|
+
* Creates seamless horizontal infinite scrolling carousels with drag interaction,
|
|
87
|
+
* momentum/inertia, auto-crawl, snap-to-item, and responsive resize handling
|
|
88
|
+
*/
|
|
89
|
+
export default class Looper {
|
|
90
|
+
/**
|
|
91
|
+
* Create a new Looper instance
|
|
92
|
+
* @param app - Jupiter application instance
|
|
93
|
+
* @param opts - Configuration options
|
|
94
|
+
*/
|
|
95
|
+
constructor(app: any, opts?: Partial<LooperOptions>);
|
|
96
|
+
|
|
97
|
+
/** Configuration options */
|
|
98
|
+
opts: LooperOptions;
|
|
99
|
+
|
|
100
|
+
/** Jupiter application instance */
|
|
101
|
+
app: any;
|
|
102
|
+
|
|
103
|
+
/** Array of active loop controllers */
|
|
104
|
+
loopers: LoopController[];
|
|
105
|
+
|
|
106
|
+
/** Array of pending loopers waiting for initialization */
|
|
107
|
+
pendingLoopers: any[];
|
|
108
|
+
|
|
109
|
+
/** DOM elements matching the selector */
|
|
110
|
+
looperElements: HTMLElement[];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Initialize the module and find all looper elements
|
|
114
|
+
*/
|
|
115
|
+
init(): void;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Finalize loopers after APPLICATION:REVEALED event
|
|
119
|
+
* This is when actual measurements and animations are set up
|
|
120
|
+
*/
|
|
121
|
+
finalizeLoopers(): void;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Destroy all loopers and clean up
|
|
125
|
+
*/
|
|
126
|
+
destroy(): void;
|
|
127
|
+
}
|
|
@@ -28,6 +28,7 @@ export default class Moonwalk {
|
|
|
28
28
|
el: Element;
|
|
29
29
|
threshold: any;
|
|
30
30
|
initialize: any;
|
|
31
|
+
onReady: any;
|
|
31
32
|
callback: any;
|
|
32
33
|
onExit: any;
|
|
33
34
|
repeated: any;
|
|
@@ -76,6 +77,7 @@ export default class Moonwalk {
|
|
|
76
77
|
el: Element;
|
|
77
78
|
threshold: any;
|
|
78
79
|
initialize: any;
|
|
80
|
+
onReady: any;
|
|
79
81
|
callback: any;
|
|
80
82
|
onExit: any;
|
|
81
83
|
repeated: any;
|
|
@@ -230,15 +232,6 @@ export type MoonwalkWalk = {
|
|
|
230
232
|
*/
|
|
231
233
|
sectionTargets?: string;
|
|
232
234
|
};
|
|
233
|
-
export type MoonwalkRunMeta = {
|
|
234
|
-
/**
|
|
235
|
-
* - Direction of viewport crossing ('top', 'bottom', 'left', 'right', or null)
|
|
236
|
-
* - For entry callbacks: indicates which side the element entered from
|
|
237
|
-
* - For exit callbacks: indicates which side the element exited to
|
|
238
|
-
*/
|
|
239
|
-
direction: string | null;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
235
|
export type MoonwalkRun = {
|
|
243
236
|
/**
|
|
244
237
|
* - IntersectionObserver threshold
|
|
@@ -246,16 +239,10 @@ export type MoonwalkRun = {
|
|
|
246
239
|
threshold?: number;
|
|
247
240
|
/**
|
|
248
241
|
* - Function called when element enters viewport
|
|
249
|
-
* - @param {HTMLElement} element - The element that triggered the callback
|
|
250
|
-
* - @param {boolean} repeated - Whether this is a repeated trigger
|
|
251
|
-
* - @param {MoonwalkRunMeta} meta - Information about how the element entered the viewport
|
|
252
242
|
*/
|
|
253
243
|
callback: Function;
|
|
254
244
|
/**
|
|
255
245
|
* - Function called when element exits viewport
|
|
256
|
-
* - @param {HTMLElement} element - The element that triggered the callback
|
|
257
|
-
* - @param {boolean} repeated - Whether this is a repeated exit
|
|
258
|
-
* - @param {MoonwalkRunMeta} meta - Information about how the element exited the viewport
|
|
259
246
|
*/
|
|
260
247
|
onExit?: Function;
|
|
261
248
|
/**
|
|
@@ -270,6 +257,10 @@ export type MoonwalkRun = {
|
|
|
270
257
|
* - Function called during initialization
|
|
271
258
|
*/
|
|
272
259
|
initialize?: Function;
|
|
260
|
+
/**
|
|
261
|
+
* - Function called when APPLICATION_REVEALED fires, before viewport observers start
|
|
262
|
+
*/
|
|
263
|
+
onReady?: Function;
|
|
273
264
|
};
|
|
274
265
|
export type MoonwalkOptions = {
|
|
275
266
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parallax scrolling effect
|
|
2
|
+
* Parallax scrolling effect inspired by SimpleParallax.js
|
|
3
3
|
*/
|
|
4
4
|
export default class Parallax {
|
|
5
5
|
/**
|
|
@@ -10,82 +10,60 @@ export default class Parallax {
|
|
|
10
10
|
constructor(app: any, opts?: ParallaxOptions);
|
|
11
11
|
app: any;
|
|
12
12
|
opts: any;
|
|
13
|
-
elements:
|
|
14
|
-
parallaxElements:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
content: HTMLElement | null;
|
|
20
|
-
figure: HTMLElement | null;
|
|
21
|
-
elementHeight: number;
|
|
22
|
-
elementWidth: number;
|
|
23
|
-
lastPosition: number;
|
|
24
|
-
}>;
|
|
25
|
-
|
|
13
|
+
elements: {};
|
|
14
|
+
parallaxElements: any[];
|
|
15
|
+
/**
|
|
16
|
+
* Handle scroll event to update parallax effect
|
|
17
|
+
*/
|
|
18
|
+
onScroll(): void;
|
|
26
19
|
/**
|
|
27
20
|
* Set up a parallax element with its properties
|
|
28
21
|
* @param {HTMLElement} el - Element to set up
|
|
29
22
|
*/
|
|
30
23
|
setupParallaxElement(el: HTMLElement): void;
|
|
31
|
-
|
|
32
24
|
/**
|
|
33
25
|
* Calculate the transform value based on scroll position
|
|
34
26
|
* @param {Object} item - Parallax element data
|
|
35
27
|
* @param {number} scrollPosition - Current scroll position
|
|
36
28
|
* @returns {Object} Transform and opacity values
|
|
37
29
|
*/
|
|
38
|
-
calculateTransform(item: any, scrollPosition: number):
|
|
39
|
-
|
|
30
|
+
calculateTransform(item: any, scrollPosition: number): any;
|
|
40
31
|
/**
|
|
41
32
|
* Apply a smooth transition between current and target position
|
|
42
33
|
* @param {Object} item - Parallax element data
|
|
43
34
|
* @param {Object} target - Target transform and opacity values
|
|
44
35
|
*/
|
|
45
|
-
applyTransform(item: any, target:
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Handle scroll event to update parallax effect
|
|
49
|
-
*/
|
|
50
|
-
onScroll(): void;
|
|
51
|
-
|
|
36
|
+
applyTransform(item: any, target: any): void;
|
|
52
37
|
/**
|
|
53
38
|
* Destroy the parallax instance and clean up
|
|
54
39
|
*/
|
|
55
40
|
destroy(): void;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
export type ParallaxOptions = {
|
|
59
43
|
/**
|
|
60
44
|
* - Target element selector or element
|
|
61
45
|
*/
|
|
62
46
|
el?: string | HTMLElement;
|
|
63
|
-
|
|
64
47
|
/**
|
|
65
48
|
* - Default parallax movement factor
|
|
66
49
|
*/
|
|
67
50
|
factor?: number;
|
|
68
|
-
|
|
69
51
|
/**
|
|
70
52
|
* - Whether to fade content while scrolling
|
|
71
53
|
*/
|
|
72
54
|
fadeContent?: boolean;
|
|
73
|
-
|
|
74
55
|
/**
|
|
75
56
|
* - Scale factor to apply to parallax images
|
|
76
57
|
*/
|
|
77
58
|
scale?: number;
|
|
78
|
-
|
|
79
59
|
/**
|
|
80
60
|
* - Delay factor to smooth the effect
|
|
81
61
|
*/
|
|
82
62
|
delay?: number;
|
|
83
|
-
|
|
84
63
|
/**
|
|
85
64
|
* - Direction of parallax effect ('up', 'down', 'left', 'right')
|
|
86
65
|
*/
|
|
87
|
-
orientation?:
|
|
88
|
-
|
|
66
|
+
orientation?: string;
|
|
89
67
|
/**
|
|
90
68
|
* - Whether to show element overflow
|
|
91
69
|
*/
|
|
@@ -6,12 +6,24 @@ export default class Popover {
|
|
|
6
6
|
position: any;
|
|
7
7
|
className: string;
|
|
8
8
|
orderedPositions: string[];
|
|
9
|
+
currentPosition: any;
|
|
9
10
|
popover: HTMLDivElement;
|
|
11
|
+
boundHandleDocumentClick: any;
|
|
12
|
+
boundHandleScroll: any;
|
|
10
13
|
handleMouseEnter(e: any): void;
|
|
11
14
|
handleMouseLeave(e: any): void;
|
|
12
15
|
handleTouchStart(e: any): void;
|
|
16
|
+
handleClick(e: any): void;
|
|
13
17
|
get isVisible(): boolean;
|
|
14
18
|
show(): void;
|
|
19
|
+
updatePosition(animate?: boolean): void;
|
|
15
20
|
hide(): void;
|
|
16
21
|
toggle(): void;
|
|
22
|
+
addDocumentClickHandler(): void;
|
|
23
|
+
removeDocumentClickHandler(): void;
|
|
24
|
+
handleDocumentClick(e: any): void;
|
|
25
|
+
closeAllExcept(exceptPopover: any): void;
|
|
26
|
+
handleScroll(): void;
|
|
27
|
+
addScrollListener(): void;
|
|
28
|
+
removeScrollListener(): void;
|
|
17
29
|
}
|
|
@@ -11,30 +11,25 @@ export default class Popup {
|
|
|
11
11
|
constructor(app: any, selector?: string, opts?: PopupOptions);
|
|
12
12
|
app: any;
|
|
13
13
|
opts: any;
|
|
14
|
-
backdrop:
|
|
15
|
-
currentPopup:
|
|
16
|
-
popupKey: string
|
|
17
|
-
keyUpListener: any;
|
|
18
|
-
|
|
14
|
+
backdrop: HTMLElement;
|
|
15
|
+
currentPopup: string | HTMLElement;
|
|
16
|
+
popupKey: string;
|
|
19
17
|
/**
|
|
20
18
|
* Bind click handlers to popup triggers and close buttons
|
|
21
19
|
*/
|
|
22
20
|
bindTriggers(): void;
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* Extract key from target selector or element
|
|
26
23
|
* @param {HTMLElement|string} target - Target element or selector
|
|
27
24
|
* @returns {string|null} - The popup key or null
|
|
28
25
|
*/
|
|
29
26
|
getKeyFromTarget(target: HTMLElement | string): string | null;
|
|
30
|
-
|
|
31
27
|
/**
|
|
32
28
|
* Create backdrop element for popup
|
|
33
29
|
* @param {string|null} key - Optional popup key to associate with backdrop
|
|
34
30
|
* @returns {HTMLElement} The created backdrop element
|
|
35
31
|
*/
|
|
36
|
-
createBackdrop(key
|
|
37
|
-
|
|
32
|
+
createBackdrop(key: string | null): HTMLElement;
|
|
38
33
|
/**
|
|
39
34
|
* Open a popup
|
|
40
35
|
* @param {HTMLElement} trigger - Element that triggered the popup
|
|
@@ -42,48 +37,40 @@ export default class Popup {
|
|
|
42
37
|
* @param {string|null} key - Optional popup key
|
|
43
38
|
*/
|
|
44
39
|
open(trigger: HTMLElement, target: HTMLElement | string, key?: string | null): void;
|
|
45
|
-
|
|
40
|
+
keyUpListener: any;
|
|
46
41
|
/**
|
|
47
42
|
* Close the popup
|
|
48
43
|
*/
|
|
49
44
|
close(): void;
|
|
50
|
-
|
|
51
45
|
/**
|
|
52
46
|
* Handle keyup event for Escape key to close popup
|
|
53
47
|
* @param {KeyboardEvent} e - Keyboard event
|
|
54
48
|
*/
|
|
55
49
|
onKeyup(e: KeyboardEvent): void;
|
|
56
50
|
}
|
|
57
|
-
|
|
58
51
|
export type PopupOptions = {
|
|
59
52
|
/**
|
|
60
53
|
* - CSS selector to find popup elements
|
|
61
|
-
* Default: '[data-popup]'
|
|
62
54
|
*/
|
|
63
55
|
selector?: string;
|
|
64
|
-
|
|
65
56
|
/**
|
|
66
57
|
* - Function that determines if popup should be shown on current breakpoint
|
|
67
58
|
*/
|
|
68
59
|
responsive?: Function;
|
|
69
|
-
|
|
70
60
|
/**
|
|
71
61
|
* - Called when popup opens
|
|
72
62
|
*/
|
|
73
63
|
onOpen?: Function;
|
|
74
|
-
|
|
75
64
|
/**
|
|
76
65
|
* - Called when popup closes
|
|
77
66
|
*/
|
|
78
67
|
onClose?: Function;
|
|
79
|
-
|
|
80
68
|
/**
|
|
81
69
|
* - Animation function for opening popup
|
|
82
70
|
*/
|
|
83
71
|
tweenIn?: Function;
|
|
84
|
-
|
|
85
72
|
/**
|
|
86
73
|
* - Animation function for closing popup
|
|
87
74
|
*/
|
|
88
75
|
tweenOut?: Function;
|
|
89
|
-
};
|
|
76
|
+
};
|