aptechka 0.44.1 → 0.44.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/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +21 -21
- package/lib/scroll-segment/ScrollSegmentDefaultContainer.d.ts +11 -0
- package/lib/scroll-segment/ScrollSegmentElement.d.ts +78 -0
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.d.ts +2 -79
- package/lib/scroll-segment/index.js +182 -154
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=
|
|
1
|
+
"use strict";var u=i=>{throw TypeError(i)};var c=(i,t,r)=>t.has(i)||u("Cannot "+r);var s=(i,t,r)=>(c(i,t,"read from private field"),r?r.call(i):t.get(i)),l=(i,t,r)=>t.has(i)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../notifier/index.cjs"),g=require("../dom-JBOkFLTh.cjs");var h,e,o;class d{constructor(){l(this,h,new Set);l(this,e,new WeakMap);l(this,o,new f.Notifier)}get notifier(){return s(this,o)}register(t){s(this,e).has(t)||(s(this,e).set(t,{axis:"y",value:0,element:t}),s(this,h).add(t),s(this,o).notify())}unregister(t){s(this,e).has(t)&&s(this,h).has(t)&&(s(this,e).delete(t),s(this,h).delete(t),s(this,o).notify())}update(t,r,a){const n=s(this,e).get(t);n&&(n.axis=r,n.value=a)}hasEntry(t){return s(this,e).has(t)}getEntry(t){return s(this,e).get(t)}getAll(t){const r=g.getAllParentElements(t).filter(n=>s(this,h).has(n)),a=[];return r.forEach(n=>{s(this,e).has(n)&&a.push(s(this,e).get(n))}),a}}h=new WeakMap,e=new WeakMap,o=new WeakMap;const y=new d;exports.scrollEntries=y;
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var l = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var u = (
|
|
5
|
-
var
|
|
4
|
+
var u = (i, t, e) => t.has(i) || l("Cannot " + e);
|
|
5
|
+
var s = (i, t, e) => (u(i, t, "read from private field"), e ? e.call(i) : t.get(i)), f = (i, t, e) => t.has(i) ? l("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e);
|
|
6
6
|
import { Notifier as g } from "../notifier/index.js";
|
|
7
7
|
import { a as c } from "../dom-CVWzyXPH.js";
|
|
8
|
-
var
|
|
8
|
+
var n, r, a;
|
|
9
9
|
class p {
|
|
10
10
|
constructor() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
f(this, n, /* @__PURE__ */ new Set());
|
|
12
|
+
f(this, r, /* @__PURE__ */ new WeakMap());
|
|
13
|
+
f(this, a, new g());
|
|
14
14
|
}
|
|
15
15
|
get notifier() {
|
|
16
|
-
return
|
|
16
|
+
return s(this, a);
|
|
17
17
|
}
|
|
18
18
|
register(t) {
|
|
19
|
-
|
|
19
|
+
s(this, r).has(t) || (s(this, r).set(t, {
|
|
20
20
|
axis: "y",
|
|
21
21
|
value: 0,
|
|
22
22
|
element: t
|
|
23
|
-
}),
|
|
23
|
+
}), s(this, n).add(t), s(this, a).notify());
|
|
24
24
|
}
|
|
25
25
|
unregister(t) {
|
|
26
|
-
|
|
26
|
+
s(this, r).has(t) && s(this, n).has(t) && (s(this, r).delete(t), s(this, n).delete(t), s(this, a).notify());
|
|
27
27
|
}
|
|
28
|
-
update(t,
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
update(t, e, o) {
|
|
29
|
+
const h = s(this, r).get(t);
|
|
30
|
+
h && (h.axis = e, h.value = o);
|
|
31
31
|
}
|
|
32
32
|
hasEntry(t) {
|
|
33
|
-
return
|
|
33
|
+
return s(this, r).has(t);
|
|
34
34
|
}
|
|
35
35
|
getEntry(t) {
|
|
36
|
-
return
|
|
36
|
+
return s(this, r).get(t);
|
|
37
37
|
}
|
|
38
38
|
getAll(t) {
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
-
|
|
39
|
+
const e = c(t).filter((h) => s(this, n).has(h)), o = [];
|
|
40
|
+
return e.forEach((h) => {
|
|
41
|
+
s(this, r).has(h) && o.push(s(this, r).get(h));
|
|
42
42
|
}), o;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
n = new WeakMap(), r = new WeakMap(), a = new WeakMap();
|
|
46
46
|
const w = new p();
|
|
47
47
|
export {
|
|
48
48
|
w as scrollEntries
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScrollSegmentElement, ScrollSegmentContainer } from './ScrollSegmentElement';
|
|
2
|
+
export declare class ScrollSegmentDefaultContainer implements ScrollSegmentContainer {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(segmentElement: ScrollSegmentElement);
|
|
5
|
+
get element(): HTMLElement;
|
|
6
|
+
get currentScrollValue(): number;
|
|
7
|
+
get vertical(): boolean;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
onScroll(callback: Function): void;
|
|
10
|
+
offScroll(callback: Function): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CSSProperty } from '../css-property';
|
|
2
|
+
import { Store } from '../store';
|
|
3
|
+
import { Damped } from '../animation';
|
|
4
|
+
export interface ScrollSegmentEvents {
|
|
5
|
+
scrollSegmentCapture: CustomEvent;
|
|
6
|
+
scrollSegmentCaptureFromStart: CustomEvent;
|
|
7
|
+
scrollSegmentCaptureFromFinish: CustomEvent;
|
|
8
|
+
scrollSegmentRelease: CustomEvent;
|
|
9
|
+
scrollSegmentReleaseFromStart: CustomEvent;
|
|
10
|
+
scrollSegmentReleaseFromFinish: CustomEvent;
|
|
11
|
+
}
|
|
12
|
+
export interface ScrollSegmentContainer {
|
|
13
|
+
element: HTMLElement;
|
|
14
|
+
currentScrollValue: number;
|
|
15
|
+
vertical: boolean;
|
|
16
|
+
onScroll(callback: Function): void;
|
|
17
|
+
offScroll(callback: Function): void;
|
|
18
|
+
}
|
|
19
|
+
export interface ScrollSegmentContainerElement extends Omit<ScrollSegmentContainer, 'element'>, HTMLElement {
|
|
20
|
+
}
|
|
21
|
+
export declare class ScrollSegmentElement extends HTMLElement {
|
|
22
|
+
#private;
|
|
23
|
+
get scrollContainer(): ScrollSegmentContainerElement | ScrollSegmentContainer;
|
|
24
|
+
set scrollContainer(value: ScrollSegmentContainerElement | ScrollSegmentContainer);
|
|
25
|
+
get distanceOffsetCSSProperty(): CSSProperty<number>;
|
|
26
|
+
get startOffsetCSSProperty(): CSSProperty<number>;
|
|
27
|
+
get captureOnceCSSProperty(): CSSProperty<boolean>;
|
|
28
|
+
get capturedCSSProperty(): CSSProperty<string>;
|
|
29
|
+
get releasedCSSProperty(): CSSProperty<string>;
|
|
30
|
+
get capturedFromStartCSSProperty(): CSSProperty<string>;
|
|
31
|
+
get capturedFromFinishCSSProperty(): CSSProperty<string>;
|
|
32
|
+
get releasedFromStartCSSProperty(): CSSProperty<string>;
|
|
33
|
+
get releasedFromFinishCSSProperty(): CSSProperty<string>;
|
|
34
|
+
get passedVarCSSProperty(): CSSProperty<string>;
|
|
35
|
+
get progressVarCSSProperty(): CSSProperty<string>;
|
|
36
|
+
get animationVarTypeCSSProperty(): CSSProperty<"target" | "current">;
|
|
37
|
+
get distanceVarCSSProperty(): CSSProperty<string>;
|
|
38
|
+
get startVarCSSProperty(): CSSProperty<string>;
|
|
39
|
+
get finishVarCSSProperty(): CSSProperty<string>;
|
|
40
|
+
get disabledCSSProperty(): CSSProperty<boolean>;
|
|
41
|
+
get dampingCSSProperty(): CSSProperty<number>;
|
|
42
|
+
get massCSSProperty(): CSSProperty<number>;
|
|
43
|
+
get stiffnessCSSProperty(): CSSProperty<number>;
|
|
44
|
+
get targetCSSProperty(): CSSProperty<string>;
|
|
45
|
+
get isCaptured(): Store<boolean>;
|
|
46
|
+
get isReleased(): Store<boolean>;
|
|
47
|
+
get isCapturedFromStart(): Store<boolean>;
|
|
48
|
+
get isReleasedFromStart(): Store<boolean>;
|
|
49
|
+
get isCapturedFromFinish(): Store<boolean>;
|
|
50
|
+
get isReleasedFromFinish(): Store<boolean>;
|
|
51
|
+
get directionPosition(): number;
|
|
52
|
+
get directionSize(): number;
|
|
53
|
+
get passed(): Damped;
|
|
54
|
+
get progress(): number;
|
|
55
|
+
get start(): number;
|
|
56
|
+
get finish(): number;
|
|
57
|
+
get distance(): number;
|
|
58
|
+
get isCapturedOnce(): boolean;
|
|
59
|
+
get isDisabled(): boolean;
|
|
60
|
+
resize(): void;
|
|
61
|
+
tick(): void;
|
|
62
|
+
disable(): void;
|
|
63
|
+
enable(): void;
|
|
64
|
+
protected connectedCallback(): void;
|
|
65
|
+
protected disconnectedCallback(): void;
|
|
66
|
+
protected removeVar(name: string | undefined): void;
|
|
67
|
+
protected setVar(name: string | undefined, value: string | number): void;
|
|
68
|
+
protected getDistance(): number;
|
|
69
|
+
protected getStart(): number;
|
|
70
|
+
protected findAnotherScrollEntries: () => void;
|
|
71
|
+
}
|
|
72
|
+
declare global {
|
|
73
|
+
interface HTMLElementTagNameMap {
|
|
74
|
+
'scroll-segment': ScrollSegmentElement;
|
|
75
|
+
}
|
|
76
|
+
interface HTMLElementEventMap extends ScrollSegmentEvents {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ot=a=>{throw TypeError(a)};var rt=(a,f,r)=>f.has(a)||ot("Cannot "+r);var t=(a,f,r)=>(rt(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?ot("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(rt(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(rt(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ut=require("../order/index.cjs"),at=require("../window-resizer/index.cjs"),wt=require("../index-Cqw2NKev.cjs"),U=require("../events-KVanG9sR.cjs"),Ft=require("../function-MthRj-GJ.cjs"),lt=require("../layout-Ctc2p3uz.cjs"),Vt=require("../math-GDWEqu7y.cjs"),X=require("../Store-DRp_K37w.cjs"),Et=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const Lt=require("../Damped-BbJjFOLH.cjs");var S,j,B,G,K,T,D,_,M,d,y,g,v,A,p,R,O,Z,k,z,q,l,P,w,E,L,F,Y,n,$,N,tt,m,H,C,b,V,J,I,u,h,ft,it,ht,dt,mt,bt,Ct,yt,gt,st,Q,W,vt,Pt,nt,St;let pt=(St=class extends HTMLElement{constructor(){super();i(this,h);i(this,S);i(this,j);i(this,B);i(this,G);i(this,K);i(this,T);i(this,D);i(this,_);i(this,M);i(this,d);i(this,y);i(this,g);i(this,v);i(this,A);i(this,p);i(this,R);i(this,O);i(this,Z);i(this,k);i(this,z);i(this,q);i(this,l);i(this,P);i(this,w);i(this,E);i(this,L);i(this,F);i(this,Y);i(this,n);i(this,$);i(this,N);i(this,tt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,V);i(this,J);i(this,I);i(this,u);i(this,st);i(this,Q);e(this,S,null),e(this,j,new o.CSSProperty(this,"--damping",20)),e(this,B,new o.CSSProperty(this,"--mass",0)),e(this,G,new o.CSSProperty(this,"--stiffness",0)),e(this,K,new o.CSSProperty(this,"--target","")),e(this,T,new o.CSSProperty(this,"--disabled",!1)),e(this,D,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,M,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,A,new o.CSSProperty(this,"--released-from-start","")),e(this,p,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,O,new o.CSSProperty(this,"--progress-var","")),e(this,Z,new o.CSSProperty(this,"--animation-var-type","current")),e(this,k,new o.CSSProperty(this,"--distance-var","")),e(this,z,new o.CSSProperty(this,"--start-var","")),e(this,q,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,w,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,$,0),e(this,N,0),e(this,tt,0),e(this,m,new Lt.Damped(0,{order:ut.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),e(this,I,!1),e(this,u,!0),this.findAnotherScrollEntries=Ft.debounce(()=>{const r=Et.scrollEntries.getAll(this).reverse();let s=0;r.forEach((x,et)=>{x.element===t(this,S)&&(s=et)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,Q).call(this))}),e(this,Q,()=>{!t(this,u)&&t(this,J)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){c(this,h,ht).call(this),e(this,S,r),c(this,h,it).call(this)}get distanceOffsetCSSProperty(){return t(this,D)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,Z)}get distanceVarCSSProperty(){return t(this,k)}get startVarCSSProperty(){return t(this,z)}get finishVarCSSProperty(){return t(this,q)}get disabledCSSProperty(){return t(this,T)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,B)}get stiffnessCSSProperty(){return t(this,G)}get targetCSSProperty(){return t(this,K)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,E)}get isCapturedFromFinish(){return t(this,L)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,V)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,u)}resize(){e(this,N,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,$,t(this,S).vertical?lt.getCumulativeOffsetTop(this,r):lt.getCumulativeOffsetLeft(this,r));const x=c(this,h,ft).call(this).reduce((et,ct)=>et+(t(this,S).vertical?ct.offsetTop:ct.offsetLeft),0);e(this,$,t(this,$)-x),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,_).current),e(this,b,t(this,b)+t(this,D).current),e(this,V,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,V)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,z).current,t(this,C)),this.setVar(t(this,q).current,t(this,V)),this.setVar(t(this,k).current,t(this,b)),t(this,m).max=t(this,b),e(this,J,!0)}tick(){let r=t(this,S).currentScrollValue;t(this,Y).forEach(x=>{r+=x.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,w).current||c(this,h,bt).call(this):t(this,w).current&&!t(this,E).current&&c(this,h,yt).call(this),s<t(this,V)?t(this,F).current&&!t(this,L).current&&c(this,h,Ct).call(this):t(this,w).current&&!t(this,F).current&&c(this,h,gt).call(this)),s>=t(this,C)&&s<t(this,V)?t(this,l).current||c(this,h,dt).call(this):t(this,l).current&&(t(this,m).set(Vt.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,mt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,$,0),e(this,N,0),t(this,m).reset(),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,E).current=!1,t(this,L).current=!1,t(this,F).current=!1,e(this,I,!1),e(this,u,!0),c(this,h,nt).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,it).call(this)}disconnectedCallback(){c(this,h,ht).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,N)+t(this,tt)}getStart(){return t(this,$)-t(this,tt)}},S=new WeakMap,j=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,T=new WeakMap,D=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,R=new WeakMap,O=new WeakMap,Z=new WeakMap,k=new WeakMap,z=new WeakMap,q=new WeakMap,l=new WeakMap,P=new WeakMap,w=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,Y=new WeakMap,n=new WeakMap,$=new WeakMap,N=new WeakMap,tt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,V=new WeakMap,J=new WeakMap,I=new WeakMap,u=new WeakMap,h=new WeakSet,ft=function(){const r=[];let s=this.parentElement;for(;s;)window.getComputedStyle(s).position==="sticky"&&r.push(s),s=s.parentElement;return r},it=function(){if(!t(this,S))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,T).observe(),t(this,D).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,R).observe(),t(this,O).observe(),t(this,Z).observe(),t(this,k).observe(),t(this,z).observe(),t(this,q).observe();let r=!1;this.findAnotherScrollEntries(),t(this,T).current||this.enable(),t(this,j).subscribe(s=>{t(this,m).damping=s.current}),t(this,B).subscribe(s=>{t(this,m).mass=s.current}),t(this,G).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,K).subscribe(s=>{s.previous&&c(this,h,nt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,T).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,D).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,A).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,p).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,M).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,H)))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,V)))}),t(this,k).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const x=t(this,m)[t(this,Z).current];e(this,H,x/t(this,b)||0),this.setVar(t(this,R).current,x.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),at.windowResizer.subscribe(t(this,st),ut.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,Q)),r=!0},ht=function(){t(this,S)&&(at.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,Q)),t(this,j).close(),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,T).close(),t(this,D).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,R).close(),t(this,O).close(),t(this,k).close(),t(this,z).close(),t(this,q).close(),t(this,l).close(),t(this,P).close(),t(this,w).close(),t(this,E).close(),t(this,L).close(),t(this,F).close(),this.disable())},dt=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,I,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},mt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},bt=function(){t(this,l).current=!0,t(this,w).current=!0,t(this,E).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},Ct=function(){t(this,l).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},yt=function(){t(this,P).current=!0,t(this,E).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},gt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},st=new WeakMap,Q=new WeakMap,W=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},vt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},Pt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},nt=function(){c(this,h,vt).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,A).current,t(this,p).current),c(this,h,Pt).call(this,t(this,R).current,t(this,O).current,t(this,k).current,t(this,z).current,t(this,q).current)},St);wt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",pt);exports.ScrollSegmentElement=pt;
|
|
1
|
+
"use strict";var St=a=>{throw TypeError(a)};var ct=(a,c,r)=>c.has(a)||St("Cannot "+r);var t=(a,c,r)=>(ct(a,c,"read from private field"),r?r.call(a):c.get(a)),i=(a,c,r)=>c.has(a)?St("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(a):c.set(a,r),s=(a,c,r,e)=>(ct(a,c,"write to private field"),e?e.call(a,r):c.set(a,r),r),o=(a,c,r)=>(ct(a,c,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Lt=require("../dom-JBOkFLTh.cjs"),Rt=require("../index-Cqw2NKev.cjs"),ft=require("../element-resizer/index.cjs"),nt=require("../window-resizer/index.cjs"),u=require("../css-property/index.cjs"),pt=require("../order/index.cjs"),Y=require("../events-KVanG9sR.cjs"),zt=require("../function-MthRj-GJ.cjs"),ot=require("../layout-Ctc2p3uz.cjs"),Ot=require("../math-GDWEqu7y.cjs"),tt=require("../Store-DRp_K37w.cjs"),qt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const xt=require("../Damped-BbJjFOLH.cjs");var V,ht,et,W;class ut{constructor(c){i(this,V,null);i(this,ht);i(this,et,!1);i(this,W,()=>{s(this,et,!(t(this,V).scrollWidth>t(this,V).clientWidth))});s(this,ht,c),s(this,V,Lt.findScrollParentElement(t(this,ht))),ft.elementResizer.subscribe(t(this,V),t(this,W)),nt.windowResizer.subscribe(t(this,W)),t(this,W).call(this)}get element(){return t(this,V)}get currentScrollValue(){return t(this,et)?t(this,V).scrollTop:t(this,V).scrollLeft}get vertical(){return t(this,et)}destroy(){ft.elementResizer.unsubscribe(t(this,W)),nt.windowResizer.unsubscribe(t(this,W))}onScroll(c){t(this,V).addEventListener("scroll",c)}offScroll(c){t(this,V).removeEventListener("scroll",c)}}V=new WeakMap,ht=new WeakMap,et=new WeakMap,W=new WeakMap;var l,j,B,G,K,k,T,_,M,d,g,y,v,A,p,z,O,J,q,x,D,f,P,w,L,R,F,st,n,$,N,rt,m,H,C,b,E,Q,I,S,h,bt,at,Ct,gt,yt,vt,Pt,wt,it,U,Z,Vt,Ft,lt,dt;let mt=(dt=class extends HTMLElement{constructor(){super(...arguments);i(this,h);i(this,l);i(this,j);i(this,B);i(this,G);i(this,K);i(this,k);i(this,T);i(this,_);i(this,M);i(this,d);i(this,g);i(this,y);i(this,v);i(this,A);i(this,p);i(this,z);i(this,O);i(this,J);i(this,q);i(this,x);i(this,D);i(this,f);i(this,P);i(this,w);i(this,L);i(this,R);i(this,F);i(this,st);i(this,n);i(this,$);i(this,N);i(this,rt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,E);i(this,Q);i(this,I);i(this,S);i(this,it);i(this,U);s(this,l,null),s(this,j,new u.CSSProperty(this,"--damping",20)),s(this,B,new u.CSSProperty(this,"--mass",0)),s(this,G,new u.CSSProperty(this,"--stiffness",0)),s(this,K,new u.CSSProperty(this,"--target","")),s(this,k,new u.CSSProperty(this,"--disabled",!1)),s(this,T,new u.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),s(this,_,new u.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),s(this,M,new u.CSSProperty(this,"--capture-once",!1)),s(this,d,new u.CSSProperty(this,"--captured","")),s(this,g,new u.CSSProperty(this,"--released","")),s(this,y,new u.CSSProperty(this,"--captured-from-start","")),s(this,v,new u.CSSProperty(this,"--captured-from-finish","")),s(this,A,new u.CSSProperty(this,"--released-from-start","")),s(this,p,new u.CSSProperty(this,"--released-from-finish","")),s(this,z,new u.CSSProperty(this,"--passed-var","")),s(this,O,new u.CSSProperty(this,"--progress-var","")),s(this,J,new u.CSSProperty(this,"--animation-var-type","current")),s(this,q,new u.CSSProperty(this,"--distance-var","")),s(this,x,new u.CSSProperty(this,"--start-var","")),s(this,D,new u.CSSProperty(this,"--finish-var","")),s(this,f,new tt.Store(!1)),s(this,P,new tt.Store(!1)),s(this,w,new tt.Store(!1)),s(this,L,new tt.Store(!1)),s(this,R,new tt.Store(!1)),s(this,F,new tt.Store(!1)),s(this,st,[]),s(this,n,this),s(this,$,0),s(this,N,0),s(this,rt,0),s(this,m,new xt.Damped(0,{order:pt.TICK_ORDER.SEGMENT,min:0,max:1})),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),s(this,I,!1),s(this,S,!0),this.findAnotherScrollEntries=zt.debounce(()=>{const r=qt.scrollEntries.getAll(this).reverse();let e=0;r.forEach((X,Et)=>{X.element===t(this,l)&&(e=Et)}),s(this,st,r.slice(e+1))},0),s(this,it,()=>{t(this,S)||(this.resize(),t(this,U).call(this))}),s(this,U,()=>{!t(this,S)&&t(this,Q)&&this.tick()})}get scrollContainer(){return t(this,l)}set scrollContainer(r){o(this,h,at).call(this),s(this,l,r),o(this,h,bt).call(this)}get distanceOffsetCSSProperty(){return t(this,T)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,g)}get capturedFromStartCSSProperty(){return t(this,y)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,z)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,J)}get distanceVarCSSProperty(){return t(this,q)}get startVarCSSProperty(){return t(this,x)}get finishVarCSSProperty(){return t(this,D)}get disabledCSSProperty(){return t(this,k)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,B)}get stiffnessCSSProperty(){return t(this,G)}get targetCSSProperty(){return t(this,K)}get isCaptured(){return t(this,f)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,L)}get isCapturedFromFinish(){return t(this,R)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,E)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,S)}resize(){s(this,N,t(this,l).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,l)instanceof HTMLElement?t(this,l):t(this,l).element;s(this,$,t(this,l).vertical?ot.getCumulativeOffsetTop(this,r):ot.getCumulativeOffsetLeft(this,r));const e=ot.getStickyOffset(this,t(this,l).vertical?"top":"left");s(this,$,t(this,$)-e),s(this,C,this.getStart()),s(this,b,this.getDistance()),s(this,C,t(this,C)+t(this,_).current),s(this,b,t(this,b)+t(this,T).current),s(this,E,t(this,C)+t(this,b)),t(this,l).currentScrollValue>t(this,E)&&!t(this,f).current&&!t(this,P).current&&(t(this,f).current=!0),this.setVar(t(this,x).current,t(this,C)),this.setVar(t(this,D).current,t(this,E)),this.setVar(t(this,q).current,t(this,b)),t(this,m).max=t(this,b),s(this,Q,!0)}tick(){let r=t(this,l).currentScrollValue;t(this,st).forEach(X=>{r+=X.value}),t(this,m).set(r-t(this,C));const e=Math.round(r);t(this,f).current&&(e>=t(this,C)?t(this,w).current||o(this,h,yt).call(this):t(this,w).current&&!t(this,L).current&&o(this,h,Pt).call(this),e<t(this,E)?t(this,F).current&&!t(this,R).current&&o(this,h,vt).call(this):t(this,w).current&&!t(this,F).current&&o(this,h,wt).call(this)),e>=t(this,C)&&e<t(this,E)?t(this,f).current||o(this,h,Ct).call(this):t(this,f).current&&(t(this,m).set(Ot.step(t(this,b)/2,t(this,m).target,0,t(this,b))),o(this,h,gt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),s(this,S,!0))}disable(){this.style.cssText="",s(this,$,0),s(this,N,0),t(this,m).reset(),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),t(this,f).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,L).current=!1,t(this,R).current=!1,t(this,F).current=!1,s(this,I,!1),s(this,S,!0),o(this,h,lt).call(this)}enable(){s(this,S,!1)}connectedCallback(){this.scrollContainer=new ut(this)}disconnectedCallback(){t(this,l)instanceof ut&&t(this,l).destroy(),o(this,h,at).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,e){r&&t(this,n).style.setProperty(`--${r}`,e.toString())}getDistance(){return t(this,N)+t(this,rt)}getStart(){return t(this,$)-t(this,rt)}},l=new WeakMap,j=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,k=new WeakMap,T=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,z=new WeakMap,O=new WeakMap,J=new WeakMap,q=new WeakMap,x=new WeakMap,D=new WeakMap,f=new WeakMap,P=new WeakMap,w=new WeakMap,L=new WeakMap,R=new WeakMap,F=new WeakMap,st=new WeakMap,n=new WeakMap,$=new WeakMap,N=new WeakMap,rt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,E=new WeakMap,Q=new WeakMap,I=new WeakMap,S=new WeakMap,h=new WeakSet,bt=function(){if(!t(this,l))return;t(this,f).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,R).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,L).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,k).observe(),t(this,T).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,g).observe(),t(this,y).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,z).observe(),t(this,O).observe(),t(this,J).observe(),t(this,q).observe(),t(this,x).observe(),t(this,D).observe();let r=!1;this.findAnotherScrollEntries(),t(this,k).current||this.enable(),t(this,j).subscribe(e=>{t(this,m).damping=e.current}),t(this,B).subscribe(e=>{t(this,m).mass=e.current}),t(this,G).subscribe(e=>{t(this,m).stiffness=e.current}),t(this,K).subscribe(e=>{e.previous&&o(this,h,lt).call(this),e.current?e.current==="parent"?s(this,n,this.parentElement||this):s(this,n,document.querySelector(e.current)||this):s(this,n,this)}),t(this,k).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,T).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,d).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,y).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,v).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,g).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,A).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,p).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,M).subscribe(e=>{t(this,S)||!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,z).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,this.passed.current))}),t(this,O).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,H)))}),t(this,x).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,C)))}),t(this,D).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,E)))}),t(this,q).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,b)))}),t(this,m).subscribe(e=>{const X=t(this,m)[t(this,J).current];s(this,H,X/t(this,b)||0),this.setVar(t(this,z).current,X.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),nt.windowResizer.subscribe(t(this,it),pt.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,U)),r=!0},at=function(){t(this,l)&&(nt.windowResizer.unsubscribe(t(this,it)),this.scrollContainer.offScroll(t(this,U)),t(this,j).close(),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,k).close(),t(this,T).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,g).close(),t(this,y).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,z).close(),t(this,O).close(),t(this,q).close(),t(this,x).close(),t(this,D).close(),t(this,f).close(),t(this,P).close(),t(this,w).close(),t(this,L).close(),t(this,R).close(),t(this,F).close(),this.disable())},Ct=function(){t(this,f).current=!0,t(this,P).current=!1,s(this,I,!0),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},gt=function(){t(this,P).current=!0,t(this,f).current=!1,s(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,g).current&&t(this,n).classList.add(t(this,g).current)},yt=function(){t(this,f).current=!0,t(this,w).current=!0,t(this,L).current=!1,t(this,y).current&&t(this,n).classList.add(t(this,y).current)},vt=function(){t(this,f).current=!0,t(this,R).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},Pt=function(){t(this,P).current=!0,t(this,L).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},wt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,R).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},it=new WeakMap,U=new WeakMap,Z=function(r){if(t(this,S)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,f).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Vt=function(...r){r.forEach(e=>{e&&t(this,n).classList.remove(e)})},Ft=function(...r){r.forEach(e=>{e&&t(this,n).style.removeProperty(`--${e}`)})},lt=function(){o(this,h,Vt).call(this,t(this,d).current,t(this,y).current,t(this,v).current,t(this,g).current,t(this,A).current,t(this,p).current),o(this,h,Ft).call(this,t(this,z).current,t(this,O).current,t(this,q).current,t(this,x).current,t(this,D).current)},dt);Rt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",mt);exports.ScrollSegmentDefaultContainer=ut;exports.ScrollSegmentElement=mt;
|
|
@@ -1,79 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Damped } from '../animation';
|
|
4
|
-
export interface ScrollSegmentEvents {
|
|
5
|
-
scrollSegmentCapture: CustomEvent;
|
|
6
|
-
scrollSegmentCaptureFromStart: CustomEvent;
|
|
7
|
-
scrollSegmentCaptureFromFinish: CustomEvent;
|
|
8
|
-
scrollSegmentRelease: CustomEvent;
|
|
9
|
-
scrollSegmentReleaseFromStart: CustomEvent;
|
|
10
|
-
scrollSegmentReleaseFromFinish: CustomEvent;
|
|
11
|
-
}
|
|
12
|
-
export interface ScrollSegmentContainer {
|
|
13
|
-
element: HTMLElement;
|
|
14
|
-
currentScrollValue: number;
|
|
15
|
-
vertical: boolean;
|
|
16
|
-
onScroll(callback: Function): void;
|
|
17
|
-
offScroll(callback: Function): void;
|
|
18
|
-
}
|
|
19
|
-
export interface ScrollSegmentContainerElement extends Omit<ScrollSegmentContainer, 'element'>, HTMLElement {
|
|
20
|
-
}
|
|
21
|
-
export declare class ScrollSegmentElement extends HTMLElement {
|
|
22
|
-
#private;
|
|
23
|
-
constructor();
|
|
24
|
-
get scrollContainer(): ScrollSegmentContainerElement | ScrollSegmentContainer;
|
|
25
|
-
set scrollContainer(value: ScrollSegmentContainerElement | ScrollSegmentContainer);
|
|
26
|
-
get distanceOffsetCSSProperty(): CSSProperty<number>;
|
|
27
|
-
get startOffsetCSSProperty(): CSSProperty<number>;
|
|
28
|
-
get captureOnceCSSProperty(): CSSProperty<boolean>;
|
|
29
|
-
get capturedCSSProperty(): CSSProperty<string>;
|
|
30
|
-
get releasedCSSProperty(): CSSProperty<string>;
|
|
31
|
-
get capturedFromStartCSSProperty(): CSSProperty<string>;
|
|
32
|
-
get capturedFromFinishCSSProperty(): CSSProperty<string>;
|
|
33
|
-
get releasedFromStartCSSProperty(): CSSProperty<string>;
|
|
34
|
-
get releasedFromFinishCSSProperty(): CSSProperty<string>;
|
|
35
|
-
get passedVarCSSProperty(): CSSProperty<string>;
|
|
36
|
-
get progressVarCSSProperty(): CSSProperty<string>;
|
|
37
|
-
get animationVarTypeCSSProperty(): CSSProperty<"target" | "current">;
|
|
38
|
-
get distanceVarCSSProperty(): CSSProperty<string>;
|
|
39
|
-
get startVarCSSProperty(): CSSProperty<string>;
|
|
40
|
-
get finishVarCSSProperty(): CSSProperty<string>;
|
|
41
|
-
get disabledCSSProperty(): CSSProperty<boolean>;
|
|
42
|
-
get dampingCSSProperty(): CSSProperty<number>;
|
|
43
|
-
get massCSSProperty(): CSSProperty<number>;
|
|
44
|
-
get stiffnessCSSProperty(): CSSProperty<number>;
|
|
45
|
-
get targetCSSProperty(): CSSProperty<string>;
|
|
46
|
-
get isCaptured(): Store<boolean>;
|
|
47
|
-
get isReleased(): Store<boolean>;
|
|
48
|
-
get isCapturedFromStart(): Store<boolean>;
|
|
49
|
-
get isReleasedFromStart(): Store<boolean>;
|
|
50
|
-
get isCapturedFromFinish(): Store<boolean>;
|
|
51
|
-
get isReleasedFromFinish(): Store<boolean>;
|
|
52
|
-
get directionPosition(): number;
|
|
53
|
-
get directionSize(): number;
|
|
54
|
-
get passed(): Damped;
|
|
55
|
-
get progress(): number;
|
|
56
|
-
get start(): number;
|
|
57
|
-
get finish(): number;
|
|
58
|
-
get distance(): number;
|
|
59
|
-
get isCapturedOnce(): boolean;
|
|
60
|
-
get isDisabled(): boolean;
|
|
61
|
-
resize(): void;
|
|
62
|
-
tick(): void;
|
|
63
|
-
disable(): void;
|
|
64
|
-
enable(): void;
|
|
65
|
-
protected connectedCallback(): void;
|
|
66
|
-
protected disconnectedCallback(): void;
|
|
67
|
-
protected removeVar(name: string | undefined): void;
|
|
68
|
-
protected setVar(name: string | undefined, value: string | number): void;
|
|
69
|
-
protected getDistance(): number;
|
|
70
|
-
protected getStart(): number;
|
|
71
|
-
protected findAnotherScrollEntries: () => void;
|
|
72
|
-
}
|
|
73
|
-
declare global {
|
|
74
|
-
interface HTMLElementTagNameMap {
|
|
75
|
-
'scroll-segment': ScrollSegmentElement;
|
|
76
|
-
}
|
|
77
|
-
interface HTMLElementEventMap extends ScrollSegmentEvents {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
export { ScrollSegmentDefaultContainer } from './ScrollSegmentDefaultContainer';
|
|
2
|
+
export { ScrollSegmentElement, type ScrollSegmentEvents, type ScrollSegmentContainer, type ScrollSegmentContainerElement, } from './ScrollSegmentElement';
|
|
@@ -1,26 +1,59 @@
|
|
|
1
|
-
var
|
|
1
|
+
var at = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (a,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
4
|
+
var ct = (a, c, r) => c.has(a) || at("Cannot " + r);
|
|
5
|
+
var t = (a, c, r) => (ct(a, c, "read from private field"), r ? r.call(a) : c.get(a)), i = (a, c, r) => c.has(a) ? at("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(a) : c.set(a, r), e = (a, c, r, s) => (ct(a, c, "write to private field"), s ? s.call(a, r) : c.set(a, r), r), o = (a, c, r) => (ct(a, c, "access private method"), r);
|
|
6
|
+
import { f as Ft } from "../dom-CVWzyXPH.js";
|
|
7
|
+
import { i as Lt } from "../index-euf5anj6.js";
|
|
8
|
+
import { elementResizer as lt } from "../element-resizer/index.js";
|
|
9
|
+
import { windowResizer as nt } from "../window-resizer/index.js";
|
|
10
|
+
import { CSSProperty as u } from "../css-property/index.js";
|
|
11
|
+
import { TICK_ORDER as wt, RESIZE_ORDER as Et } from "../order/index.js";
|
|
12
|
+
import { d as Y } from "../events-CsVF98U6.js";
|
|
13
|
+
import { d as Rt } from "../function-C10DGppn.js";
|
|
14
|
+
import { a as Ot, g as zt, c as kt } from "../layout-DpZo-I0y.js";
|
|
15
|
+
import { s as Dt } from "../math-BOBiC4TN.js";
|
|
16
|
+
import { S as tt } from "../Store-D2xCXENW.js";
|
|
17
|
+
import { scrollEntries as Tt } from "../scroll-entries/index.js";
|
|
16
18
|
import "../ticker/index.js";
|
|
17
|
-
import { D as
|
|
18
|
-
var
|
|
19
|
-
|
|
19
|
+
import { D as xt } from "../Damped-BMmEn7PH.js";
|
|
20
|
+
var F, ht, st, q;
|
|
21
|
+
class ft {
|
|
22
|
+
constructor(c) {
|
|
23
|
+
i(this, F, null);
|
|
24
|
+
i(this, ht);
|
|
25
|
+
i(this, st, !1);
|
|
26
|
+
i(this, q, () => {
|
|
27
|
+
e(this, st, !(t(this, F).scrollWidth > t(this, F).clientWidth));
|
|
28
|
+
});
|
|
29
|
+
e(this, ht, c), e(this, F, Ft(t(this, ht))), lt.subscribe(t(this, F), t(this, q)), nt.subscribe(t(this, q)), t(this, q).call(this);
|
|
30
|
+
}
|
|
31
|
+
get element() {
|
|
32
|
+
return t(this, F);
|
|
33
|
+
}
|
|
34
|
+
get currentScrollValue() {
|
|
35
|
+
return t(this, st) ? t(this, F).scrollTop : t(this, F).scrollLeft;
|
|
36
|
+
}
|
|
37
|
+
get vertical() {
|
|
38
|
+
return t(this, st);
|
|
39
|
+
}
|
|
40
|
+
destroy() {
|
|
41
|
+
lt.unsubscribe(t(this, q)), nt.unsubscribe(t(this, q));
|
|
42
|
+
}
|
|
43
|
+
onScroll(c) {
|
|
44
|
+
t(this, F).addEventListener("scroll", c);
|
|
45
|
+
}
|
|
46
|
+
offScroll(c) {
|
|
47
|
+
t(this, F).removeEventListener("scroll", c);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
F = new WeakMap(), ht = new WeakMap(), st = new WeakMap(), q = new WeakMap();
|
|
51
|
+
var l, B, G, K, N, x, M, A, $, S, C, v, y, H, p, O, z, J, k, D, T, m, P, V, E, R, L, et, n, I, Z, rt, d, W, g, b, w, Q, _, f, h, pt, ot, St, dt, bt, gt, Ct, vt, it, U, j, yt, Pt, ut, mt;
|
|
52
|
+
let Mt = (mt = class extends HTMLElement {
|
|
20
53
|
constructor() {
|
|
21
|
-
super();
|
|
54
|
+
super(...arguments);
|
|
22
55
|
i(this, h);
|
|
23
|
-
i(this,
|
|
56
|
+
i(this, l);
|
|
24
57
|
i(this, B);
|
|
25
58
|
i(this, G);
|
|
26
59
|
i(this, K);
|
|
@@ -35,81 +68,81 @@ let kt = (at = class extends HTMLElement {
|
|
|
35
68
|
i(this, y);
|
|
36
69
|
i(this, H);
|
|
37
70
|
i(this, p);
|
|
38
|
-
i(this, R);
|
|
39
|
-
i(this, k);
|
|
40
|
-
i(this, j);
|
|
41
71
|
i(this, O);
|
|
42
72
|
i(this, z);
|
|
73
|
+
i(this, J);
|
|
74
|
+
i(this, k);
|
|
43
75
|
i(this, D);
|
|
44
|
-
i(this,
|
|
76
|
+
i(this, T);
|
|
77
|
+
i(this, m);
|
|
45
78
|
i(this, P);
|
|
46
|
-
i(this, F);
|
|
47
|
-
i(this, L);
|
|
48
|
-
i(this, E);
|
|
49
79
|
i(this, V);
|
|
50
|
-
i(this,
|
|
80
|
+
i(this, E);
|
|
81
|
+
i(this, R);
|
|
82
|
+
i(this, L);
|
|
83
|
+
i(this, et);
|
|
51
84
|
i(this, n);
|
|
52
85
|
i(this, I);
|
|
53
|
-
i(this,
|
|
54
|
-
i(this,
|
|
86
|
+
i(this, Z);
|
|
87
|
+
i(this, rt);
|
|
55
88
|
i(this, d);
|
|
56
|
-
i(this,
|
|
89
|
+
i(this, W);
|
|
57
90
|
i(this, g);
|
|
58
91
|
i(this, b);
|
|
59
92
|
i(this, w);
|
|
60
|
-
i(this, J);
|
|
61
|
-
i(this, q);
|
|
62
|
-
i(this, u);
|
|
63
|
-
i(this, st);
|
|
64
93
|
i(this, Q);
|
|
65
|
-
|
|
94
|
+
i(this, _);
|
|
95
|
+
i(this, f);
|
|
96
|
+
i(this, it);
|
|
97
|
+
i(this, U);
|
|
98
|
+
e(this, l, null), e(this, B, new u(this, "--damping", 20)), e(this, G, new u(this, "--mass", 0)), e(this, K, new u(this, "--stiffness", 0)), e(this, N, new u(this, "--target", "")), e(this, x, new u(this, "--disabled", !1)), e(this, M, new u(
|
|
66
99
|
this,
|
|
67
100
|
"--distance-offset",
|
|
68
101
|
0,
|
|
69
102
|
{ rawValueCheck: !1 }
|
|
70
|
-
)), e(this, A, new
|
|
103
|
+
)), e(this, A, new u(this, "--start-offset", 0, {
|
|
71
104
|
rawValueCheck: !1
|
|
72
|
-
})), e(this, $, new
|
|
105
|
+
})), e(this, $, new u(
|
|
73
106
|
this,
|
|
74
107
|
"--capture-once",
|
|
75
108
|
!1
|
|
76
|
-
)), e(this, S, new
|
|
109
|
+
)), e(this, S, new u(this, "--captured", "")), e(this, C, new u(this, "--released", "")), e(this, v, new u(
|
|
77
110
|
this,
|
|
78
111
|
"--captured-from-start",
|
|
79
112
|
""
|
|
80
|
-
)), e(this, y, new
|
|
113
|
+
)), e(this, y, new u(
|
|
81
114
|
this,
|
|
82
115
|
"--captured-from-finish",
|
|
83
116
|
""
|
|
84
|
-
)), e(this, H, new
|
|
117
|
+
)), e(this, H, new u(
|
|
85
118
|
this,
|
|
86
119
|
"--released-from-start",
|
|
87
120
|
""
|
|
88
|
-
)), e(this, p, new
|
|
121
|
+
)), e(this, p, new u(
|
|
89
122
|
this,
|
|
90
123
|
"--released-from-finish",
|
|
91
124
|
""
|
|
92
|
-
)), e(this,
|
|
125
|
+
)), e(this, O, new u(this, "--passed-var", "")), e(this, z, new u(this, "--progress-var", "")), e(this, J, new u(
|
|
93
126
|
this,
|
|
94
127
|
"--animation-var-type",
|
|
95
128
|
"current"
|
|
96
|
-
)), e(this,
|
|
97
|
-
const r =
|
|
129
|
+
)), e(this, k, new u(this, "--distance-var", "")), e(this, D, new u(this, "--start-var", "")), e(this, T, new u(this, "--finish-var", "")), e(this, m, new tt(!1)), e(this, P, new tt(!1)), e(this, V, new tt(!1)), e(this, E, new tt(!1)), e(this, R, new tt(!1)), e(this, L, new tt(!1)), e(this, et, []), e(this, n, this), e(this, I, 0), e(this, Z, 0), e(this, rt, 0), e(this, d, new xt(0, { order: wt.SEGMENT, min: 0, max: 1 })), e(this, W, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, Q, !1), e(this, _, !1), e(this, f, !0), this.findAnotherScrollEntries = Rt(() => {
|
|
130
|
+
const r = Tt.getAll(this).reverse();
|
|
98
131
|
let s = 0;
|
|
99
|
-
r.forEach((
|
|
100
|
-
|
|
101
|
-
}), e(this,
|
|
102
|
-
}, 0), e(this,
|
|
103
|
-
t(this,
|
|
104
|
-
}), e(this,
|
|
105
|
-
!t(this,
|
|
132
|
+
r.forEach((X, Vt) => {
|
|
133
|
+
X.element === t(this, l) && (s = Vt);
|
|
134
|
+
}), e(this, et, r.slice(s + 1));
|
|
135
|
+
}, 0), e(this, it, () => {
|
|
136
|
+
t(this, f) || (this.resize(), t(this, U).call(this));
|
|
137
|
+
}), e(this, U, () => {
|
|
138
|
+
!t(this, f) && t(this, Q) && this.tick();
|
|
106
139
|
});
|
|
107
140
|
}
|
|
108
141
|
get scrollContainer() {
|
|
109
|
-
return t(this,
|
|
142
|
+
return t(this, l);
|
|
110
143
|
}
|
|
111
144
|
set scrollContainer(r) {
|
|
112
|
-
|
|
145
|
+
o(this, h, ot).call(this), e(this, l, r), o(this, h, pt).call(this);
|
|
113
146
|
}
|
|
114
147
|
get distanceOffsetCSSProperty() {
|
|
115
148
|
return t(this, M);
|
|
@@ -139,22 +172,22 @@ let kt = (at = class extends HTMLElement {
|
|
|
139
172
|
return t(this, p);
|
|
140
173
|
}
|
|
141
174
|
get passedVarCSSProperty() {
|
|
142
|
-
return t(this,
|
|
175
|
+
return t(this, O);
|
|
143
176
|
}
|
|
144
177
|
get progressVarCSSProperty() {
|
|
145
|
-
return t(this,
|
|
178
|
+
return t(this, z);
|
|
146
179
|
}
|
|
147
180
|
get animationVarTypeCSSProperty() {
|
|
148
|
-
return t(this,
|
|
181
|
+
return t(this, J);
|
|
149
182
|
}
|
|
150
183
|
get distanceVarCSSProperty() {
|
|
151
|
-
return t(this,
|
|
184
|
+
return t(this, k);
|
|
152
185
|
}
|
|
153
186
|
get startVarCSSProperty() {
|
|
154
|
-
return t(this,
|
|
187
|
+
return t(this, D);
|
|
155
188
|
}
|
|
156
189
|
get finishVarCSSProperty() {
|
|
157
|
-
return t(this,
|
|
190
|
+
return t(this, T);
|
|
158
191
|
}
|
|
159
192
|
get disabledCSSProperty() {
|
|
160
193
|
return t(this, x);
|
|
@@ -172,34 +205,34 @@ let kt = (at = class extends HTMLElement {
|
|
|
172
205
|
return t(this, N);
|
|
173
206
|
}
|
|
174
207
|
get isCaptured() {
|
|
175
|
-
return t(this,
|
|
208
|
+
return t(this, m);
|
|
176
209
|
}
|
|
177
210
|
get isReleased() {
|
|
178
211
|
return t(this, P);
|
|
179
212
|
}
|
|
180
213
|
get isCapturedFromStart() {
|
|
181
|
-
return t(this,
|
|
214
|
+
return t(this, V);
|
|
182
215
|
}
|
|
183
216
|
get isReleasedFromStart() {
|
|
184
|
-
return t(this,
|
|
217
|
+
return t(this, E);
|
|
185
218
|
}
|
|
186
219
|
get isCapturedFromFinish() {
|
|
187
|
-
return t(this,
|
|
220
|
+
return t(this, R);
|
|
188
221
|
}
|
|
189
222
|
get isReleasedFromFinish() {
|
|
190
|
-
return t(this,
|
|
223
|
+
return t(this, L);
|
|
191
224
|
}
|
|
192
225
|
get directionPosition() {
|
|
193
226
|
return t(this, I);
|
|
194
227
|
}
|
|
195
228
|
get directionSize() {
|
|
196
|
-
return t(this,
|
|
229
|
+
return t(this, Z);
|
|
197
230
|
}
|
|
198
231
|
get passed() {
|
|
199
232
|
return t(this, d);
|
|
200
233
|
}
|
|
201
234
|
get progress() {
|
|
202
|
-
return t(this,
|
|
235
|
+
return t(this, W);
|
|
203
236
|
}
|
|
204
237
|
get start() {
|
|
205
238
|
return t(this, g);
|
|
@@ -211,42 +244,42 @@ let kt = (at = class extends HTMLElement {
|
|
|
211
244
|
return t(this, b);
|
|
212
245
|
}
|
|
213
246
|
get isCapturedOnce() {
|
|
214
|
-
return t(this,
|
|
247
|
+
return t(this, _);
|
|
215
248
|
}
|
|
216
249
|
get isDisabled() {
|
|
217
|
-
return t(this,
|
|
250
|
+
return t(this, f);
|
|
218
251
|
}
|
|
219
252
|
resize() {
|
|
220
|
-
e(this,
|
|
221
|
-
const r = t(this,
|
|
222
|
-
e(this, I, t(this,
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
253
|
+
e(this, Z, t(this, l).vertical ? this.offsetHeight : this.offsetWidth);
|
|
254
|
+
const r = t(this, l) instanceof HTMLElement ? t(this, l) : t(this, l).element;
|
|
255
|
+
e(this, I, t(this, l).vertical ? Ot(this, r) : zt(this, r));
|
|
256
|
+
const s = kt(
|
|
257
|
+
this,
|
|
258
|
+
t(this, l).vertical ? "top" : "left"
|
|
226
259
|
);
|
|
227
|
-
e(this, I, t(this, I) -
|
|
260
|
+
e(this, I, t(this, I) - s), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, A).current), e(this, b, t(this, b) + t(this, M).current), e(this, w, t(this, g) + t(this, b)), t(this, l).currentScrollValue > t(this, w) && !t(this, m).current && !t(this, P).current && (t(this, m).current = !0), this.setVar(t(this, D).current, t(this, g)), this.setVar(t(this, T).current, t(this, w)), this.setVar(t(this, k).current, t(this, b)), t(this, d).max = t(this, b), e(this, Q, !0);
|
|
228
261
|
}
|
|
229
262
|
tick() {
|
|
230
|
-
let r = t(this,
|
|
231
|
-
t(this,
|
|
232
|
-
r +=
|
|
263
|
+
let r = t(this, l).currentScrollValue;
|
|
264
|
+
t(this, et).forEach((X) => {
|
|
265
|
+
r += X.value;
|
|
233
266
|
}), t(this, d).set(r - t(this, g));
|
|
234
267
|
const s = Math.round(r);
|
|
235
|
-
t(this,
|
|
236
|
-
|
|
237
|
-
),
|
|
268
|
+
t(this, m).current && (s >= t(this, g) ? t(this, V).current || o(this, h, bt).call(this) : t(this, V).current && !t(this, E).current && o(this, h, Ct).call(this), s < t(this, w) ? t(this, L).current && !t(this, R).current && o(this, h, gt).call(this) : t(this, V).current && !t(this, L).current && o(this, h, vt).call(this)), s >= t(this, g) && s < t(this, w) ? t(this, m).current || o(this, h, St).call(this) : t(this, m).current && (t(this, d).set(
|
|
269
|
+
Dt(t(this, b) / 2, t(this, d).target, 0, t(this, b))
|
|
270
|
+
), o(this, h, dt).call(this)), t(this, _) && t(this, $).current && (t(this, S).current && t(this, n).classList.add(t(this, S).current), e(this, f, !0));
|
|
238
271
|
}
|
|
239
272
|
disable() {
|
|
240
|
-
this.style.cssText = "", e(this, I, 0), e(this,
|
|
273
|
+
this.style.cssText = "", e(this, I, 0), e(this, Z, 0), t(this, d).reset(), e(this, W, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, Q, !1), t(this, m).current = !1, t(this, P).current = !1, t(this, V).current = !1, t(this, E).current = !1, t(this, R).current = !1, t(this, L).current = !1, e(this, _, !1), e(this, f, !0), o(this, h, ut).call(this);
|
|
241
274
|
}
|
|
242
275
|
enable() {
|
|
243
|
-
e(this,
|
|
276
|
+
e(this, f, !1);
|
|
244
277
|
}
|
|
245
278
|
connectedCallback() {
|
|
246
|
-
|
|
279
|
+
this.scrollContainer = new ft(this);
|
|
247
280
|
}
|
|
248
281
|
disconnectedCallback() {
|
|
249
|
-
|
|
282
|
+
t(this, l) instanceof ft && t(this, l).destroy(), o(this, h, ot).call(this);
|
|
250
283
|
}
|
|
251
284
|
removeVar(r) {
|
|
252
285
|
r && t(this, n).style.removeProperty(`--${r}`);
|
|
@@ -255,51 +288,45 @@ let kt = (at = class extends HTMLElement {
|
|
|
255
288
|
r && t(this, n).style.setProperty(`--${r}`, s.toString());
|
|
256
289
|
}
|
|
257
290
|
getDistance() {
|
|
258
|
-
return t(this,
|
|
291
|
+
return t(this, Z) + t(this, rt);
|
|
259
292
|
}
|
|
260
293
|
getStart() {
|
|
261
|
-
return t(this, I) - t(this,
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
let s = this.parentElement;
|
|
266
|
-
for (; s; )
|
|
267
|
-
window.getComputedStyle(s).position === "sticky" && r.push(s), s = s.parentElement;
|
|
268
|
-
return r;
|
|
269
|
-
}, it = function() {
|
|
270
|
-
if (!t(this, f))
|
|
294
|
+
return t(this, I) - t(this, rt);
|
|
295
|
+
}
|
|
296
|
+
}, l = new WeakMap(), B = new WeakMap(), G = new WeakMap(), K = new WeakMap(), N = new WeakMap(), x = new WeakMap(), M = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), S = new WeakMap(), C = new WeakMap(), v = new WeakMap(), y = new WeakMap(), H = new WeakMap(), p = new WeakMap(), O = new WeakMap(), z = new WeakMap(), J = new WeakMap(), k = new WeakMap(), D = new WeakMap(), T = new WeakMap(), m = new WeakMap(), P = new WeakMap(), V = new WeakMap(), E = new WeakMap(), R = new WeakMap(), L = new WeakMap(), et = new WeakMap(), n = new WeakMap(), I = new WeakMap(), Z = new WeakMap(), rt = new WeakMap(), d = new WeakMap(), W = new WeakMap(), g = new WeakMap(), b = new WeakMap(), w = new WeakMap(), Q = new WeakMap(), _ = new WeakMap(), f = new WeakMap(), h = new WeakSet(), pt = function() {
|
|
297
|
+
if (!t(this, l))
|
|
271
298
|
return;
|
|
272
|
-
t(this,
|
|
273
|
-
s.current &&
|
|
299
|
+
t(this, m).subscribe((s) => {
|
|
300
|
+
s.current && Y(this, "scrollSegmentCapture", {
|
|
274
301
|
composed: !0,
|
|
275
302
|
custom: !0
|
|
276
303
|
});
|
|
277
|
-
}), t(this,
|
|
278
|
-
s.current &&
|
|
304
|
+
}), t(this, V).subscribe((s) => {
|
|
305
|
+
s.current && Y(this, "scrollSegmentCaptureFromStart", {
|
|
279
306
|
composed: !0,
|
|
280
307
|
custom: !0
|
|
281
308
|
});
|
|
282
|
-
}), t(this,
|
|
283
|
-
s.current &&
|
|
309
|
+
}), t(this, R).subscribe((s) => {
|
|
310
|
+
s.current && Y(this, "scrollSegmentCaptureFromFinish", {
|
|
284
311
|
composed: !0,
|
|
285
312
|
custom: !0
|
|
286
313
|
});
|
|
287
314
|
}), t(this, P).subscribe((s) => {
|
|
288
|
-
s.current &&
|
|
315
|
+
s.current && Y(this, "scrollSegmentRelease", {
|
|
289
316
|
composed: !0,
|
|
290
317
|
custom: !0
|
|
291
318
|
});
|
|
292
|
-
}), t(this,
|
|
293
|
-
s.current &&
|
|
319
|
+
}), t(this, E).subscribe((s) => {
|
|
320
|
+
s.current && Y(this, "scrollSegmentReleaseFromStart", {
|
|
294
321
|
composed: !0,
|
|
295
322
|
custom: !0
|
|
296
323
|
});
|
|
297
|
-
}), t(this,
|
|
298
|
-
s.current &&
|
|
324
|
+
}), t(this, L).subscribe((s) => {
|
|
325
|
+
s.current && Y(this, "scrollSegmentReleaseFromFinish", {
|
|
299
326
|
composed: !0,
|
|
300
327
|
custom: !0
|
|
301
328
|
});
|
|
302
|
-
}), t(this, B).observe(), t(this, G).observe(), t(this, K).observe(), t(this, N).observe(), t(this, x).observe(), t(this, M).observe(), t(this, A).observe(), t(this, $).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, H).observe(), t(this, p).observe(), t(this,
|
|
329
|
+
}), t(this, B).observe(), t(this, G).observe(), t(this, K).observe(), t(this, N).observe(), t(this, x).observe(), t(this, M).observe(), t(this, A).observe(), t(this, $).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, H).observe(), t(this, p).observe(), t(this, O).observe(), t(this, z).observe(), t(this, J).observe(), t(this, k).observe(), t(this, D).observe(), t(this, T).observe();
|
|
303
330
|
let r = !1;
|
|
304
331
|
this.findAnotherScrollEntries(), t(this, x).current || this.enable(), t(this, B).subscribe((s) => {
|
|
305
332
|
t(this, d).damping = s.current;
|
|
@@ -308,92 +335,93 @@ let kt = (at = class extends HTMLElement {
|
|
|
308
335
|
}), t(this, K).subscribe((s) => {
|
|
309
336
|
t(this, d).stiffness = s.current;
|
|
310
337
|
}), t(this, N).subscribe((s) => {
|
|
311
|
-
s.previous &&
|
|
338
|
+
s.previous && o(this, h, ut).call(this), s.current ? s.current === "parent" ? e(this, n, this.parentElement || this) : e(this, n, document.querySelector(s.current) || this) : e(this, n, this);
|
|
312
339
|
}), t(this, x).subscribe((s) => {
|
|
313
340
|
s.current && !s.previous ? this.disable() : !s.current && s.previous && (this.resize(), this.enable());
|
|
314
341
|
}), t(this, A).subscribe(() => {
|
|
315
|
-
r && !t(this,
|
|
342
|
+
r && !t(this, f) && this.resize();
|
|
316
343
|
}), t(this, M).subscribe(() => {
|
|
317
|
-
r && !t(this,
|
|
344
|
+
r && !t(this, f) && this.resize();
|
|
318
345
|
}), t(this, S).subscribe((s) => {
|
|
319
|
-
|
|
346
|
+
o(this, h, j).call(this, s);
|
|
320
347
|
}), t(this, v).subscribe((s) => {
|
|
321
|
-
|
|
348
|
+
o(this, h, j).call(this, s);
|
|
322
349
|
}), t(this, y).subscribe((s) => {
|
|
323
|
-
|
|
350
|
+
o(this, h, j).call(this, s);
|
|
324
351
|
}), t(this, C).subscribe((s) => {
|
|
325
|
-
|
|
352
|
+
o(this, h, j).call(this, s);
|
|
326
353
|
}), t(this, H).subscribe((s) => {
|
|
327
|
-
|
|
354
|
+
o(this, h, j).call(this, s);
|
|
328
355
|
}), t(this, p).subscribe((s) => {
|
|
329
|
-
|
|
356
|
+
o(this, h, j).call(this, s);
|
|
330
357
|
}), t(this, $).subscribe((s) => {
|
|
331
|
-
t(this,
|
|
332
|
-
}), t(this,
|
|
333
|
-
t(this,
|
|
334
|
-
}), t(this, k).subscribe((s) => {
|
|
335
|
-
t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, t(this, _)));
|
|
358
|
+
t(this, f) || !s.current && s.previous && (this.resize(), this.enable());
|
|
359
|
+
}), t(this, O).subscribe((s) => {
|
|
360
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, this.passed.current));
|
|
336
361
|
}), t(this, z).subscribe((s) => {
|
|
337
|
-
t(this,
|
|
362
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, W)));
|
|
338
363
|
}), t(this, D).subscribe((s) => {
|
|
339
|
-
t(this,
|
|
340
|
-
}), t(this,
|
|
341
|
-
t(this,
|
|
364
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
|
|
365
|
+
}), t(this, T).subscribe((s) => {
|
|
366
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, w)));
|
|
367
|
+
}), t(this, k).subscribe((s) => {
|
|
368
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, b)));
|
|
342
369
|
}), t(this, d).subscribe((s) => {
|
|
343
|
-
const
|
|
344
|
-
e(this,
|
|
345
|
-
t(this,
|
|
346
|
-
t(this,
|
|
370
|
+
const X = t(this, d)[t(this, J).current];
|
|
371
|
+
e(this, W, X / t(this, b) || 0), this.setVar(t(this, O).current, X.toFixed(6)), this.setVar(
|
|
372
|
+
t(this, z).current,
|
|
373
|
+
t(this, W).toFixed(6)
|
|
347
374
|
);
|
|
348
|
-
}),
|
|
349
|
-
},
|
|
350
|
-
t(this,
|
|
351
|
-
},
|
|
352
|
-
t(this,
|
|
375
|
+
}), nt.subscribe(t(this, it), Et.SCROLL), this.scrollContainer.onScroll(t(this, U)), r = !0;
|
|
376
|
+
}, ot = function() {
|
|
377
|
+
t(this, l) && (nt.unsubscribe(t(this, it)), this.scrollContainer.offScroll(t(this, U)), t(this, B).close(), t(this, G).close(), t(this, K).close(), t(this, N).close(), t(this, x).close(), t(this, M).close(), t(this, A).close(), t(this, $).close(), t(this, S).close(), t(this, C).close(), t(this, v).close(), t(this, y).close(), t(this, H).close(), t(this, p).close(), t(this, O).close(), t(this, z).close(), t(this, k).close(), t(this, D).close(), t(this, T).close(), t(this, m).close(), t(this, P).close(), t(this, V).close(), t(this, E).close(), t(this, R).close(), t(this, L).close(), this.disable());
|
|
378
|
+
}, St = function() {
|
|
379
|
+
t(this, m).current = !0, t(this, P).current = !1, e(this, _, !0), t(this, C).current && t(this, n).classList.remove(t(this, C).current), t(this, p).current && t(this, n).classList.remove(
|
|
353
380
|
t(this, p).current
|
|
354
381
|
), t(this, p).current && t(this, n).classList.remove(
|
|
355
382
|
t(this, p).current
|
|
356
383
|
), t(this, S).current && t(this, n).classList.add(t(this, S).current);
|
|
357
|
-
},
|
|
358
|
-
t(this, P).current = !0, t(this,
|
|
384
|
+
}, dt = function() {
|
|
385
|
+
t(this, P).current = !0, t(this, m).current = !1, e(this, _, !0), t(this, S).current && t(this, n).classList.remove(t(this, S).current), t(this, v).current && t(this, n).classList.remove(
|
|
359
386
|
t(this, v).current
|
|
360
387
|
), t(this, y).current && t(this, n).classList.remove(
|
|
361
388
|
t(this, y).current
|
|
362
389
|
), t(this, C).current && t(this, n).classList.add(t(this, C).current);
|
|
363
|
-
},
|
|
364
|
-
t(this,
|
|
390
|
+
}, bt = function() {
|
|
391
|
+
t(this, m).current = !0, t(this, V).current = !0, t(this, E).current = !1, t(this, v).current && t(this, n).classList.add(
|
|
365
392
|
t(this, v).current
|
|
366
393
|
);
|
|
367
|
-
},
|
|
368
|
-
t(this,
|
|
394
|
+
}, gt = function() {
|
|
395
|
+
t(this, m).current = !0, t(this, R).current = !0, t(this, L).current = !1, t(this, y).current && t(this, n).classList.add(
|
|
369
396
|
t(this, y).current
|
|
370
397
|
);
|
|
371
|
-
},
|
|
372
|
-
t(this, P).current = !0, t(this,
|
|
398
|
+
}, Ct = function() {
|
|
399
|
+
t(this, P).current = !0, t(this, E).current = !0, t(this, V).current = !1, t(this, p).current && t(this, n).classList.add(
|
|
373
400
|
t(this, p).current
|
|
374
401
|
);
|
|
375
|
-
},
|
|
376
|
-
t(this, P).current = !0, t(this,
|
|
402
|
+
}, vt = function() {
|
|
403
|
+
t(this, P).current = !0, t(this, L).current = !0, t(this, R).current = !1, t(this, p).current && t(this, n).classList.add(
|
|
377
404
|
t(this, p).current
|
|
378
405
|
);
|
|
379
|
-
},
|
|
380
|
-
if (t(this,
|
|
406
|
+
}, it = new WeakMap(), U = new WeakMap(), j = function(r) {
|
|
407
|
+
if (t(this, f)) {
|
|
381
408
|
r.previous && t(this, n).classList.remove(r.previous), r.current && t(this, n).classList.remove(r.current);
|
|
382
409
|
return;
|
|
383
410
|
}
|
|
384
|
-
r.current && t(this,
|
|
385
|
-
},
|
|
411
|
+
r.current && t(this, m).current ? (r.previous && t(this, n).classList.remove(r.previous), t(this, n).classList.add(r.current)) : !r.current && r.previous && t(this, n).classList.remove(r.previous);
|
|
412
|
+
}, yt = function(...r) {
|
|
386
413
|
r.forEach((s) => {
|
|
387
414
|
s && t(this, n).classList.remove(s);
|
|
388
415
|
});
|
|
389
|
-
},
|
|
416
|
+
}, Pt = function(...r) {
|
|
390
417
|
r.forEach((s) => {
|
|
391
418
|
s && t(this, n).style.removeProperty(`--${s}`);
|
|
392
419
|
});
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
|
|
420
|
+
}, ut = function() {
|
|
421
|
+
o(this, h, yt).call(this, t(this, S).current, t(this, v).current, t(this, y).current, t(this, C).current, t(this, H).current, t(this, p).current), o(this, h, Pt).call(this, t(this, O).current, t(this, z).current, t(this, k).current, t(this, D).current, t(this, T).current);
|
|
422
|
+
}, mt);
|
|
423
|
+
Lt && !customElements.get("scroll-segment") && customElements.define("scroll-segment", Mt);
|
|
397
424
|
export {
|
|
398
|
-
|
|
425
|
+
ft as ScrollSegmentDefaultContainer,
|
|
426
|
+
Mt as ScrollSegmentElement
|
|
399
427
|
};
|