aptechka 0.33.7 → 0.34.0
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/Tweened-DJzAFsVZ.js +44 -0
- package/lib/Tweened-lT5myPAZ.cjs +1 -0
- package/lib/animation/Tweened.d.ts +2 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +106 -105
- package/lib/scroll/vanilla/ScrollButtonElement.d.ts +3 -0
- package/lib/scroll/vanilla/ScrollElement.d.ts +7 -2
- package/lib/scroll/vanilla/ScrollSetButtonElement.d.ts +3 -0
- package/lib/scroll/vanilla/ScrollStepButtonElement.d.ts +3 -0
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.js +457 -407
- package/package.json +1 -1
- package/lib/Tweened-B_ZFQKGQ.js +0 -44
- package/lib/Tweened-C0-UzxN-.cjs +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var O = Object.defineProperty, b = Object.defineProperties;
|
|
2
|
+
var x = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var l = Object.getOwnPropertySymbols;
|
|
4
|
+
var y = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (a) => {
|
|
6
|
+
throw TypeError(a);
|
|
7
|
+
};
|
|
8
|
+
var c = (a, r, e) => r in a ? O(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e, d = (a, r) => {
|
|
9
|
+
for (var e in r || (r = {}))
|
|
10
|
+
y.call(r, e) && c(a, e, r[e]);
|
|
11
|
+
if (l)
|
|
12
|
+
for (var e of l(r))
|
|
13
|
+
S.call(r, e) && c(a, e, r[e]);
|
|
14
|
+
return a;
|
|
15
|
+
}, g = (a, r) => b(a, x(r));
|
|
16
|
+
var A = (a, r, e) => r.has(a) || f("Cannot " + e);
|
|
17
|
+
var m = (a, r, e) => (A(a, r, "read from private field"), e ? e.call(a) : r.get(a)), n = (a, r, e) => r.has(a) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, e), u = (a, r, e, i) => (A(a, r, "write to private field"), i ? i.call(a, e) : r.set(a, e), e);
|
|
18
|
+
import { l as h, e as T } from "./easings-BEmRlrDd.js";
|
|
19
|
+
import { c as q } from "./math-BOBiC4TN.js";
|
|
20
|
+
import { n as w, p as z } from "./polyfills-X6KXuHg-.js";
|
|
21
|
+
import { A as C } from "./Animation-DN95L7Xo.js";
|
|
22
|
+
var s, t;
|
|
23
|
+
class B extends C {
|
|
24
|
+
constructor(e, i) {
|
|
25
|
+
super(e || 0, i);
|
|
26
|
+
n(this, s, h);
|
|
27
|
+
n(this, t, 1e3);
|
|
28
|
+
this.updateOptions(g(d({}, i), { equalize: !0 }));
|
|
29
|
+
}
|
|
30
|
+
updateOptions(e) {
|
|
31
|
+
super.updateOptions(e), u(this, s, typeof (e == null ? void 0 : e.easing) == "function" ? e.easing : typeof (e == null ? void 0 : e.easing) == "string" ? T[e.easing] || h : h), u(this, t, (e == null ? void 0 : e.duration) === !1 ? 0 : w(e == null ? void 0 : e.duration, m(this, t)));
|
|
32
|
+
}
|
|
33
|
+
handleAnimationFrame(e) {
|
|
34
|
+
const i = e.timeElapsedSinceSubscription / 1e3 / (m(this, t) / 1e3) || 0, F = m(this, s).call(this, q(i, 0, 1));
|
|
35
|
+
this.current = z(this.from + (this.target - this.from) * F, 6), i > 1 && this.unlistenAnimationFrame();
|
|
36
|
+
}
|
|
37
|
+
start() {
|
|
38
|
+
this.unlistenAnimationFrame(), this.listenAnimationFrame();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
s = new WeakMap(), t = new WeakMap();
|
|
42
|
+
export {
|
|
43
|
+
B as T
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty,O=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,a,e)=>a in i?y(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e,g=(i,a)=>{for(var e in a||(a={}))w.call(a,e)&&m(i,e,a[e]);if(h)for(var e of h(a))S.call(a,e)&&m(i,e,a[e]);return i},f=(i,a)=>O(i,b(a));var A=(i,a,e)=>a.has(i)||d("Cannot "+e);var s=(i,a,e)=>(A(i,a,"read from private field"),e?e.call(i):a.get(i)),l=(i,a,e)=>a.has(i)?d("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,e),c=(i,a,e,r)=>(A(i,a,"write to private field"),r?r.call(i,e):a.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-CM4SCDTt.cjs"),x=require("./Animation-B9m8bw96.cjs");var n,t;class z extends x.Animation{constructor(e,r){super(e||0,r);l(this,n,u.linear);l(this,t,1e3);this.updateOptions(f(g({},r),{equalize:!0}))}updateOptions(e){super.updateOptions(e),c(this,n,typeof(e==null?void 0:e.easing)=="function"?e.easing:typeof(e==null?void 0:e.easing)=="string"&&u.easings[e.easing]||u.linear),c(this,t,(e==null?void 0:e.duration)===!1?0:q.nullishCoalescing(e==null?void 0:e.duration,s(this,t)))}handleAnimationFrame(e){const r=e.timeElapsedSinceSubscription/1e3/(s(this,t)/1e3)||0,F=s(this,n).call(this,T.clamp(r,0,1));this.current=q.preciseNumber(this.from+(this.target-this.from)*F,6),r>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,t=new WeakMap;exports.Tweened=z;
|
|
@@ -5,8 +5,8 @@ import { Animation, AnimationConstructorOptions, AnimationOptions } from './Anim
|
|
|
5
5
|
import * as easings from '@packages/utils/easings';
|
|
6
6
|
export type TweenEasingName = keyof typeof easings;
|
|
7
7
|
export interface TweenedOptions extends AnimationOptions {
|
|
8
|
-
easing?: EasingFunction | TweenEasingName;
|
|
9
|
-
duration?: number;
|
|
8
|
+
easing?: EasingFunction | TweenEasingName | false;
|
|
9
|
+
duration?: number | false;
|
|
10
10
|
}
|
|
11
11
|
export declare class Tweened extends Animation<TweenedOptions> {
|
|
12
12
|
#private;
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-B9m8bw96.cjs"),n=require("../Damped-CTsV8tl_.cjs"),i=require("../Tweened-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-B9m8bw96.cjs"),n=require("../Damped-CTsV8tl_.cjs"),i=require("../Tweened-lT5myPAZ.cjs");exports.Animation=e.Animation;exports.Damped=n.Damped;exports.Tweened=i.Tweened;
|
package/lib/animation/index.js
CHANGED
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/vanilla/index.cjs");require("../Store-CDb6RMce.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-
|
|
1
|
+
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/vanilla/index.cjs");require("../Store-CDb6RMce.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-lT5myPAZ.cjs"),_=require("../gestures-DHLrn6Q8.cjs"),$=require("../polyfills-CM4SCDTt.cjs"),p=require("../order/index.cjs");var N;class Y{constructor(){s(this,N,new G.Notifier)}get changeEvent(){return t(this,N)}}N=new WeakMap;var b,c,u,H;class ee extends Y{constructor(e){super();s(this,b,null);s(this,c,null);s(this,u,"offsetHeight");s(this,H,e=>{const r=e.shiftKey?-1:1;let a;e.code==="Space"?a=r*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?a=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?a=1*t(this,c)[t(this,u)]*.2:e.code==="PageUp"?a=-1*t(this,c)[t(this,u)]:e.code==="PageDown"?a=1*t(this,c)[t(this,u)]:e.code==="Home"?a=0:e.code==="End"&&(a=t(this,u)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),a&&(e.stopPropagation(),this.changeEvent.notify("keyboard",a))});m.isBrowser&&(i(this,b,e!=null&&e.element&&Q.getElement(e.element)||window),i(this,c,t(this,b)instanceof HTMLElement?t(this,b):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){m.isBrowser&&t(this,b).addEventListener("keydown",t(this,H))}disconnect(){m.isBrowser&&t(this,b).removeEventListener("keydown",t(this,H))}}b=new WeakMap,c=new WeakMap,u=new WeakMap,H=new WeakMap;var g,x,P,z,d,T,f,w,K,U,C,W,B;class te extends Y{constructor(e){super();s(this,w);s(this,g);s(this,x);s(this,P);s(this,z);s(this,d);s(this,T);s(this,f);s(this,C);s(this,W);s(this,B);this.direction=1,i(this,d,new Z.Tweened(0,{easing:J.easeInQuad})),i(this,f,!1),i(this,C,r=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",r.timeBetweenFrames*t(this,g)*this.direction*(1-t(this,d).current))}),i(this,W,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,g))*this.direction*(1-t(this,d).current))}),i(this,B,()=>{t(this,x)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,g,(e==null?void 0:e.speed)||1),i(this,x,(e==null?void 0:e.interval)||!1),i(this,P,e)}set interval(e){i(this,x,e),t(this,f)&&k(this,w,K).call(this)}set speed(e){i(this,g,e),t(this,f)&&k(this,w,K).call(this)}connect(){t(this,f)||(i(this,f,!0),k(this,w,K).call(this))}disconnect(){t(this,f)&&(i(this,f,!1),k(this,w,U).call(this))}pauseAndContinue(e,r){t(this,f)&&e&&(clearTimeout(t(this,T)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:r}),i(this,T,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:r})},e)))}}g=new WeakMap,x=new WeakMap,P=new WeakMap,z=new WeakMap,d=new WeakMap,T=new WeakMap,f=new WeakMap,w=new WeakSet,K=function(){k(this,w,U).call(this),t(this,x)?i(this,z,setInterval(t(this,W),Math.abs(t(this,g)))):q.ticker.subscribe(t(this,C),t(this,P)),document.addEventListener("visibilitychange",t(this,B))},U=function(){clearInterval(t(this,z)),q.ticker.unsubscribe(t(this,C)),clearTimeout(t(this,T)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,B))},C=new WeakMap,W=new WeakMap,B=new WeakMap;var A,v,D,X;class ie extends Y{constructor(e){super();s(this,A,null);s(this,v);s(this,D);s(this,X,e=>{let r=0;if(!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*1||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*1))if(e.preventDefault(),r=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const a=Date.now();if(a-t(this,D)>40&&(r=100*Math.sign(r)),i(this,D,a),Math.abs(r)<100||t(this,v))return;this.changeEvent.notify("wheel",r),i(this,v,setTimeout(()=>{i(this,v,void 0)},80))}else this.changeEvent.notify("wheel",r)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,D,Date.now()),m.isBrowser&&i(this,A,e!=null&&e.element&&Q.getElement(e.element)||window)}connect(){m.isBrowser&&t(this,A).addEventListener("wheel",t(this,X),{passive:!1})}disconnect(){m.isBrowser&&(t(this,A).removeEventListener("wheel",t(this,X)),clearTimeout(t(this,v)))}}A=new WeakMap,v=new WeakMap,D=new WeakMap,X=new WeakMap;var M,o,l,I,y;const E=class E extends Y{constructor(e){super();s(this,o);s(this,l);s(this,I);s(this,y);this.inertion=1,i(this,o,null),i(this,l,0),i(this,I,r=>{if(r.composedPath().find(L=>L instanceof HTMLElement&&L.hasAttribute("drag-dead-zone")))return;this.swipe||q.ticker.unsubscribe(t(this,y));let a=r,O=!1;i(this,l,0),document.documentElement.classList.add("grabbing"),_.setupDrag(L=>{if(t(E,M)&&t(E,M)!==t(this,o))return;const R=a.x-L.x,S=a.y-L.y;this.axis==="x"?i(this,l,R):i(this,l,S),a=L,O=this.axis==="x"&&Math.abs(R)>Math.abs(S)||this.axis==="y"&&Math.abs(S)>Math.abs(R),O&&(i(E,M,t(this,o)),this.changeEvent.notify("drag",t(this,l)))},()=>{i(E,M,null),O&&(!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),q.ticker.subscribe(t(this,y),{order:p.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l))),document.documentElement.classList.remove("grabbing")})}),i(this,y,()=>{Math.floor(Math.abs(t(this,l)))||q.ticker.unsubscribe(t(this,y)),i(this,l,t(this,l)*.95),i(this,l,$.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l))}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,m.isBrowser&&i(this,o,e!=null&&e.element&&Q.getElement(e.element)||document.documentElement)}connect(){m.isBrowser&&t(this,o).addEventListener("pointerdown",t(this,I))}disconnect(){m.isBrowser&&(t(this,o).removeEventListener("pointerdown",t(this,I)),q.ticker.unsubscribe(t(this,y)))}};M=new WeakMap,o=new WeakMap,l=new WeakMap,I=new WeakMap,y=new WeakMap,s(E,M,null);let j=E;exports.AutoplayControls=te;exports.Controls=Y;exports.DragControls=j;exports.KeyboardControls=ee;exports.WheelControls=ie;
|
package/lib/controls/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { g as Q } from "../dom-0S_WDL4g.js";
|
|
|
9
9
|
import { ticker as k } from "../ticker/vanilla/index.js";
|
|
10
10
|
import "../Store-OTdcl6SX.js";
|
|
11
11
|
import { a as J } from "../easings-BEmRlrDd.js";
|
|
12
|
-
import { T as Z } from "../Tweened-
|
|
12
|
+
import { T as Z } from "../Tweened-DJzAFsVZ.js";
|
|
13
13
|
import { s as $ } from "../gestures-D2Fdra_G.js";
|
|
14
14
|
import { p } from "../polyfills-X6KXuHg-.js";
|
|
15
15
|
import { TICK_ORDER as _ } from "../order/index.js";
|
|
@@ -130,7 +130,7 @@ class me extends K {
|
|
|
130
130
|
s(this, H);
|
|
131
131
|
s(this, N, (e) => {
|
|
132
132
|
let a = 0;
|
|
133
|
-
if (!(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) *
|
|
133
|
+
if (!(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) * 1 || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY) * 1))
|
|
134
134
|
if (e.preventDefault(), a = (this.axis === "max" ? Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
|
|
135
135
|
const r = Date.now();
|
|
136
136
|
if (r - t(this, H) > 40 && (a = 100 * Math.sign(a)), i(this, H, r), Math.abs(a) < 100 || t(this, v))
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var W=n=>{throw TypeError(n)};var B=(n,h,t)=>h.has(n)||W("Cannot "+t);var e=(n,h,t)=>(B(n,h,"read from private field"),t?t.call(n):h.get(n)),s=(n,h,t)=>h.has(n)?W("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(n):h.set(n,t),i=(n,h,t,c)=>(B(n,h,"write to private field"),c?c.call(n,t):h.set(n,t),t),_=(n,h,t)=>(B(n,h,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../css-property/index.cjs"),K=require("../Store-CDb6RMce.cjs"),$=require("../events-KVanG9sR.cjs"),Q=require("../function-MthRj-GJ.cjs"),V=require("../style-At6aDoqG.cjs"),F=require("../window-resizer/vanilla/index.cjs"),X=require("../browser-CpzFX2xg.cjs");var A,l,x,b,d,v,p,g,m,f,L,u,G,E,N,w,j,T,C,q,P;const a=class a extends HTMLElement{constructor(){super(...arguments);s(this,u);s(this,A);s(this,l);s(this,x);s(this,b);s(this,d);s(this,v);s(this,p);s(this,g);s(this,m);s(this,f);s(this,L);s(this,E);s(this,w);s(this,T);s(this,C);s(this,q);s(this,P);i(this,A,-1),i(this,l,new K.Store(!1)),i(this,d,new k.CSSProperty(this,"--history",!1)),i(this,v,new k.CSSProperty(this,"--restore",!1)),i(this,p,new k.CSSProperty(this,"--dominance",0)),i(this,g,new k.CSSProperty(this,"--click-outside",!1)),i(this,m,new k.CSSProperty(this,"--escape",!1)),i(this,f,!1),this.open=t=>{if(e(this,l).current)return;i(this,L,t==null?void 0:t.trigger),e(this,l).current=!0,e(this,p).current&&(a.__opened=a.__opened.filter(o=>o!==this&&this.dominance.current>=o.dominance.current?(o.close(),!1):!0)),a.__opened.push(this),i(this,A,a.__opened.length-1),e(this,d).current&&e(this,f)&&history.pushState("","",e(this,u,G)),clearTimeout(e(this,x)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",$.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,L)}});const c=()=>{addEventListener("click",e(this,E)),addEventListener("keydown",e(this,w)),e(this,P).call(this),this.style.opacity="1",this.classList.add("opened"),$.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,L)}}),i(this,b,void 0)};t!=null&&t.skipTransition?c():i(this,b,setTimeout(c,10))},this.close=()=>{e(this,l).current&&(removeEventListener("click",e(this,E)),removeEventListener("keydown",e(this,w)),e(this,l).current=!1,a.__opened=a.__opened.filter(t=>t===this?!1:e(t,p).current<this.dominance.current&&!e(t,b)?(t.close(),!1):!0),_(this,u,N).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.style.opacity="0",$.dispatchEvent(this,"popoverClosing",{custom:!0}),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",$.dispatchEvent(this,"popoverClosed",{custom:!0})},V.getElementTransitionDurationMS(this)+10))},i(this,E,t=>{e(this,g).current&&_(this,u,j).call(this,()=>{var D;const c=t.composedPath();if(c.find(U=>U instanceof HTMLElement&&U.hasAttribute("data-popover-content")))return;const o=c[0],z=o instanceof HTMLElement&&(this.contains(o)||((D=this.shadowRoot)==null?void 0:D.contains(o))),S=o instanceof HTMLElement&&o.hasAttribute("data-outside");(!z||S)&&this.close()})}),i(this,w,t=>{e(this,m).current&&_(this,u,j).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,T,()=>{i(this,f,!1),e(this,l).current&&e(this,d).current&&!location.search.includes(this.id)?this.close():!e(this,l).current&&e(this,d).current&&location.search.includes(this.id)&&this.open(),i(this,f,!0)}),i(this,C,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,q).call(this)}),i(this,q,Q.debounce(()=>{e(this,P).call(this)},10)),i(this,P,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,d)}get restore(){return e(this,v)}get dominance(){return e(this,p)}get clickOutside(){return e(this,g)}get escape(){return e(this,m)}get opened(){return e(this,l)}get lastTrigger(){return e(this,L)}connectedCallback(){e(this,d).observe(),e(this,v).observe(),e(this,p).observe(),e(this,g).observe(),e(this,m).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("popover-target",""),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,T)),setTimeout(()=>{e(this,v).current?e(this,T).call(this):(_(this,u,N).call(this),i(this,f,!0))},0),F.windowResizer.subscribe(e(this,C))}disconnectedCallback(){F.windowResizer.unsubscribe(e(this,C)),e(this,d).unobserve(),e(this,v).unobserve(),e(this,p).unobserve(),e(this,g).unobserve(),e(this,m).unobserve(),this.style.opacity="",this.style.display="",this.removeAttribute("popover-target"),a.__opened=a.__opened.filter(t=>t!==this),clearTimeout(e(this,x)),clearTimeout(e(this,b)),removeEventListener("popstate",e(this,T)),removeEventListener("click",e(this,E)),removeEventListener("keydown",e(this,w)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height")}};A=new WeakMap,l=new WeakMap,x=new WeakMap,b=new WeakMap,d=new WeakMap,v=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,f=new WeakMap,L=new WeakMap,u=new WeakSet,G=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.id}`},E=new WeakMap,N=function(){if(e(this,d).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(null,"",t.href)}},w=new WeakMap,j=function(t){(a.__opened[e(this,A)-1]||a.__opened.length===1||a.__opened.filter(c=>c!==this).every(c=>e(this,p).current>c.dominance.current))&&t()},T=new WeakMap,C=new WeakMap,q=new WeakMap,P=new WeakMap,a.__opened=[];let I=a;customElements.get("e-popover")||customElements.define("e-popover",I);var r,y,M,O,R,H;class J extends HTMLElement{constructor(){super();s(this,r);s(this,y,new k.CSSProperty(this,"--type","open"));s(this,M,()=>{this.classList.add("triggered")});s(this,O,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});s(this,R,()=>{this.classList.remove("opened")});s(this,H,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});X.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=e(this,y).current;t==="open"||t==="toggle"&&!e(this,r).opened.current?e(this,r).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,r).opened.current)&&e(this,r).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,y)}get popoverElement(){return e(this,r)}connectedCallback(){var c;e(this,y).subscribe(o=>{e(this,r)&&(o.current!=="close"?(this.setAttribute("aria-has-popup","true"),this.setAttribute("aria-expanded",e(this,r).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,r).id||"")):(this.removeAttribute("aria-has-popup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let o=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)o=z;else{const S=this.getRootNode();S instanceof ShadowRoot?o=S.host.closest("[popover-target]"):S instanceof HTMLElement&&(o=S.closest("[popover-target]"))}}else t==="sibling"?o=(c=this.parentElement)==null?void 0:c.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(i(this,r,o),e(this,r).addEventListener("popoverTriggered",e(this,M)),e(this,r).addEventListener("popoverOpened",e(this,O)),e(this,r).addEventListener("popoverClosing",e(this,R)),e(this,r).addEventListener("popoverClosed",e(this,H))):console.warn(this,`target ${t} not found`)}e(this,y).observe()}disconnectedCallback(){e(this,y).unobserve(),this.removeAttribute("aria-has-popup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,M)),e(this,r).removeEventListener("popoverOpened",e(this,O)),e(this,r).removeEventListener("popoverClosing",e(this,R)),e(this,r).removeEventListener("popoverClosed",e(this,H)))}}r=new WeakMap,y=new WeakMap,M=new WeakMap,O=new WeakMap,R=new WeakMap,H=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",J);exports.PopoverButtonElement=J;exports.PopoverElement=I;
|
package/lib/popover/index.js
CHANGED
|
@@ -1,84 +1,85 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var j = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (
|
|
6
|
-
import { CSSProperty as
|
|
7
|
-
import { S as
|
|
4
|
+
var q = (n, h, t) => h.has(n) || j("Cannot " + t);
|
|
5
|
+
var e = (n, h, t) => (q(n, h, "read from private field"), t ? t.call(n) : h.get(n)), s = (n, h, t) => h.has(n) ? j("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(n) : h.set(n, t), i = (n, h, t, a) => (q(n, h, "write to private field"), a ? a.call(n, t) : h.set(n, t), t), _ = (n, h, t) => (q(n, h, "access private method"), t);
|
|
6
|
+
import { CSSProperty as A } from "../css-property/index.js";
|
|
7
|
+
import { S as J } from "../Store-OTdcl6SX.js";
|
|
8
8
|
import { d as z } from "../events-CsVF98U6.js";
|
|
9
|
-
import { d as
|
|
10
|
-
import { g as
|
|
11
|
-
import { windowResizer as
|
|
12
|
-
import { i as
|
|
13
|
-
var
|
|
9
|
+
import { d as K } from "../function-C10DGppn.js";
|
|
10
|
+
import { g as Q } from "../style-j2TwriJ_.js";
|
|
11
|
+
import { windowResizer as F } from "../window-resizer/vanilla/index.js";
|
|
12
|
+
import { i as V } from "../browser-0zX67oeU.js";
|
|
13
|
+
var S, l, P, y, d, v, p, m, g, f, b, u, G, E, B, T, D, w, x, H, C;
|
|
14
14
|
const c = class c extends HTMLElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
s(this, u);
|
|
18
|
-
s(this,
|
|
18
|
+
s(this, S);
|
|
19
19
|
s(this, l);
|
|
20
|
-
s(this,
|
|
20
|
+
s(this, P);
|
|
21
|
+
s(this, y);
|
|
21
22
|
s(this, d);
|
|
22
23
|
s(this, v);
|
|
23
24
|
s(this, p);
|
|
24
|
-
s(this, g);
|
|
25
25
|
s(this, m);
|
|
26
|
+
s(this, g);
|
|
26
27
|
s(this, f);
|
|
27
|
-
s(this,
|
|
28
|
-
s(this,
|
|
29
|
-
s(this,
|
|
30
|
-
s(this,
|
|
31
|
-
s(this, S);
|
|
32
|
-
s(this, P);
|
|
28
|
+
s(this, b);
|
|
29
|
+
s(this, E);
|
|
30
|
+
s(this, T);
|
|
31
|
+
s(this, w);
|
|
33
32
|
s(this, x);
|
|
34
|
-
|
|
33
|
+
s(this, H);
|
|
34
|
+
s(this, C);
|
|
35
|
+
i(this, S, -1), i(this, l, new J(!1)), i(this, d, new A(this, "--history", !1)), i(this, v, new A(this, "--restore", !1)), i(this, p, new A(this, "--dominance", 0)), i(this, m, new A(this, "--click-outside", !1)), i(this, g, new A(this, "--escape", !1)), i(this, f, !1), this.open = (t) => {
|
|
35
36
|
if (e(this, l).current)
|
|
36
37
|
return;
|
|
37
|
-
|
|
38
|
+
i(this, b, t == null ? void 0 : t.trigger), e(this, l).current = !0, e(this, p).current && (c.__opened = c.__opened.filter((o) => o !== this && this.dominance.current >= o.dominance.current ? (o.close(), !1) : !0)), c.__opened.push(this), i(this, S, c.__opened.length - 1), e(this, d).current && e(this, f) && history.pushState("", "", e(this, u, G)), clearTimeout(e(this, P)), this.classList.remove("closing"), this.classList.add("triggered"), this.style.display = "block", z(this, "popoverTriggered", {
|
|
38
39
|
custom: !0,
|
|
39
40
|
detail: {
|
|
40
|
-
trigger: e(this,
|
|
41
|
+
trigger: e(this, b)
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
const a = () => {
|
|
44
|
-
addEventListener("click", e(this,
|
|
45
|
+
addEventListener("click", e(this, E)), addEventListener("keydown", e(this, T)), e(this, C).call(this), this.style.opacity = "1", this.classList.add("opened"), z(this, "popoverOpened", {
|
|
45
46
|
custom: !0,
|
|
46
47
|
detail: {
|
|
47
|
-
trigger: e(this,
|
|
48
|
+
trigger: e(this, b)
|
|
48
49
|
}
|
|
49
|
-
});
|
|
50
|
+
}), i(this, y, void 0);
|
|
50
51
|
};
|
|
51
|
-
t != null && t.skipTransition ? a() : setTimeout(a, 10);
|
|
52
|
+
t != null && t.skipTransition ? a() : i(this, y, setTimeout(a, 10));
|
|
52
53
|
}, this.close = () => {
|
|
53
|
-
e(this, l).current && (e(this, l).current = !1, c.__opened = c.__opened.filter((t) => t === this ? !1 : e(t, p).current < this.dominance.current ? (t.close(), !1) : !0),
|
|
54
|
+
e(this, l).current && (removeEventListener("click", e(this, E)), removeEventListener("keydown", e(this, T)), e(this, l).current = !1, c.__opened = c.__opened.filter((t) => t === this ? !1 : e(t, p).current < this.dominance.current && !e(t, y) ? (t.close(), !1) : !0), _(this, u, B).call(this), this.classList.remove("opened"), this.classList.add("closing"), this.style.opacity = "0", z(this, "popoverClosing", {
|
|
54
55
|
custom: !0
|
|
55
|
-
}),
|
|
56
|
+
}), setTimeout(() => {
|
|
56
57
|
this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", z(this, "popoverClosed", {
|
|
57
58
|
custom: !0
|
|
58
59
|
});
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
e(this,
|
|
62
|
-
var
|
|
60
|
+
}, Q(this) + 10));
|
|
61
|
+
}, i(this, E, (t) => {
|
|
62
|
+
e(this, m).current && _(this, u, D).call(this, () => {
|
|
63
|
+
var U;
|
|
63
64
|
const a = t.composedPath();
|
|
64
65
|
if (a.find(
|
|
65
|
-
(
|
|
66
|
+
(W) => W instanceof HTMLElement && W.hasAttribute("data-popover-content")
|
|
66
67
|
))
|
|
67
68
|
return;
|
|
68
|
-
const
|
|
69
|
-
(
|
|
69
|
+
const o = a[0], I = o instanceof HTMLElement && (this.contains(o) || ((U = this.shadowRoot) == null ? void 0 : U.contains(o))), k = o instanceof HTMLElement && o.hasAttribute("data-outside");
|
|
70
|
+
(!I || k) && this.close();
|
|
70
71
|
});
|
|
71
|
-
}),
|
|
72
|
-
e(this,
|
|
72
|
+
}), i(this, T, (t) => {
|
|
73
|
+
e(this, g).current && _(this, u, D).call(this, () => {
|
|
73
74
|
t.code === "Escape" && this.close();
|
|
74
75
|
});
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
}),
|
|
78
|
-
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this,
|
|
79
|
-
}),
|
|
80
|
-
e(this,
|
|
81
|
-
}, 10)),
|
|
76
|
+
}), i(this, w, () => {
|
|
77
|
+
i(this, f, !1), e(this, l).current && e(this, d).current && !location.search.includes(this.id) ? this.close() : !e(this, l).current && e(this, d).current && location.search.includes(this.id) && this.open(), i(this, f, !0);
|
|
78
|
+
}), i(this, x, () => {
|
|
79
|
+
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, H).call(this);
|
|
80
|
+
}), i(this, H, K(() => {
|
|
81
|
+
e(this, C).call(this);
|
|
82
|
+
}, 10)), i(this, C, () => {
|
|
82
83
|
this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px");
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -92,126 +93,126 @@ const c = class c extends HTMLElement {
|
|
|
92
93
|
return e(this, p);
|
|
93
94
|
}
|
|
94
95
|
get clickOutside() {
|
|
95
|
-
return e(this,
|
|
96
|
+
return e(this, m);
|
|
96
97
|
}
|
|
97
98
|
get escape() {
|
|
98
|
-
return e(this,
|
|
99
|
+
return e(this, g);
|
|
99
100
|
}
|
|
100
101
|
get opened() {
|
|
101
102
|
return e(this, l);
|
|
102
103
|
}
|
|
103
104
|
get lastTrigger() {
|
|
104
|
-
return e(this,
|
|
105
|
+
return e(this, b);
|
|
105
106
|
}
|
|
106
107
|
connectedCallback() {
|
|
107
|
-
e(this, d).observe(), e(this, v).observe(), e(this, p).observe(), e(this,
|
|
108
|
-
e(this, v).current ? e(this,
|
|
109
|
-
}, 0),
|
|
108
|
+
e(this, d).observe(), e(this, v).observe(), e(this, p).observe(), e(this, m).observe(), e(this, g).observe(), this.style.opacity = "0", this.style.display = "none", this.setAttribute("popover-target", ""), this.classList.remove("closing"), this.classList.remove("closed"), this.classList.remove("triggered"), this.classList.remove("opened"), addEventListener("popstate", e(this, w)), setTimeout(() => {
|
|
109
|
+
e(this, v).current ? e(this, w).call(this) : (_(this, u, B).call(this), i(this, f, !0));
|
|
110
|
+
}, 0), F.subscribe(e(this, x));
|
|
110
111
|
}
|
|
111
112
|
disconnectedCallback() {
|
|
112
|
-
|
|
113
|
+
F.unsubscribe(e(this, x)), e(this, d).unobserve(), e(this, v).unobserve(), e(this, p).unobserve(), e(this, m).unobserve(), e(this, g).unobserve(), this.style.opacity = "", this.style.display = "", this.removeAttribute("popover-target"), c.__opened = c.__opened.filter((t) => t !== this), clearTimeout(e(this, P)), clearTimeout(e(this, y)), removeEventListener("popstate", e(this, w)), removeEventListener("click", e(this, E)), removeEventListener("keydown", e(this, T)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height");
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
|
-
|
|
116
|
+
S = new WeakMap(), l = new WeakMap(), P = new WeakMap(), y = new WeakMap(), d = new WeakMap(), v = new WeakMap(), p = new WeakMap(), m = new WeakMap(), g = new WeakMap(), f = new WeakMap(), b = new WeakMap(), u = new WeakSet(), G = function() {
|
|
116
117
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.id}`;
|
|
117
|
-
},
|
|
118
|
+
}, E = new WeakMap(), B = function() {
|
|
118
119
|
if (e(this, d).current) {
|
|
119
120
|
const t = new URL(location.href);
|
|
120
121
|
t.searchParams.delete(this.id), history.replaceState(null, "", t.href);
|
|
121
122
|
}
|
|
122
|
-
},
|
|
123
|
-
(c.__opened[e(this,
|
|
124
|
-
},
|
|
125
|
-
let
|
|
126
|
-
customElements.get("e-popover") || customElements.define("e-popover",
|
|
127
|
-
var
|
|
128
|
-
class
|
|
123
|
+
}, T = new WeakMap(), D = function(t) {
|
|
124
|
+
(c.__opened[e(this, S) - 1] || c.__opened.length === 1 || c.__opened.filter((a) => a !== this).every((a) => e(this, p).current > a.dominance.current)) && t();
|
|
125
|
+
}, w = new WeakMap(), x = new WeakMap(), H = new WeakMap(), C = new WeakMap(), c.__opened = [];
|
|
126
|
+
let N = c;
|
|
127
|
+
customElements.get("e-popover") || customElements.define("e-popover", N);
|
|
128
|
+
var r, L, M, O, R, $;
|
|
129
|
+
class X extends HTMLElement {
|
|
129
130
|
constructor() {
|
|
130
131
|
super();
|
|
131
|
-
s(this,
|
|
132
|
-
s(this,
|
|
133
|
-
s(this,
|
|
132
|
+
s(this, r);
|
|
133
|
+
s(this, L, new A(this, "--type", "open"));
|
|
134
|
+
s(this, M, () => {
|
|
134
135
|
this.classList.add("triggered");
|
|
135
136
|
});
|
|
136
|
-
s(this,
|
|
137
|
+
s(this, O, () => {
|
|
137
138
|
this.classList.add("opened"), this.setAttribute("aria-expanded", "true");
|
|
138
139
|
});
|
|
139
|
-
s(this,
|
|
140
|
+
s(this, R, () => {
|
|
140
141
|
this.classList.remove("opened");
|
|
141
142
|
});
|
|
142
|
-
s(this,
|
|
143
|
+
s(this, $, () => {
|
|
143
144
|
this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false");
|
|
144
145
|
});
|
|
145
|
-
|
|
146
|
-
if (e(this,
|
|
147
|
-
const t = e(this,
|
|
148
|
-
t === "open" || t === "toggle" && !e(this,
|
|
146
|
+
V && (this.addEventListener("click", () => {
|
|
147
|
+
if (e(this, r)) {
|
|
148
|
+
const t = e(this, L).current;
|
|
149
|
+
t === "open" || t === "toggle" && !e(this, r).opened.current ? e(this, r).open({ trigger: this }) : (t === "close" || t === "toggle" && e(this, r).opened.current) && e(this, r).close();
|
|
149
150
|
}
|
|
150
151
|
}), this.addEventListener("keydown", (t) => {
|
|
151
152
|
t.code === "Space" && t.currentTarget.click();
|
|
152
153
|
}));
|
|
153
154
|
}
|
|
154
155
|
get type() {
|
|
155
|
-
return e(this,
|
|
156
|
+
return e(this, L);
|
|
156
157
|
}
|
|
157
158
|
get popoverElement() {
|
|
158
|
-
return e(this,
|
|
159
|
+
return e(this, r);
|
|
159
160
|
}
|
|
160
161
|
connectedCallback() {
|
|
161
162
|
var a;
|
|
162
|
-
e(this,
|
|
163
|
-
e(this,
|
|
163
|
+
e(this, L).subscribe((o) => {
|
|
164
|
+
e(this, r) && (o.current !== "close" ? (this.setAttribute("aria-has-popup", "true"), this.setAttribute(
|
|
164
165
|
"aria-expanded",
|
|
165
|
-
e(this,
|
|
166
|
-
), this.setAttribute("aria-controls", e(this,
|
|
166
|
+
e(this, r).opened.current ? "true" : "false"
|
|
167
|
+
), this.setAttribute("aria-controls", e(this, r).id || "")) : (this.removeAttribute("aria-has-popup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
|
|
167
168
|
}), this.hasAttribute("tabindex") || (this.tabIndex = 0);
|
|
168
169
|
const t = this.getAttribute("target");
|
|
169
170
|
if (t) {
|
|
170
|
-
let
|
|
171
|
+
let o = null;
|
|
171
172
|
if (t === "parent") {
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
|
|
173
|
+
const I = this.closest("[popover-target]");
|
|
174
|
+
if (I)
|
|
175
|
+
o = I;
|
|
175
176
|
else {
|
|
176
|
-
const
|
|
177
|
-
|
|
177
|
+
const k = this.getRootNode();
|
|
178
|
+
k instanceof ShadowRoot ? o = k.host.closest("[popover-target]") : k instanceof HTMLElement && (o = k.closest("[popover-target]"));
|
|
178
179
|
}
|
|
179
|
-
} else t === "sibling" ?
|
|
180
|
-
|
|
180
|
+
} else t === "sibling" ? o = (a = this.parentElement) == null ? void 0 : a.querySelector("[popover-target]") : o = document.querySelector(`#${t}`) || this.getRootNode().querySelector(`#${t}`);
|
|
181
|
+
o instanceof HTMLElement ? (i(this, r, o), e(this, r).addEventListener(
|
|
181
182
|
"popoverTriggered",
|
|
182
|
-
e(this, H)
|
|
183
|
-
), e(this, i).addEventListener(
|
|
184
|
-
"popoverOpened",
|
|
185
183
|
e(this, M)
|
|
186
|
-
), e(this,
|
|
187
|
-
"
|
|
184
|
+
), e(this, r).addEventListener(
|
|
185
|
+
"popoverOpened",
|
|
188
186
|
e(this, O)
|
|
189
|
-
), e(this,
|
|
190
|
-
"
|
|
187
|
+
), e(this, r).addEventListener(
|
|
188
|
+
"popoverClosing",
|
|
191
189
|
e(this, R)
|
|
190
|
+
), e(this, r).addEventListener(
|
|
191
|
+
"popoverClosed",
|
|
192
|
+
e(this, $)
|
|
192
193
|
)) : console.warn(this, `target ${t} not found`);
|
|
193
194
|
}
|
|
194
|
-
e(this,
|
|
195
|
+
e(this, L).observe();
|
|
195
196
|
}
|
|
196
197
|
disconnectedCallback() {
|
|
197
|
-
e(this,
|
|
198
|
+
e(this, L).unobserve(), this.removeAttribute("aria-has-popup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), e(this, r) && (e(this, r).removeEventListener(
|
|
198
199
|
"popoverTriggered",
|
|
199
|
-
e(this, H)
|
|
200
|
-
), e(this, i).removeEventListener(
|
|
201
|
-
"popoverOpened",
|
|
202
200
|
e(this, M)
|
|
203
|
-
), e(this,
|
|
204
|
-
"
|
|
201
|
+
), e(this, r).removeEventListener(
|
|
202
|
+
"popoverOpened",
|
|
205
203
|
e(this, O)
|
|
206
|
-
), e(this,
|
|
207
|
-
"
|
|
204
|
+
), e(this, r).removeEventListener(
|
|
205
|
+
"popoverClosing",
|
|
208
206
|
e(this, R)
|
|
207
|
+
), e(this, r).removeEventListener(
|
|
208
|
+
"popoverClosed",
|
|
209
|
+
e(this, $)
|
|
209
210
|
));
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
-
customElements.get("e-popover-button") || customElements.define("e-popover-button",
|
|
213
|
+
r = new WeakMap(), L = new WeakMap(), M = new WeakMap(), O = new WeakMap(), R = new WeakMap(), $ = new WeakMap();
|
|
214
|
+
customElements.get("e-popover-button") || customElements.define("e-popover-button", X);
|
|
214
215
|
export {
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
X as PopoverButtonElement,
|
|
217
|
+
N as PopoverElement
|
|
217
218
|
};
|
|
@@ -2,6 +2,9 @@ import { ScrollUserElement } from './ScrollUserElement';
|
|
|
2
2
|
import { ScrollSetOptions } from './ScrollElement';
|
|
3
3
|
|
|
4
4
|
export declare abstract class ScrollButtonElement extends ScrollUserElement {
|
|
5
|
+
#private;
|
|
5
6
|
constructor();
|
|
6
7
|
protected abstract handleClick(options: ScrollSetOptions): void;
|
|
8
|
+
protected connectedCallback(): void;
|
|
9
|
+
protected disconnectedCallback(): void;
|
|
7
10
|
}
|
|
@@ -4,15 +4,19 @@ import { Axes2D } from '../../utils';
|
|
|
4
4
|
import { CSSProperty } from '../../css-property';
|
|
5
5
|
import { ScrollSection } from './ScrollSection';
|
|
6
6
|
|
|
7
|
+
export type ScrollLine = 'start' | 'end' | null;
|
|
7
8
|
export interface ScrollEvents {
|
|
8
9
|
scrollSectionsChange: CustomEvent;
|
|
10
|
+
scrollLine: CustomEvent<{
|
|
11
|
+
line: ScrollLine;
|
|
12
|
+
}>;
|
|
9
13
|
}
|
|
10
14
|
export type ScrollBehaviour = 'smooth' | 'instant';
|
|
11
15
|
export interface ScrollSetOptions {
|
|
12
16
|
behaviour?: ScrollBehaviour;
|
|
13
17
|
tween?: {
|
|
14
|
-
easing?: TweenedOptions['easing'];
|
|
15
|
-
duration
|
|
18
|
+
easing?: TweenedOptions['easing'] | false;
|
|
19
|
+
duration?: number | false;
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
22
|
export declare class ScrollElement extends HTMLElement {
|
|
@@ -63,6 +67,7 @@ export declare class ScrollElement extends HTMLElement {
|
|
|
63
67
|
get loopDistance(): number;
|
|
64
68
|
get hasOverflow(): boolean;
|
|
65
69
|
get overscroll(): number;
|
|
70
|
+
get scrollLine(): ScrollLine;
|
|
66
71
|
get vertical(): boolean;
|
|
67
72
|
get currentProgress(): number;
|
|
68
73
|
get targetProgress(): number;
|
|
@@ -2,7 +2,10 @@ import { ScrollButtonElement } from './ScrollButtonElement';
|
|
|
2
2
|
import { ScrollSetOptions } from './ScrollElement';
|
|
3
3
|
|
|
4
4
|
export declare class ScrollSetButtonElement extends ScrollButtonElement {
|
|
5
|
+
#private;
|
|
5
6
|
protected handleClick(options: ScrollSetOptions): void;
|
|
7
|
+
protected connectedCallback(): void;
|
|
8
|
+
protected disconnectedCallback(): void;
|
|
6
9
|
}
|
|
7
10
|
declare global {
|
|
8
11
|
interface HTMLElementTagNameMap {
|
|
@@ -2,7 +2,10 @@ import { ScrollButtonElement } from './ScrollButtonElement';
|
|
|
2
2
|
import { ScrollSetOptions } from './ScrollElement';
|
|
3
3
|
|
|
4
4
|
export declare class ScrollStepButtonElement extends ScrollButtonElement {
|
|
5
|
+
#private;
|
|
5
6
|
protected handleClick(options: ScrollSetOptions): void;
|
|
7
|
+
protected connectedCallback(): void;
|
|
8
|
+
protected disconnectedCallback(): void;
|
|
6
9
|
}
|
|
7
10
|
declare global {
|
|
8
11
|
interface HTMLElementTagNameMap {
|