aptechka 0.1.2 → 0.1.5
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/Animated-CzBHCHNm.js +130 -0
- package/lib/Animated-DZ_fbJmi.cjs +1 -0
- package/lib/Damped--qBZAdEi.cjs +1 -0
- package/lib/Damped-Bm1kSn1f.js +36 -0
- package/lib/Derived-BS2ja9qa.js +27 -0
- package/lib/Derived-CqmIkTGN.cjs +1 -0
- package/lib/ElementConstructor-DB0xOoat.js +199 -0
- package/lib/ElementConstructor-v1FPLXAW.cjs +1 -0
- package/lib/{SourceManager-F94MRde6.js → SourceManager-B44FUTig.js} +26 -26
- package/lib/SourceManager-D447KWpH.cjs +1 -0
- package/lib/Store-BOOfmlyv.cjs +1 -0
- package/lib/Store-uTyReFzx.js +152 -0
- package/lib/Viewport-CDqiD8Ao.cjs +1 -0
- package/lib/Viewport-Cj0i-H5d.js +129 -0
- package/lib/WheelControls-CX9WUbBC.js +83 -0
- package/lib/WheelControls-CfDeGCOU.cjs +1 -0
- package/lib/abstract-elements/AbstractButtonElement.d.ts +5 -0
- package/lib/abstract-elements/index.cjs +1 -0
- package/lib/abstract-elements/index.d.ts +1 -0
- package/lib/abstract-elements/index.js +27 -0
- package/lib/accordion/AccordionElement.d.ts +30 -0
- package/lib/accordion/index.cjs +1 -0
- package/lib/accordion/index.d.ts +1 -0
- package/lib/accordion/index.js +166 -0
- package/lib/animation/Animated.d.ts +9 -12
- package/lib/animation/Tweened.d.ts +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.d.ts +1 -1
- package/lib/animation/index.js +11 -17
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.d.ts +8 -4
- package/lib/attribute/index.js +44 -35
- package/lib/canvas/index.cjs +1 -0
- package/lib/{canvas-2d → canvas}/index.d.ts +7 -6
- package/lib/canvas/index.js +97 -0
- package/lib/connector/index.cjs +1 -0
- package/lib/connector/index.d.ts +14 -0
- package/lib/connector/index.js +53 -0
- package/lib/controls/WheelControls.d.ts +3 -2
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.d.ts +0 -1
- package/lib/controls/index.js +23 -28
- package/lib/createStylesheet-74ZP3AZm.js +8 -0
- package/lib/createStylesheet-ChhZFwSX.cjs +1 -0
- package/lib/createTheme-BMH9cRrS.js +15 -0
- package/lib/createTheme-COo8IzPG.cjs +1 -0
- package/lib/custom-element/index.cjs +1 -1
- package/lib/custom-element/index.d.ts +3 -1
- package/lib/custom-element/index.js +19 -9
- package/lib/device/Viewport.d.ts +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -121
- package/lib/element-constructor/ElementConstructor.d.ts +11 -15
- package/lib/element-constructor/createStylesheet.d.ts +2 -0
- package/lib/element-constructor/createTheme.d.ts +12 -0
- package/lib/element-constructor/htmlTags.d.ts +115 -113
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.d.ts +2 -1
- package/lib/element-constructor/index.js +387 -1135
- package/lib/element-constructor/svgTags.d.ts +63 -63
- package/lib/element-resizer/index.cjs +1 -0
- package/lib/element-resizer/index.d.ts +9 -0
- package/lib/element-resizer/index.js +64 -0
- package/lib/en3/attachments/En3SourceManager.d.ts +2 -2
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.js +252 -242
- package/lib/en3/objects/En3Clip.d.ts +2 -2
- package/lib/events-CoqmkUxo.js +11 -0
- package/lib/events-D68xg4dy.cjs +1 -0
- package/lib/file-EevnUtRj.cjs +1 -0
- package/lib/file-lxi_oXJf.js +13 -0
- package/lib/htmlTags-CNEFIHPp.js +683 -0
- package/lib/htmlTags-CwYHVo9n.cjs +1 -0
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +13 -20
- package/lib/index-DyJhLxk8.js +310 -0
- package/lib/index-tPw9mmLF.cjs +9 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.d.ts +2 -1
- package/lib/intersector/index.js +33 -22
- package/lib/jsx/ComponentWrapper.d.ts +12 -0
- package/lib/jsx/h.d.ts +7 -0
- package/lib/jsx/hooks.d.ts +19 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +4 -0
- package/lib/jsx/index.js +125 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +185 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +3 -4
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +1 -0
- package/lib/layout-box/index.js +113 -99
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +1 -1
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +17 -20
- package/lib/modal/ModalElement.d.ts +12 -0
- package/lib/modal/index.cjs +1 -0
- package/lib/modal/index.d.ts +1 -0
- package/lib/modal/index.js +144 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +1 -1
- package/lib/number-Bo5RdrA1.js +23 -0
- package/lib/number-yVpzMdbQ.cjs +1 -0
- package/lib/popover/PopoverButtonElement.d.ts +14 -0
- package/lib/popover/PopoverElement.d.ts +19 -0
- package/lib/popover/index.cjs +1 -0
- package/lib/popover/index.d.ts +2 -0
- package/lib/popover/index.js +122 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +2 -2
- package/lib/scroll/ScrollElement.d.ts +5 -3
- package/lib/scroll/index.cjs +1 -71
- package/lib/scroll/index.js +349 -314
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.d.ts +1 -1
- package/lib/scroll-entries/index.js +4 -2
- package/lib/select/SelectElement.d.ts +25 -0
- package/lib/select/SelectHeadElement.d.ts +12 -0
- package/lib/select/SelectOptionElement.d.ts +13 -0
- package/lib/select/SelectUserElement.d.ts +7 -0
- package/lib/select/index.cjs +1 -0
- package/lib/select/index.d.ts +4 -0
- package/lib/select/index.js +7 -0
- package/lib/source/SourceClass.d.ts +1 -1
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +13 -18
- package/lib/store/CumulativeResource.d.ts +12 -0
- package/lib/store/Resource.d.ts +5 -2
- package/lib/store/Store.d.ts +56 -9
- package/lib/store/StoreRegistry.d.ts +2 -2
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -1
- package/lib/store/index.js +108 -66
- package/lib/string-BrDhnNUL.js +39 -0
- package/lib/string-DzUwFYSS.cjs +1 -0
- package/lib/studio/StudioElement.d.ts +12 -0
- package/lib/studio/index.cjs +10 -0
- package/lib/studio/index.d.ts +1 -0
- package/lib/studio/index.js +985 -0
- package/lib/studio/studioStorage.d.ts +14 -0
- package/lib/studio/tweaker/TweakerBooleanManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerColorManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerElement.d.ts +17 -0
- package/lib/studio/tweaker/TweakerFieldElement.d.ts +20 -0
- package/lib/studio/tweaker/TweakerFolderElement.d.ts +22 -0
- package/lib/studio/tweaker/TweakerLinkManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerNumberManagerElement.d.ts +17 -0
- package/lib/studio/tweaker/TweakerRangeManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerSelectManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerStoreManagerElement.d.ts +7 -0
- package/lib/studio/tweaker/TweakerStringManagerElement.d.ts +12 -0
- package/lib/studio/tweaker/tweakerManagerConstructors.d.ts +5 -0
- package/lib/style-At6aDoqG.cjs +1 -0
- package/lib/style-j2TwriJ_.js +10 -0
- package/lib/theme/index.cjs +1 -0
- package/lib/theme/index.d.ts +90 -0
- package/lib/theme/index.js +34 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +1 -1
- package/lib/utils/events.d.ts +6 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +8 -7
- package/lib/utils/index.js +95 -105
- package/lib/utils/number.d.ts +2 -3
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/style.d.ts +2 -0
- package/lib/utils/ts-utility.d.ts +2 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +13 -20
- package/lib/window-resizer/index.cjs +1 -0
- package/lib/window-resizer/index.d.ts +9 -0
- package/lib/window-resizer/index.js +46 -0
- package/package.json +92 -30
- package/lib/Damped-1hlKSFaB.cjs +0 -1
- package/lib/Damped-523xgzT3.js +0 -152
- package/lib/SourceManager-3c3kr7oj.cjs +0 -1
- package/lib/Store-2hWEUGTj.js +0 -135
- package/lib/Store-WXFmsaEI.cjs +0 -1
- package/lib/WheelControls-F-xg5-oq.js +0 -102
- package/lib/WheelControls-Hp5NWRZY.cjs +0 -1
- package/lib/canvas-2d/index.cjs +0 -5
- package/lib/canvas-2d/index.js +0 -90
- package/lib/controls/User.d.ts +0 -7
- package/lib/element-constructor/specialObjects.d.ts +0 -2
- package/lib/measurer/CumulativeOffsetLeft.d.ts +0 -4
- package/lib/measurer/CumulativeOffsetTop.d.ts +0 -4
- package/lib/measurer/Meaurer.d.ts +0 -8
- package/lib/measurer/index.cjs +0 -1
- package/lib/measurer/index.d.ts +0 -3
- package/lib/measurer/index.js +0 -48
- package/lib/number-2bR0KBcX.cjs +0 -1
- package/lib/number-bCHB2GAD.js +0 -31
- package/lib/resizer/index.cjs +0 -1
- package/lib/resizer/index.d.ts +0 -10
- package/lib/resizer/index.js +0 -45
- package/lib/string-GmxZA5Nq.js +0 -31
- package/lib/string-WmNOGq16.cjs +0 -1
- package/lib/utils/dev.d.ts +0 -3
- /package/lib/{attributes-w0u-KiIb.js → attributes-69we3byR.js} +0 -0
- /package/lib/{attributes-_2U65GDl.cjs → attributes-Bf2svn4j.cjs} +0 -0
- /package/lib/{browser-S4eq8AeN.js → browser-0zX67oeU.js} +0 -0
- /package/lib/{browser-QbF6EW-w.cjs → browser-CpzFX2xg.cjs} +0 -0
- /package/lib/{dom-bHEwc_xV.js → dom-BY7JhTx5.js} +0 -0
- /package/lib/{dom-QhWsdQS2.cjs → dom-qY2LdCVL.cjs} +0 -0
- /package/lib/{easings-uF-tgahf.js → easings-BKi40vHz.js} +0 -0
- /package/lib/{easings-_wFs9ZWc.cjs → easings-DsS5-Kqc.cjs} +0 -0
- /package/lib/{function-zwSFehNd.js → function-C10DGppn.js} +0 -0
- /package/lib/{function-QP7IreXR.cjs → function-MthRj-GJ.cjs} +0 -0
- /package/lib/{layout-rZzbsLPd.cjs → layout-8ryRAMGJ.cjs} +0 -0
- /package/lib/{layout-5SJlcXTY.js → layout-HoBT_Da2.js} +0 -0
- /package/lib/{math-_a3IpKOc.js → math-BOBiC4TN.js} +0 -0
- /package/lib/{math-FNUBmQPK.cjs → math-GDWEqu7y.cjs} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const n = [
|
|
2
|
+
1,
|
|
3
|
+
10,
|
|
4
|
+
100,
|
|
5
|
+
1e3,
|
|
6
|
+
1e4,
|
|
7
|
+
1e5,
|
|
8
|
+
1e6,
|
|
9
|
+
1e7,
|
|
10
|
+
1e8,
|
|
11
|
+
1e9,
|
|
12
|
+
1e10
|
|
13
|
+
];
|
|
14
|
+
function u(r, e = 5) {
|
|
15
|
+
return (0.5 + r * n[e] << 0) / n[e];
|
|
16
|
+
}
|
|
17
|
+
function o(r, e) {
|
|
18
|
+
return Math.round(r / e) * e;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
u as p,
|
|
22
|
+
o as r
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10];function n(r,e=5){return(.5+r*u[e]<<0)/u[e]}function o(r,e){return Math.round(r/e)*e}exports.preciseNumber=n;exports.roundNumberTo=o;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PopoverElement } from './PopoverElement';
|
|
2
|
+
import { AbstractButtonElement } from '../abstract-elements';
|
|
3
|
+
export type PopoverButtonType = 'open' | 'close' | 'toggle';
|
|
4
|
+
export declare class PopoverButtonElement extends AbstractButtonElement {
|
|
5
|
+
#private;
|
|
6
|
+
get popoverElement(): PopoverElement | undefined;
|
|
7
|
+
click(): void;
|
|
8
|
+
protected connectedCallback(): void;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'e-popover-button': PopoverButtonElement;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Attribute } from '../attribute';
|
|
2
|
+
import { CustomElement } from '../custom-element';
|
|
3
|
+
import { Store } from '../store';
|
|
4
|
+
export declare class PopoverElement extends CustomElement {
|
|
5
|
+
#private;
|
|
6
|
+
private static __opened;
|
|
7
|
+
get history(): Attribute<false>;
|
|
8
|
+
get single(): Attribute<false>;
|
|
9
|
+
get opened(): Store<boolean, keyof import('../store').StoreManagers, import('../store').StoreEntry<boolean>>;
|
|
10
|
+
open: () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
protected connectedCallback(): void;
|
|
13
|
+
protected disconnectedCallback(): void;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'e-popover': PopoverElement;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),M=require("../custom-element/index.cjs"),A=require("../Store-BOOfmlyv.cjs"),q=require("../style-At6aDoqG.cjs"),x=require("../abstract-elements/index.cjs");var $=Object.defineProperty,B=Object.getOwnPropertyDescriptor,D=(t,e,r)=>e in t?$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e,r,s)=>{for(var n=s>1?void 0:s?B(e,r):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&$(e,r,n),n},P=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),W=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},i=(t,e,r)=>(W(t,e,"read from private field"),r?r.call(t):e.get(t)),o=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},y=(t,e,r,s)=>(W(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),k=(t,e,r)=>(W(t,e,"access private method"),r),g,a,_,c,f,u,S,C,m,E,w,L,v;exports.PopoverElement=class extends M.CustomElement{constructor(){super(...arguments),o(this,S),o(this,w),o(this,g,-1),o(this,a,new A.Store(!1)),o(this,_,void 0),o(this,c,new T.Attribute(this,"history",!1)),o(this,f,new T.Attribute(this,"single",!1)),o(this,u,!1),P(this,"open",()=>{i(this,a).current||(i(this,a).current=!0,i(this,f).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),y(this,g,exports.PopoverElement.__opened.length-1),i(this,c).current&&i(this,u)&&history.pushState("","",i(this,S,C)),clearTimeout(i(this,_)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",i(this,m)),addEventListener("keydown",i(this,E)),this.style.opacity="1",this.classList.add("opened")}))}),P(this,"close",()=>{i(this,a).current&&(i(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,c).current&&history.replaceState("","",location.pathname.replace(this.id,"")),this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",i(this,m)),removeEventListener("keydown",i(this,E)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},q.getElementTransitionDurationMS(this)))}),o(this,m,e=>{k(this,w,L).call(this,()=>{const r=e.composedPath();(!r.find(s=>s===this)&&!r.find(s=>s instanceof HTMLElement&&s.closest("e-popover-button"))||r[0]instanceof HTMLElement&&r[0].hasAttribute("outside"))&&this.close()})}),o(this,E,e=>{k(this,w,L).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,v,()=>{y(this,u,!1),i(this,a).current&&i(this,c).current&&!location.pathname.includes(this.id)?this.close():!i(this,a).current&&i(this,c).current&&location.pathname.includes(this.id)&&this.open(),y(this,u,!0)})}get history(){return i(this,c)}get single(){return i(this,f)}get opened(){return i(this,a)}connectedCallback(){this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,v)),setTimeout(()=>{i(this,v).call(this)},0)}disconnectedCallback(){clearTimeout(i(this,_)),removeEventListener("popstate",i(this,v))}};g=new WeakMap;a=new WeakMap;_=new WeakMap;c=new WeakMap;f=new WeakMap;u=new WeakMap;S=new WeakSet;C=function(){return`${location.pathname}${location.pathname.endsWith("/")?"":"/"}${this.id}`};m=new WeakMap;E=new WeakMap;w=new WeakSet;L=function(t){(exports.PopoverElement.__opened[i(this,g)-1]||exports.PopoverElement.__opened.length===1)&&t()};v=new WeakMap;P(exports.PopoverElement,"__opened",[]);exports.PopoverElement=b([M.define("e-popover")],exports.PopoverElement);var I=Object.defineProperty,G=Object.getOwnPropertyDescriptor,H=(t,e,r,s)=>{for(var n=s>1?void 0:s?G(e,r):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&I(e,r,n),n},O=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},d=(t,e,r)=>(O(t,e,"read from private field"),r?r.call(t):e.get(t)),N=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},F=(t,e,r,s)=>(O(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),h;exports.PopoverButtonElement=class extends x.AbstractButtonElement{constructor(){super(...arguments),N(this,h,void 0)}get popoverElement(){return d(this,h)}click(){if(d(this,h)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!d(this,h).opened.current?d(this,h).open():(e==="close"||e==="toggle"&&d(this,h).opened.current)&&d(this,h).close()}}connectedCallback(){const e=this.getAttribute("target");if(e){const r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);r?F(this,h,r):console.warn(this,`target ${e} not found`)}}};h=new WeakMap;exports.PopoverButtonElement=H([M.define("e-popover-button")],exports.PopoverButtonElement);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Attribute as T } from "../attribute/index.js";
|
|
2
|
+
import { CustomElement as x, define as P } from "../custom-element/index.js";
|
|
3
|
+
import { S as I } from "../Store-uTyReFzx.js";
|
|
4
|
+
import { g as q } from "../style-j2TwriJ_.js";
|
|
5
|
+
import { AbstractButtonElement as B } from "../abstract-elements/index.js";
|
|
6
|
+
var O = Object.defineProperty, G = Object.getOwnPropertyDescriptor, H = (e, t, i) => t in e ? O(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, N = (e, t, i, r) => {
|
|
7
|
+
for (var n = r > 1 ? void 0 : r ? G(t, i) : t, c = e.length - 1, l; c >= 0; c--)
|
|
8
|
+
(l = e[c]) && (n = (r ? l(t, i, n) : l(n)) || n);
|
|
9
|
+
return r && n && O(t, i, n), n;
|
|
10
|
+
}, W = (e, t, i) => (H(e, typeof t != "symbol" ? t + "" : t, i), i), k = (e, t, i) => {
|
|
11
|
+
if (!t.has(e))
|
|
12
|
+
throw TypeError("Cannot " + i);
|
|
13
|
+
}, s = (e, t, i) => (k(e, t, "read from private field"), i ? i.call(e) : t.get(e)), o = (e, t, i) => {
|
|
14
|
+
if (t.has(e))
|
|
15
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
16
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, i);
|
|
17
|
+
}, L = (e, t, i, r) => (k(e, t, "write to private field"), r ? r.call(e, i) : t.set(e, i), i), $ = (e, t, i) => (k(e, t, "access private method"), i), E, h, v, d, m, _, M, A, w, g, y, S, f;
|
|
18
|
+
let a = class extends x {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), o(this, M), o(this, y), o(this, E, -1), o(this, h, new I(!1)), o(this, v, void 0), o(this, d, new T(this, "history", !1)), o(this, m, new T(this, "single", !1)), o(this, _, !1), W(this, "open", () => {
|
|
21
|
+
s(this, h).current || (s(this, h).current = !0, s(this, m).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), L(this, E, a.__opened.length - 1), s(this, d).current && s(this, _) && history.pushState("", "", s(this, M, A)), clearTimeout(s(this, v)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
|
|
22
|
+
addEventListener("click", s(this, w)), addEventListener("keydown", s(this, g)), this.style.opacity = "1", this.classList.add("opened");
|
|
23
|
+
}));
|
|
24
|
+
}), W(this, "close", () => {
|
|
25
|
+
s(this, h).current && (s(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), s(this, d).current && history.replaceState("", "", location.pathname.replace(this.id, "")), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", s(this, w)), removeEventListener("keydown", s(this, g)), setTimeout(() => {
|
|
26
|
+
this.classList.remove("triggered"), this.style.display = "none";
|
|
27
|
+
}, q(this)));
|
|
28
|
+
}), o(this, w, (e) => {
|
|
29
|
+
$(this, y, S).call(this, () => {
|
|
30
|
+
const t = e.composedPath();
|
|
31
|
+
(!t.find((i) => i === this) && !t.find(
|
|
32
|
+
(i) => i instanceof HTMLElement && i.closest("e-popover-button")
|
|
33
|
+
) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
|
|
34
|
+
});
|
|
35
|
+
}), o(this, g, (e) => {
|
|
36
|
+
$(this, y, S).call(this, () => {
|
|
37
|
+
e.code === "Escape" && this.close();
|
|
38
|
+
});
|
|
39
|
+
}), o(this, f, () => {
|
|
40
|
+
L(this, _, !1), s(this, h).current && s(this, d).current && !location.pathname.includes(this.id) ? this.close() : !s(this, h).current && s(this, d).current && location.pathname.includes(this.id) && this.open(), L(this, _, !0);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
get history() {
|
|
44
|
+
return s(this, d);
|
|
45
|
+
}
|
|
46
|
+
get single() {
|
|
47
|
+
return s(this, m);
|
|
48
|
+
}
|
|
49
|
+
get opened() {
|
|
50
|
+
return s(this, h);
|
|
51
|
+
}
|
|
52
|
+
connectedCallback() {
|
|
53
|
+
this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", s(this, f)), setTimeout(() => {
|
|
54
|
+
s(this, f).call(this);
|
|
55
|
+
}, 0);
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
clearTimeout(s(this, v)), removeEventListener("popstate", s(this, f));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
62
|
+
h = /* @__PURE__ */ new WeakMap();
|
|
63
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
64
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
65
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
66
|
+
_ = /* @__PURE__ */ new WeakMap();
|
|
67
|
+
M = /* @__PURE__ */ new WeakSet();
|
|
68
|
+
A = function() {
|
|
69
|
+
return `${location.pathname}${location.pathname.endsWith("/") ? "" : "/"}${this.id}`;
|
|
70
|
+
};
|
|
71
|
+
w = /* @__PURE__ */ new WeakMap();
|
|
72
|
+
g = /* @__PURE__ */ new WeakMap();
|
|
73
|
+
y = /* @__PURE__ */ new WeakSet();
|
|
74
|
+
S = function(e) {
|
|
75
|
+
(a.__opened[s(this, E) - 1] || a.__opened.length === 1) && e();
|
|
76
|
+
};
|
|
77
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
78
|
+
W(a, "__opened", []);
|
|
79
|
+
a = N([
|
|
80
|
+
P("e-popover")
|
|
81
|
+
], a);
|
|
82
|
+
var F = Object.defineProperty, R = Object.getOwnPropertyDescriptor, z = (e, t, i, r) => {
|
|
83
|
+
for (var n = r > 1 ? void 0 : r ? R(t, i) : t, c = e.length - 1, l; c >= 0; c--)
|
|
84
|
+
(l = e[c]) && (n = (r ? l(t, i, n) : l(n)) || n);
|
|
85
|
+
return r && n && F(t, i, n), n;
|
|
86
|
+
}, D = (e, t, i) => {
|
|
87
|
+
if (!t.has(e))
|
|
88
|
+
throw TypeError("Cannot " + i);
|
|
89
|
+
}, u = (e, t, i) => (D(e, t, "read from private field"), i ? i.call(e) : t.get(e)), J = (e, t, i) => {
|
|
90
|
+
if (t.has(e))
|
|
91
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
92
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, i);
|
|
93
|
+
}, K = (e, t, i, r) => (D(e, t, "write to private field"), r ? r.call(e, i) : t.set(e, i), i), p;
|
|
94
|
+
let C = class extends B {
|
|
95
|
+
constructor() {
|
|
96
|
+
super(...arguments), J(this, p, void 0);
|
|
97
|
+
}
|
|
98
|
+
get popoverElement() {
|
|
99
|
+
return u(this, p);
|
|
100
|
+
}
|
|
101
|
+
click() {
|
|
102
|
+
if (u(this, p)) {
|
|
103
|
+
const e = this.getAttribute("type") || "open";
|
|
104
|
+
e === "open" || e === "toggle" && !u(this, p).opened.current ? u(this, p).open() : (e === "close" || e === "toggle" && u(this, p).opened.current) && u(this, p).close();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
connectedCallback() {
|
|
108
|
+
const e = this.getAttribute("target");
|
|
109
|
+
if (e) {
|
|
110
|
+
const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
|
|
111
|
+
t ? K(this, p, t) : console.warn(this, `target ${e} not found`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
p = /* @__PURE__ */ new WeakMap();
|
|
116
|
+
C = z([
|
|
117
|
+
P("e-popover-button")
|
|
118
|
+
], C);
|
|
119
|
+
export {
|
|
120
|
+
C as PopoverButtonElement,
|
|
121
|
+
a as PopoverElement
|
|
122
|
+
};
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var it=Object.defineProperty;var $=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var rt=(i,t,s)=>t in i?it(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var K=(i,t,s)=>(rt(i,typeof t!="symbol"?t+"":t,s),s),J=(i,t,s)=>{if(!t.has(i))throw TypeError("Cannot "+s)};var e=(i,t,s)=>(J(i,t,"read from private field"),s?s.call(i):t.get(i)),n=(i,t,s)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,s)},o=(i,t,s,r)=>(J(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s);var Q=(i,t,s)=>(J(i,t,"access private method"),s);var W=(i,t,s)=>new Promise((r,l)=>{var a=d=>{try{f(s.next(d))}catch(T){l(T)}},u=d=>{try{f(s.throw(d))}catch(T){l(T)}},f=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,u);f((s=s.apply(i,t)).next())});var V=(i,t,s)=>(t=i[$("asyncIterator")])?t.call(i):(i=i[$("iterator")](),t={},s=(r,l)=>(l=i[r])&&(t[r]=a=>new Promise((u,f,d)=>(a=l.call(i,a),d=a.done,Promise.resolve(a.value).then(T=>u({value:T,done:d}),f)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),tt=require("../browser-
|
|
1
|
+
"use strict";var it=Object.defineProperty;var $=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var rt=(i,t,s)=>t in i?it(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var K=(i,t,s)=>(rt(i,typeof t!="symbol"?t+"":t,s),s),J=(i,t,s)=>{if(!t.has(i))throw TypeError("Cannot "+s)};var e=(i,t,s)=>(J(i,t,"read from private field"),s?s.call(i):t.get(i)),n=(i,t,s)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,s)},o=(i,t,s,r)=>(J(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s);var Q=(i,t,s)=>(J(i,t,"access private method"),s);var W=(i,t,s)=>new Promise((r,l)=>{var a=d=>{try{f(s.next(d))}catch(T){l(T)}},u=d=>{try{f(s.throw(d))}catch(T){l(T)}},f=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,u);f((s=s.apply(i,t)).next())});var V=(i,t,s)=>(t=i[$("asyncIterator")])?t.call(i):(i=i[$("iterator")](),t={},s=(r,l)=>(l=i[r])&&(t[r]=a=>new Promise((u,f,d)=>(a=l.call(i,a),d=a.done,Promise.resolve(a.value).then(T=>u({value:T,done:d}),f)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),at=require("../function-MthRj-GJ.cjs"),ht=require("../custom-element/index.cjs");var R,x,b,m,c,P,S,w,v,E,Y,et;class ct{constructor(t,s){n(this,Y);n(this,R,void 0);n(this,x,void 0);n(this,b,void 0);n(this,m,void 0);n(this,c,void 0);n(this,P,void 0);n(this,S,void 0);n(this,w,null);n(this,v,[]);n(this,E,[]);o(this,R,t),o(this,x,s),o(this,b,new URLPattern({pathname:e(this,R)})),o(this,m,null),o(this,c,null),o(this,P,!1),o(this,S,null),tt.isBrowser&&o(this,w,new MutationObserver(r=>{r[0].addedNodes.forEach(a=>{e(this,m)?e(this,E).push(a):e(this,v).push(a)})}))}get pattern(){return e(this,R)}get urlPattern(){return e(this,b)}get isActive(){return e(this,P)}get element(){return e(this,c)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return W(this,null,function*(){var r,l;if(e(this,w).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,v).forEach(a=>{document.head.appendChild(a)});else{const a=yield e(this,x).call(this);o(this,E,[...e(this,v)]),typeof a.default=="function"&&(o(this,m,a.default),customElements.define("e-"+((r=e(this,m))==null?void 0:r.name.toLowerCase()),a.default))}if(yield Q(this,Y,et).call(this),e(this,m)){const a=e(this,b).exec({pathname:s}),u=(a==null?void 0:a.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:u,searchParams:f};o(this,c,new(e(this,m))(d)),t.appendChild(e(this,c)),o(this,S,e(this,c).querySelector("[data-outlet]")||((l=e(this,c).shadowRoot)==null?void 0:l.querySelector("[data-outlet]"))||e(this,c).shadowRoot||e(this,c)),o(this,P,!0)}e(this,w).disconnect()})}close(){var t;e(this,w).disconnect(),(t=e(this,c))==null||t.remove(),o(this,P,!1),e(this,E).forEach(s=>document.head.removeChild(s)),o(this,E,[])}getAnchorElements(){var s;let t=[];return e(this,c)&&(t=[...e(this,c).querySelectorAll("a")]),(s=e(this,c))!=null&&s.shadowRoot&&(t=[...t,...e(this,c).shadowRoot.querySelectorAll("a")]),t}}R=new WeakMap,x=new WeakMap,b=new WeakMap,m=new WeakMap,c=new WeakMap,P=new WeakMap,S=new WeakMap,w=new WeakMap,v=new WeakMap,E=new WeakMap,Y=new WeakSet,et=function(){return W(this,null,function*(){const t=e(this,v).filter(u=>u instanceof HTMLElement?u.tagName==="STYLE"||u.tagName==="SCRIPT"||u.tagName==="LINK":!1);try{for(var s=V(t),r,l,a;r=!(l=yield s.next()).done;r=!1){const u=l.value;yield new Promise(f=>{u.onload=()=>{f()}})}}catch(l){a=[l]}finally{try{r&&(l=s.return)&&(yield l.call(s))}finally{if(a)throw a[0]}}})};var H,g,A,U,M;class lt{constructor(t,s){n(this,H,void 0);n(this,g,void 0);n(this,A,void 0);n(this,U,void 0);n(this,M,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});o(this,H,t),o(this,g,s),o(this,A,e(this,g).getAttribute("href")||"/"),o(this,U,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,M)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,M)),e(this,g).classList.remove("current")}}H=new WeakMap,g=new WeakMap,A=new WeakMap,U=new WeakMap,M=new WeakMap;globalThis.URLPattern=nt.URLPattern;var k,q,p,N,j,y,C,B,z,F,st,G;const O=class O{constructor(t){n(this,F);n(this,k,null);n(this,q,void 0);n(this,p,[]);n(this,N,null);n(this,j,[]);n(this,y,void 0);n(this,C,null);n(this,B,new ot.Notifier);K(this,"preprocessor");K(this,"postprocessor");n(this,z,at.debounce(()=>{const t=s=>s.split("/").length;o(this,p,e(this,p).sort((s,r)=>t(s.pattern)-t(r.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));n(this,G,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),O.active=this,tt.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,G)))}get currentPathname(){return e(this,C)}get candidatePathname(){return e(this,y)}get routes(){return e(this,p)}navigationEvent(t){return e(this,B).subscribe(t)}defineRoute(t,s){const r=new ct(t,s);e(this,p).push(r),e(this,z).call(this)}navigate(t,s="push"){return W(this,null,function*(){var d,Z;if(e(this,y)===t||e(this,C)===t)return;O.active=this,o(this,y,t);const r=e(this,p).filter(h=>h.isActive),l=e(this,p).filter(h=>!r.includes(h)&&h.testPathname(t)),a=r.filter(h=>!h.testPathname(t)),u=r.filter(h=>h.testPathname(t));let f=!0;if(this.preprocessor)try{yield new Promise((h,L)=>{var _;(_=this.preprocessor)==null||_.call(this,{pathname:t,resolve:h,reject:L})})}catch(h){h?console.error(h):console.log("Route change canceled"),f=!1}if(f&&e(this,y)===t){o(this,N,u[u.length-1]),a.forEach(L=>{L.close()}),o(this,C,t);try{for(var T=V(l),mt,gt,pt;mt=!(gt=yield T.next()).done;mt=!1){const L=gt.value;yield L.render(((d=e(this,N))==null?void 0:d.outlet)||e(this,k),t),o(this,N,L)}}catch(gt){pt=[gt]}finally{try{mt&&(gt=T.return)&&(yield gt.call(T))}finally{if(pt)throw pt[0]}}const h=e(this,q)+t+location.search;s==="push"?history.pushState(h,"",h):s==="replace"&&history.replaceState(h,"",h),Q(this,F,st).call(this),(Z=this.postprocessor)==null||Z.call(this,{pathname:t}),e(this,B).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,p=new WeakMap,N=new WeakMap,j=new WeakMap,y=new WeakMap,C=new WeakMap,B=new WeakMap,z=new WeakMap,F=new WeakSet,st=function(){const t=e(this,p).filter(r=>r.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(r=>r.getAnchorElements()).flat()].filter(r=>{var l;return(l=r.getAttribute("href"))==null?void 0:l.startsWith("/")})));e(this,j).forEach(r=>{r.destroy()}),o(this,j,s.map(r=>new lt(this,r)))},G=new WeakMap,K(O,"active");let X=O;var I,D;class ut extends ht.CustomElement{constructor(s){super();n(this,I,void 0);n(this,D,void 0);o(this,I,s.pathnameParams),o(this,D,s.searchParams)}get pathnameParams(){return e(this,I)}get searchParams(){return e(this,D)}}I=new WeakMap,D=new WeakMap;exports.RouteElement=ut;exports.Router=X;
|
package/lib/router/index.js
CHANGED
|
@@ -30,8 +30,8 @@ var W = (i, t, s) => new Promise((r, l) => {
|
|
|
30
30
|
var Q = (i, t, s) => (t = i[Z("asyncIterator")]) ? t.call(i) : (i = i[Z("iterator")](), t = {}, s = (r, l) => (l = i[r]) && (t[r] = (a) => new Promise((u, d, f) => (a = l.call(i, a), f = a.done, Promise.resolve(a.value).then((T) => u({ value: T, done: f }), d)))), s("next"), s("return"), t);
|
|
31
31
|
import { URLPattern as ot } from "urlpattern-polyfill";
|
|
32
32
|
import { Notifier as nt } from "../notifier/index.js";
|
|
33
|
-
import { i as tt } from "../browser-
|
|
34
|
-
import { d as at } from "../function-
|
|
33
|
+
import { i as tt } from "../browser-0zX67oeU.js";
|
|
34
|
+
import { d as at } from "../function-C10DGppn.js";
|
|
35
35
|
import { CustomElement as ht } from "../custom-element/index.js";
|
|
36
36
|
var R, H, b, m, c, P, A, v, w, E, Y, et;
|
|
37
37
|
class ct {
|
|
@@ -6,23 +6,25 @@ import { Axes2D } from '../utils';
|
|
|
6
6
|
export type ScrollBehaviour = 'smooth' | 'instant';
|
|
7
7
|
export declare class ScrollElement extends CustomElement {
|
|
8
8
|
#private;
|
|
9
|
-
constructor();
|
|
9
|
+
constructor(name?: string);
|
|
10
10
|
get currentScrollValue(): number;
|
|
11
11
|
get targetScrollValue(): number;
|
|
12
12
|
get damped(): Damped;
|
|
13
13
|
get dampedAttibute(): Damped;
|
|
14
14
|
get axisAttibute(): Attribute<Axes2D>;
|
|
15
15
|
get pagesAttibute(): Attribute<number>;
|
|
16
|
+
get splitAttibute(): Attribute<boolean>;
|
|
16
17
|
get sectionalAttibute(): Attribute<boolean>;
|
|
17
18
|
get infiniteAttribute(): Attribute<boolean>;
|
|
18
|
-
get splitAttibute(): Attribute<boolean>;
|
|
19
19
|
get dampingAttibute(): Attribute<number>;
|
|
20
20
|
get disabledAttibute(): Attribute<boolean>;
|
|
21
21
|
get hibernatedAttibute(): Attribute<boolean>;
|
|
22
|
+
get contentElement(): HTMLElement;
|
|
22
23
|
get position(): number;
|
|
24
|
+
get contentPosition(): number;
|
|
23
25
|
get viewportSize(): number;
|
|
24
26
|
get scrollSize(): number;
|
|
25
|
-
get counter(): Store<number, import('../store').StoreEntry<number>>;
|
|
27
|
+
get counter(): Store<number, keyof import('../store').StoreManagers, import('../store').StoreEntry<number>>;
|
|
26
28
|
get distance(): number;
|
|
27
29
|
get overscroll(): number;
|
|
28
30
|
get vertical(): boolean;
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1,71 +1 @@
|
|
|
1
|
-
"use strict";var xt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var l=(i,e,s)=>(xt(i,e,"read from private field"),s?s.call(i):e.get(i)),T=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},V=(i,e,s,n)=>(xt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zt=require("../Store-WXFmsaEI.cjs"),Ct=require("../browser-QbF6EW-w.cjs"),ot=require("../layout-rZzbsLPd.cjs"),Wt=require("../math-FNUBmQPK.cjs");require("../ticker/index.cjs");const qt=require("../Damped-1hlKSFaB.cjs"),W=require("../attribute/index.cjs"),yt=require("../WheelControls-Hp5NWRZY.cjs"),pt=require("../custom-element/index.cjs"),wt=require("../order/index.cjs"),at=require("../resizer/index.cjs"),B=require("../scroll-entries/index.cjs"),Ot=require("../dom-QhWsdQS2.cjs");require("../intersector/index.cjs");require("../number-2bR0KBcX.cjs");require("../attributes-_2U65GDl.cjs");require("../notifier/index.cjs");require("../function-QP7IreXR.cjs");var Vt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,Pt=(i,e,s,n)=>{for(var c=n>1?void 0:n?$t(e,s):e,b=i.length-1,r;b>=0;b--)(r=i[b])&&(c=(n?r(e,s,c):r(c))||c);return n&&c&&Vt(e,s,c),c},_t=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(_t(i,e,"read from private field"),s?s.call(i):e.get(i)),o=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},w=(i,e,s,n)=>(_t(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),f=(i,e,s)=>(_t(i,e,"access private method"),s),a,M,A,L,x,y,D,H,I,d,u,j,_,p,O,G,m,J,$,N,ct,K,Q,ut,Et,dt,St,tt,mt,et,bt,R,ft,vt,kt,st,it,gt,E,g,P,C;class Rt{constructor(e,s){T(this,E,void 0);T(this,g,void 0);T(this,P,0);T(this,C,0);V(this,E,e),V(this,g,s),B.scrollEnties.register(l(this,E))}get size(){return l(this,P)}get position(){return l(this,C)}destroy(){B.scrollEnties.unregister(l(this,E)),l(this,E).style.transform=""}resize(){V(this,P,l(this,g).vertical?l(this,E).offsetHeight:l(this,E).offsetWidth),V(this,C,l(this,g).vertical?ot.getCumulativeOffsetTop(l(this,E)):ot.getCumulativeOffsetLeft(l(this,E))),V(this,C,l(this,C)-l(this,g).position)}transform(){let e=0;l(this,g).infiniteAttribute.current&&l(this,g).overscroll&&l(this,C)+l(this,P)<l(this,g).currentScrollValue&&(e=l(this,g).distance*-1),B.scrollEnties.update(l(this,E),l(this,g).axisAttibute.current,e);const s=Wt.clamp(l(this,g).currentScrollValue+e,l(this,C)-l(this,g).viewportSize,l(this,C)+l(this,P));l(this,g).vertical?l(this,E).style.transform=`translate3d(0px, ${s*-1}px, 0px)`:l(this,E).style.transform=`translate3d(${s*-1}px, 0px, 0px)`}}E=new WeakMap,g=new WeakMap,P=new WeakMap,C=new WeakMap;exports.ScrollElement=class extends pt.CustomElement{constructor(){if(super(),o(this,N),o(this,K),o(this,ut),o(this,dt),o(this,tt),o(this,et),o(this,vt),o(this,it),o(this,a,null),o(this,M,new W.Attribute(this,"axis","y")),o(this,A,new W.Attribute(this,"pages",0,{validate:e=>Math.max(0,e-1)})),o(this,L,new W.Attribute(this,"sectional",!1)),o(this,x,new W.Attribute(this,"infinite",!1)),o(this,y,new W.Attribute(this,"split",!1)),o(this,D,new W.Attribute(this,"damping",.03)),o(this,H,new W.Attribute(this,"disabled",!1)),o(this,I,new W.Attribute(this,"hibernated",!1)),o(this,d,null),o(this,u,[]),o(this,j,0),o(this,_,0),o(this,p,0),o(this,O,null),o(this,G,null),o(this,m,new zt.Store(0)),o(this,J,0),o(this,$,0),o(this,R,()=>{const e=this.currentScrollValue/t(this,p);if(w(this,j,this.vertical?ot.getCumulativeOffsetTop(this):ot.getCumulativeOffsetLeft(this)),w(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,A).current){w(this,p,t(this,_)*t(this,A).current);const s=t(this,p)+t(this,_);this.vertical?(t(this,d).style.width=s+"px",t(this,d).style.height="100%"):(t(this,d).style.height=s+"px",t(this,d).style.width="100%")}else this.vertical?(t(this,d).style.width="100%",t(this,d).style.height="max-content",w(this,p,t(this,d).offsetHeight-t(this,_))):(t(this,d).style.width="max-content",t(this,d).style.height="100%",w(this,p,t(this,d).offsetWidth-t(this,_)));if(t(this,x)||(t(this,a).max=t(this,p)),t(this,u).forEach(s=>{s.resize(),s.transform()}),t(this,x).current&&t(this,u).length){const s=t(this,u)[t(this,u).length-1],n=s.position+s.size-t(this,_),c=t(this,p)-n;w(this,$,s.position+s.size+c)}else w(this,$,t(this,p));if(t(this,L).current&&t(this,u).length){const s=t(this,u)[t(this,m).current];t(this,a).set(s.position,!0)}else t(this,a).set(e*t(this,p),!0)}),o(this,ft,()=>{if(t(this,u).length){let e=0;for(let s=0;s<t(this,u).length;s++){const n=t(this,u)[s];n.transform(),this.targetScrollValue>=n.position&&(e=s)}t(this,m).current=e}else this.vertical?t(this,d).style.transform=`translate3d(0px, ${this.currentScrollValue*-1}px, 0px)`:t(this,d).style.transform=`translate3d(${this.currentScrollValue*-1}px, 0px, 0px)`;B.scrollEnties.update(this,t(this,M).current,this.currentScrollValue)}),o(this,st,e=>{if(typeof e=="number")if(t(this,L).current){const s=Math.sign(e);t(this,u).length?this.shiftSections(s):t(this,a).shift(s*t(this,_))}else t(this,a).shift(e);else e==="min"?t(this,a).set(t(this,a).min):e==="max"&&t(this,a).set(t(this,a).delta)}),Ct.isBrowser){w(this,a,new qt.Damped({damping:.01,min:0,order:wt.TICK_ORDER.SCROLL}));const e=this.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=`
|
|
2
|
-
:host {
|
|
3
|
-
position: relative;
|
|
4
|
-
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
|
|
8
|
-
display: block;
|
|
9
|
-
outline: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host([hibernated="true"]) {
|
|
13
|
-
display: contents;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.static {
|
|
17
|
-
position: absolute;
|
|
18
|
-
top: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
|
|
21
|
-
z-index: 1;
|
|
22
|
-
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.content {
|
|
29
|
-
display: flex;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host([hibernated="true"]) .content {
|
|
33
|
-
display: contents;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
::slotted(*) {
|
|
37
|
-
flex-shrink: 0;
|
|
38
|
-
}
|
|
39
|
-
`,e.appendChild(s),this.tabIndex=0;const n=document.createElement("div");n.classList.add("static"),e.appendChild(n);const c=document.createElement("slot");c.setAttribute("name","static"),n.appendChild(c),w(this,d,document.createElement("div")),t(this,d).classList.add("content"),e.appendChild(t(this,d));const b=document.createElement("slot");t(this,d).appendChild(b),w(this,O,new yt.WheelControls({element:this})),t(this,O).changeEvent.subscribe(t(this,st)),w(this,G,new yt.KeyboardControls({element:this})),t(this,G).changeEvent.subscribe(t(this,st)),t(this,M).subscribe(({current:r})=>{t(this,d).style.flexDirection=r==="x"?"row":"column",t(this,O).axis=r,this.isConnected&&t(this,R).call(this)}),t(this,A).subscribe(()=>{this.isConnected&&t(this,R).call(this)}),t(this,L).subscribe(r=>{t(this,m).current=0,t(this,O).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ct).call(this):!r.current&&r.previous&&f(this,K,Q).call(this))}),t(this,x).subscribe(r=>{r.current?(this.isConnected&&(t(this,u).length||(t(this,y).current=!0)),t(this,u).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(w(this,J,0),t(this,a).max=t(this,p),t(this,a).min=0)}),t(this,y).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ct).call(this):f(this,K,Q).call(this))}),t(this,D).subscribe(r=>{t(this,a).damping=r.current}),t(this,H).subscribe(r=>{r.current&&!r.previous?f(this,ut,Et).call(this):!r.current&&r.previous&&f(this,dt,St).call(this)}),t(this,I).subscribe(r=>{r.current&&!r.previous?f(this,tt,mt).call(this):!r.current&&r.previous&&f(this,et,bt).call(this)})}}get currentScrollValue(){return f(this,it,gt).call(this,"current")}get targetScrollValue(){return f(this,it,gt).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,A)}get sectionalAttibute(){return t(this,L)}get infiniteAttribute(){return t(this,x)}get splitAttibute(){return t(this,y)}get dampingAttibute(){return t(this,D)}get disabledAttibute(){return t(this,H)}get hibernatedAttibute(){return t(this,I)}get position(){return t(this,j)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,m)}get distance(){return t(this,$)}get overscroll(){return t(this,J)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,$)}get targetProgress(){return this.targetScrollValue/t(this,$)}scrollToSection(e,s="smooth"){if(!t(this,u).length)return;const n=t(this,m).current;f(this,vt,kt).call(this,e);const c=t(this,u)[n],b=t(this,u)[t(this,m).current];if(c&&b){let r=0;const Y=t(this,u).length-1;t(this,m).current===0&&n===Y?r=t(this,p)+t(this,_)-c.position:t(this,m).current===Y&&n===0?r=b.position-(t(this,p)+t(this,_)):r=b.position-c.position,t(this,a).shift(r,s==="instant")}}shiftSections(e,s="smooth"){t(this,u).length&&this.scrollToSection(t(this,m).current+e,s)}connectedCallback(){f(this,et,bt).call(this),t(this,M).observe(),t(this,A).observe(),t(this,L).observe(),t(this,x).observe(),t(this,y).observe(),t(this,D).observe(),t(this,H).observe(),t(this,I).observe()}disconnectedCallback(){f(this,tt,mt).call(this),t(this,M).unobserve(),t(this,A).unobserve(),t(this,L).unobserve(),t(this,x).unobserve(),t(this,y).unobserve(),t(this,D).unobserve(),t(this,H).unobserve(),t(this,I).unobserve()}};a=new WeakMap;M=new WeakMap;A=new WeakMap;L=new WeakMap;x=new WeakMap;y=new WeakMap;D=new WeakMap;H=new WeakMap;I=new WeakMap;d=new WeakMap;u=new WeakMap;j=new WeakMap;_=new WeakMap;p=new WeakMap;O=new WeakMap;G=new WeakMap;m=new WeakMap;J=new WeakMap;$=new WeakMap;N=new WeakSet;ct=function(){f(this,K,Q).call(this),t(this,d).querySelector("slot").assignedElements().forEach(e=>{e instanceof HTMLElement&&t(this,u).push(new Rt(e,this))}),t(this,d).style.transform="",t(this,R).call(this)};K=new WeakSet;Q=function(){t(this,u).forEach(i=>{i.destroy()}),w(this,u,[])};ut=new WeakSet;Et=function(){t(this,a).unsubscribe(t(this,ft)),t(this,a).unlistenAnimationFrame(),t(this,O).disconnect(),t(this,G).disconnect()};dt=new WeakSet;St=function(){t(this,a).subscribe(t(this,ft)),t(this,O).connect(),t(this,G).connect()};tt=new WeakSet;mt=function(){at.resizer.unsubscribe(t(this,R)),t(this,a).reset(),f(this,ut,Et).call(this),t(this,d).style.transform="",t(this,y).current&&f(this,K,Q).call(this),B.scrollEnties.unregister(this)};et=new WeakSet;bt=function(){t(this,y).current&&f(this,N,ct).call(this),B.scrollEnties.register(this),at.resizer.subscribe(t(this,R),wt.RESIZE_ORDER.SCROLL),f(this,dt,St).call(this)};R=new WeakMap;ft=new WeakMap;vt=new WeakSet;kt=function(i){t(this,x).current?(t(this,m).current=i%t(this,u).length,t(this,m).current=t(this,m).current<0?t(this,u).length+t(this,m).current:t(this,m).current):t(this,m).current=Wt.clamp(i,0,t(this,u).length-1)};st=new WeakMap;it=new WeakSet;gt=function(i="current"){if(t(this,x).current&&t(this,u).length){const e=t(this,a)[i]%(t(this,p)+t(this,_)),s=e<0?t(this,p)+e+t(this,_):e;return w(this,J,Math.max(0,s-t(this,p))),s}else return t(this,a)[i]};exports.ScrollElement=Pt([pt.define("e-scroll")],exports.ScrollElement);var X;class Tt extends pt.CustomElement{constructor(){super(...arguments);T(this,X,null)}get scrollElement(){return l(this,X)}connectedCallback(){const s=Ot.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?V(this,X,s):console.error(this,"e-scroll not found")}}X=new WeakMap;var Dt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,It=(i,e,s,n)=>{for(var c=n>1?void 0:n?Ht(e,s):e,b=i.length-1,r;b>=0;b--)(r=i[b])&&(c=(n?r(e,s,c):r(c))||c);return n&&c&&Dt(e,s,c),c},Mt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},h=(i,e,s)=>(Mt(i,e,"read from private field"),s?s.call(i):e.get(i)),S=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},k=(i,e,s,n)=>(Mt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),Z,v,z,q,F,U,rt,nt,ht,lt;exports.ScrollbarElement=class extends Tt{constructor(){if(super(),S(this,Z,null),S(this,v,null),S(this,z,!1),S(this,q,0),S(this,F,0),S(this,U,0),S(this,rt,()=>{k(this,z,this.offsetWidth>this.offsetHeight);const e=h(this,z)?this.offsetWidth:this.offsetHeight;k(this,q,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),k(this,q,Math.max(h(this,q),30)),h(this,z)?(h(this,v).style.width=h(this,q)+"px",h(this,v).style.height="100%"):(h(this,v).style.width="100%",h(this,v).style.height=h(this,q)+"px"),k(this,F,e-h(this,q)),this.scrollElement.scrollSize||(this.style.display="none")}),S(this,nt,()=>{k(this,U,this.scrollElement.currentProgress*h(this,F)),h(this,z)?h(this,v).style.transform=`translate3d(${h(this,U)}px, 0px, 0px)`:h(this,v).style.transform=`translate3d(0px, ${h(this,U)}px, 0px)`}),S(this,ht,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),S(this,lt,e=>{const s=r=>{const Y=h(this,z)?r.x:r.y,At=this.scrollElement.distance/h(this,F),Lt=(Y-b)*At;this.scrollElement.damped.set(c+Lt)},n=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",s),addEventListener("pointerup",n),addEventListener("touchend",n);const c=this.scrollElement.damped.target,b=h(this,z)?e.x:e.y}),Ct.isBrowser){const e=this.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=`
|
|
40
|
-
:host {
|
|
41
|
-
display: inline-block;
|
|
42
|
-
z-index: 1;
|
|
43
|
-
background-color: #efefef;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:host([axis="y"]) {
|
|
47
|
-
position: absolute;
|
|
48
|
-
right: 0;
|
|
49
|
-
top: 0;
|
|
50
|
-
width: 1vmin;
|
|
51
|
-
height: 100%;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:host([axis="x"]) {
|
|
55
|
-
position: absolute;
|
|
56
|
-
left: 0;
|
|
57
|
-
bottom: 0;
|
|
58
|
-
width: 100%;
|
|
59
|
-
height: 1vmin;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.default-thumb {
|
|
63
|
-
background-color: #181818;
|
|
64
|
-
border-radius: 1vmin;
|
|
65
|
-
touch-action: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
::slotted(*) {
|
|
69
|
-
touch-action: none;
|
|
70
|
-
}
|
|
71
|
-
`,e.appendChild(s),k(this,Z,document.createElement("slot")),e.appendChild(h(this,Z))}}get thumbElement(){return h(this,v)}connectedCallback(){super.connectedCallback();const e=h(this,Z).assignedElements()[0];e instanceof HTMLElement?k(this,v,e):(k(this,v,document.createElement("div")),h(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(h(this,v))),h(this,v).addEventListener("pointerdown",h(this,lt)),at.resizer.subscribe(h(this,rt),wt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(h(this,nt)),this.scrollElement.axisAttibute.subscribe(h(this,ht))}disconnectedCallback(){h(this,v).removeEventListener("pointerdown",h(this,lt)),at.resizer.unsubscribe(h(this,rt)),this.scrollElement.damped.unsubscribe(h(this,nt)),this.scrollElement.axisAttibute.unsubscribe(h(this,ht))}};Z=new WeakMap;v=new WeakMap;z=new WeakMap;q=new WeakMap;F=new WeakMap;U=new WeakMap;rt=new WeakMap;nt=new WeakMap;ht=new WeakMap;lt=new WeakMap;exports.ScrollbarElement=It([pt.define("e-scrollbar")],exports.ScrollbarElement);
|
|
1
|
+
"use strict";var Ct=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var h=(i,e,s)=>(Ct(i,e,"read from private field"),s?s.call(i):e.get(i)),$=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},O=(i,e,s,n)=>(Ct(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tt=require("../Store-BOOfmlyv.cjs"),Dt=require("../Derived-CqmIkTGN.cjs"),At=require("../browser-CpzFX2xg.cjs"),V=require("../layout-8ryRAMGJ.cjs"),zt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const Vt=require("../Damped--qBZAdEi.cjs"),x=require("../attribute/index.cjs"),Mt=require("../WheelControls-CfDeGCOU.cjs"),wt=require("../custom-element/index.cjs"),xt=require("../order/index.cjs"),pt=require("../window-resizer/index.cjs"),I=require("../scroll-entries/index.cjs"),Lt=require("../ElementConstructor-v1FPLXAW.cjs"),B=require("../htmlTags-CwYHVo9n.cjs"),Ot=require("../createStylesheet-ChhZFwSX.cjs"),It=require("../dom-qY2LdCVL.cjs");var Ht=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Bt=(i,e,s,n)=>{for(var r=n>1?void 0:n?Ft(e,s):e,d=i.length-1,w;d>=0;d--)(w=i[d])&&(r=(n?w(e,s,r):w(r))||r);return n&&r&&Ht(e,s,r),r},yt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(yt(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},m=(i,e,s,n)=>(yt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),f=(i,e,s)=>(yt(i,e,"access private method"),s),a,M,T,q,D,X,y,Y,j,tt,u,dt,c,et,st,_,p,k,H,b,G,R,N,ft,F,U,mt,kt,bt,Wt,it,vt,rt,_t,P,gt,St,Rt,nt,ht,Et,S,g,L,W;class Gt{constructor(e,s){$(this,S,void 0);$(this,g,void 0);$(this,L,0);$(this,W,0);O(this,S,e),O(this,g,s),I.scrollEntries.register(h(this,S))}get size(){return h(this,L)}get position(){return h(this,W)}destroy(){I.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){O(this,L,h(this,g).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),O(this,W,h(this,g).vertical?V.getCumulativeOffsetTop(h(this,S)):V.getCumulativeOffsetLeft(h(this,S))),O(this,W,h(this,W)-h(this,g).contentPosition)}transform(){let e=0;h(this,g).infiniteAttribute.current&&h(this,g).overscroll&&h(this,W)+h(this,L)<h(this,g).currentScrollValue&&(e=h(this,g).distance*-1),I.scrollEntries.update(h(this,S),h(this,g).axisAttibute.current,e);const s=h(this,g).viewportSize-h(this,L),n=zt.clamp(h(this,g).currentScrollValue+e,h(this,W)-h(this,g).viewportSize-s,h(this,W)+h(this,L)+s);h(this,g).vertical?h(this,S).style.transform=`translate3d(0px, ${n*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${n*-1}px, 0px, 0px)`}}S=new WeakMap,g=new WeakMap,L=new WeakMap,W=new WeakMap;const Kt=Ot.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends wt.CustomElement{constructor(e){if(super(),l(this,N),l(this,F),l(this,mt),l(this,bt),l(this,it),l(this,rt),l(this,St),l(this,ht),l(this,a,null),l(this,M,new x.Attribute(this,"axis","y")),l(this,T,new x.Attribute(this,"pages",0,{validate:s=>Math.max(0,s-1)})),l(this,q,new x.Attribute(this,"split",!1)),l(this,D,new x.Attribute(this,"sectional",!1)),l(this,X,new x.Attribute(this,"wheel-max-delta",!1)),l(this,y,new x.Attribute(this,"infinite",!1)),l(this,Y,new x.Attribute(this,"damping",.03)),l(this,j,new x.Attribute(this,"disabled",!1)),l(this,tt,new x.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,et,0),l(this,st,0),l(this,_,0),l(this,p,0),l(this,k,null),l(this,H,null),l(this,b,new Tt.Store(0)),l(this,G,0),l(this,R,0),l(this,P,()=>{const s=this.currentScrollValue/t(this,p);if(m(this,et,this.vertical?V.getCumulativeOffsetTop(this):V.getCumulativeOffsetLeft(this)),m(this,st,this.vertical?V.getCumulativeOffsetTop(t(this,u)):V.getCumulativeOffsetLeft(t(this,u))),m(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,T).current){m(this,p,t(this,_)*t(this,T).current);const n=t(this,p)+t(this,_);this.vertical?(t(this,u).style.width=n+"px",t(this,u).style.height="100%"):(t(this,u).style.height=n+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",m(this,p,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",m(this,p,t(this,u).offsetWidth-t(this,_)));if(!t(this,y).current){const n=getComputedStyle(this);m(this,p,t(this,p)+(this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd))),t(this,a).max.current=t(this,p)}if(t(this,c).forEach(n=>{n.resize(),n.transform()}),t(this,y).current&&t(this,c).length){const n=t(this,c)[t(this,c).length-1],r=n.position+n.size-t(this,_),d=t(this,p)-r;m(this,R,n.position+n.size+d)}else m(this,R,t(this,p));if(t(this,D).current&&t(this,c).length){const n=t(this,c)[t(this,b).current];t(this,a).set(n.position,!0)}else t(this,a).set(s*t(this,p),!0)}),l(this,gt,()=>{const s=this.currentScrollValue;if(m(this,G,Math.max(0,s-t(this,p))),t(this,c).length){let n=0;for(let r=0;r<t(this,c).length;r++){const d=t(this,c)[r];d.transform(),this.targetScrollValue+this.viewportSize/2>=d.position&&(n=r)}t(this,b).current=n}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${s*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${s*-1}px, 0px, 0px)`;I.scrollEntries.update(this,t(this,M).current,s)}),l(this,nt,s=>{if(typeof s=="number")if(t(this,D).current){const n=Math.sign(s);t(this,c).length?this.shiftSections(n):t(this,a).shift(n*t(this,_))}else t(this,a).shift(s);else s==="min"?t(this,a).set(t(this,a).min.current):s==="max"&&t(this,a).set(t(this,a).delta)}),At.isBrowser){let s,n=e||this.getAttribute("name");n&&(s={name:n}),m(this,a,new Vt.Damped({damping:.01,min:0,order:xt.TICK_ORDER.SCROLL,passport:s})),this.openShadow(Kt),Lt.element(this,{attributes:{tabIndex:0},shadowChildren:[B.div({class:"static",children:[B.slot({attributes:{name:"static"}})]}),B.div({class:"content",children:[B.slot({ref:r=>m(this,dt,r)})],style:{flexDirection:new Dt.Derived(t(this,M),r=>r==="x"?"row":"column")},ref:r=>m(this,u,r)})]}),m(this,k,new Mt.WheelControls({element:this})),t(this,k).changeEvent.subscribe(t(this,nt)),m(this,H,new Mt.KeyboardControls({element:this})),t(this,H).changeEvent.subscribe(t(this,nt)),t(this,M).subscribe(({current:r})=>{t(this,u).style.flexDirection=r==="x"?"row":"column",t(this,k).axis=t(this,X).current?"max":r,this.isConnected&&t(this,P).call(this)}),t(this,X).subscribe(r=>{t(this,k).axis=r.current?"max":t(this,M).current}),t(this,T).subscribe(()=>{this.isConnected&&t(this,P).call(this)}),t(this,q).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ft).call(this):f(this,F,U).call(this))}),t(this,D).subscribe(r=>{t(this,b).current=0,t(this,k).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ft).call(this):!r.current&&r.previous&&f(this,F,U).call(this))}),t(this,y).subscribe(r=>{r.current?(this.isConnected&&(t(this,c).length||(t(this,q).current=!0)),t(this,c).length&&(t(this,a).max.current=1/0,t(this,a).min.current=-1/0)):(m(this,G,0),t(this,a).max.current=t(this,p),t(this,a).min.current=0)}),t(this,Y).subscribe(r=>{t(this,a).damping=r.current}),t(this,j).subscribe(r=>{r.current&&!r.previous?f(this,mt,kt).call(this):!r.current&&r.previous&&f(this,bt,Wt).call(this)}),t(this,tt).subscribe(r=>{r.current&&!r.previous?f(this,it,vt).call(this):!r.current&&r.previous&&f(this,rt,_t).call(this)})}}get currentScrollValue(){return f(this,ht,Et).call(this,"current")}get targetScrollValue(){return f(this,ht,Et).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,T)}get splitAttibute(){return t(this,q)}get sectionalAttibute(){return t(this,D)}get infiniteAttribute(){return t(this,y)}get dampingAttibute(){return t(this,Y)}get disabledAttibute(){return t(this,j)}get hibernatedAttibute(){return t(this,tt)}get contentElement(){return t(this,u)}get position(){return t(this,et)}get contentPosition(){return t(this,st)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,b)}get distance(){return t(this,R)}get overscroll(){return t(this,G)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,R)}get targetProgress(){return this.targetScrollValue/t(this,R)}scrollToSection(e,s="smooth"){if(!t(this,c).length)return;const n=t(this,b).current;f(this,St,Rt).call(this,e);const r=t(this,c)[n],d=t(this,c)[t(this,b).current];if(r&&d){let w=0;const Q=t(this,c).length-1;t(this,y).current?t(this,b).current===0&&n===Q?w=t(this,p)+t(this,_)-r.position:t(this,b).current===Q&&n===0?w=d.position-(t(this,p)+t(this,_)):w=d.position-r.position:w=d.position-r.position,t(this,a).shift(w,s==="instant")}}shiftSections(e,s="smooth"){t(this,c).length&&this.scrollToSection(t(this,b).current+e,s)}connectedCallback(){f(this,rt,_t).call(this)}disconnectedCallback(){f(this,it,vt).call(this)}};a=new WeakMap;M=new WeakMap;T=new WeakMap;q=new WeakMap;D=new WeakMap;X=new WeakMap;y=new WeakMap;Y=new WeakMap;j=new WeakMap;tt=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;et=new WeakMap;st=new WeakMap;_=new WeakMap;p=new WeakMap;k=new WeakMap;H=new WeakMap;b=new WeakMap;G=new WeakMap;R=new WeakMap;N=new WeakSet;ft=function(){f(this,F,U).call(this),t(this,dt).assignedElements().forEach(i=>{i instanceof HTMLElement&&t(this,c).push(new Gt(i,this))}),t(this,u).style.transform="",t(this,P).call(this)};F=new WeakSet;U=function(){t(this,c).forEach(i=>{i.destroy()}),m(this,c,[])};mt=new WeakSet;kt=function(){t(this,a).unsubscribe(t(this,gt)),t(this,a).unlistenAnimationFrame(),t(this,k).disconnect(),t(this,H).disconnect()};bt=new WeakSet;Wt=function(){t(this,a).subscribe(t(this,gt)),t(this,k).connect(),t(this,H).connect()};it=new WeakSet;vt=function(){pt.windowResizer.unsubscribe(t(this,P)),t(this,a).reset(),f(this,mt,kt).call(this),t(this,u).style.transform="",t(this,q).current&&f(this,F,U).call(this),I.scrollEntries.unregister(this)};rt=new WeakSet;_t=function(){t(this,q).current&&f(this,N,ft).call(this),I.scrollEntries.register(this),pt.windowResizer.subscribe(t(this,P),xt.RESIZE_ORDER.SCROLL),f(this,bt,Wt).call(this)};P=new WeakMap;gt=new WeakMap;St=new WeakSet;Rt=function(i){t(this,y).current?(t(this,b).current=i%t(this,c).length,t(this,b).current=t(this,b).current<0?t(this,c).length+t(this,b).current:t(this,b).current):t(this,b).current=zt.clamp(i,0,t(this,c).length-1)};nt=new WeakMap;ht=new WeakSet;Et=function(i="current"){if(t(this,y).current&&t(this,c).length){const e=t(this,a)[i]%(t(this,p)+t(this,_));return e<0?t(this,p)+e+t(this,_):e}else return t(this,a)[i]};exports.ScrollElement=Bt([wt.define("e-scroll")],exports.ScrollElement);var J;class Zt extends wt.CustomElement{constructor(){super(...arguments);$(this,J,null)}get scrollElement(){return h(this,J)}connectedCallback(){const s=It.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?O(this,J,s):console.error(this,"e-scroll not found")}}J=new WeakMap;var Nt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Jt=(i,e,s,n)=>{for(var r=n>1?void 0:n?Ut(e,s):e,d=i.length-1,w;d>=0;d--)(w=i[d])&&(r=(n?w(e,s,r):w(r))||r);return n&&r&&Nt(e,s,r),r},qt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},o=(i,e,s)=>(qt(i,e,"read from private field"),s?s.call(i):e.get(i)),E=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},C=(i,e,s,n)=>(qt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),lt,v,A,z,K,Z,ot,at,ct,ut;const Qt=Ot.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Zt{constructor(){super(),E(this,lt,null),E(this,v,null),E(this,A,!1),E(this,z,0),E(this,K,0),E(this,Z,0),E(this,ot,()=>{C(this,A,this.offsetWidth>this.offsetHeight);const e=o(this,A)?this.offsetWidth:this.offsetHeight;C(this,z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),C(this,z,Math.max(o(this,z),30)),o(this,A)?(o(this,v).style.width=o(this,z)+"px",o(this,v).style.height="100%"):(o(this,v).style.width="100%",o(this,v).style.height=o(this,z)+"px"),C(this,K,e-o(this,z)),this.scrollElement.scrollSize||(this.style.display="none")}),E(this,at,()=>{C(this,Z,this.scrollElement.currentProgress*o(this,K)),o(this,A)?o(this,v).style.transform=`translate3d(${o(this,Z)}px, 0px, 0px)`:o(this,v).style.transform=`translate3d(0px, ${o(this,Z)}px, 0px)`}),E(this,ct,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),E(this,ut,e=>{const s=w=>{const Q=o(this,A)?w.x:w.y,Pt=this.scrollElement.distance/o(this,K),$t=(Q-d)*Pt;this.scrollElement.damped.set(r+$t)},n=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",s),addEventListener("pointerup",n),addEventListener("touchend",n);const r=this.scrollElement.damped.target,d=o(this,A)?e.x:e.y}),At.isBrowser&&(this.openShadow(Qt),Lt.element(this,{shadowChildren:[B.slot({ref:e=>C(this,lt,e)})]}))}get thumbElement(){return o(this,v)}connectedCallback(){super.connectedCallback();const e=o(this,lt).assignedElements()[0];e instanceof HTMLElement?C(this,v,e):(C(this,v,document.createElement("div")),o(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,v))),o(this,v).addEventListener("pointerdown",o(this,ut)),pt.windowResizer.subscribe(o(this,ot),xt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(o(this,at)),this.scrollElement.axisAttibute.subscribe(o(this,ct))}disconnectedCallback(){o(this,v).removeEventListener("pointerdown",o(this,ut)),pt.windowResizer.unsubscribe(o(this,ot)),this.scrollElement.damped.unsubscribe(o(this,at)),this.scrollElement.axisAttibute.unsubscribe(o(this,ct))}};lt=new WeakMap;v=new WeakMap;A=new WeakMap;z=new WeakMap;K=new WeakMap;Z=new WeakMap;ot=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;exports.ScrollbarElement=Jt([wt.define("e-scrollbar")],exports.ScrollbarElement);
|