aptechka 0.61.14 → 0.62.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.
@@ -1 +1 @@
1
- "use strict";var f=s=>{throw TypeError(s)};var p=(s,l,t)=>l.has(s)||f("Cannot "+t);var e=(s,l,t)=>(p(s,l,"read from private field"),t?t.call(s):l.get(s)),n=(s,l,t)=>l.has(s)?f("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(s):l.set(s,t),u=(s,l,t,i)=>(p(s,l,"write to private field"),i?i.call(s,t):l.set(s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../element-resizer/index.cjs"),L=require("../window-resizer/index.cjs"),q=require("../index-Cqw2NKev.cjs"),T=require("../dom-JBOkFLTh.cjs"),k=require("../gestures-C7gbKx11.cjs"),S=require("../ticker/index.cjs");var r,o,a,h,m,d,c,b,g;class x extends HTMLElement{constructor(){super(...arguments);n(this,r,null);n(this,o,null);n(this,a,0);n(this,h,0);n(this,m);n(this,d,()=>{this.classList.add("active"),clearTimeout(e(this,m));const t=e(this,r).scrollTop/e(this,h)*e(this,a);e(this,o).style.transform=`translate3d(0px, ${t}px, 0px)`,u(this,m,setTimeout(()=>{this.classList.remove("active")},1e3))});n(this,c,()=>{const t=this.offsetHeight;u(this,h,e(this,r).scrollHeight-e(this,r).offsetHeight);let i=t/(e(this,h)/t);i=Math.max(i,30),e(this,o).style.width="100%",e(this,o).style.height=i+"px",u(this,a,t-i),e(this,r).scrollHeight>e(this,r).offsetHeight||(this.style.display="none")});n(this,b,t=>{document.documentElement.classList.add("grabbing"),k.setupDrag(y=>{const w=e(this,h)/e(this,a),z=(y.y-E)*w;e(this,r).scroll({top:i+z,behavior:"instant"})},()=>{document.documentElement.classList.remove("grabbing")});const i=e(this,r).scrollTop,E=t.y});n(this,g,()=>{e(this,c).call(this)})}connectedCallback(){const t=this.getAttribute("data-scroll");let i=null;t&&(i=document.querySelector(t)),i||(i=T.findScrollParentElement(this));const E=this.querySelector("[data-thumb]");i&&E&&(u(this,r,i),u(this,o,E),v.elementResizer.subscribe(e(this,r),e(this,c)),L.windowResizer.subscribe(e(this,c)),e(this,r).addEventListener("scroll",e(this,d)),e(this,o).addEventListener("pointerdown",e(this,b)),S.ticker.subscribe(e(this,g),{maxFPS:5}))}disconnectedCallback(){v.elementResizer.unsubscribe(e(this,c)),L.windowResizer.unsubscribe(e(this,c)),e(this,r).removeEventListener("scroll",e(this,d)),e(this,o).removeEventListener("pointerdown",e(this,b)),clearTimeout(e(this,m)),S.ticker.unsubscribe(e(this,g))}}r=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,m=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,g=new WeakMap;q.isBrowser&&!customElements.get("e-custom-scrollbar")&&customElements.define("e-custom-scrollbar",x);exports.CustomScrollbarElement=x;
1
+ "use strict";var v=l=>{throw TypeError(l)};var k=(l,o,s)=>o.has(l)||v("Cannot "+s);var t=(l,o,s)=>(k(l,o,"read from private field"),s?s.call(l):o.get(l)),h=(l,o,s)=>o.has(l)?v("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,s),c=(l,o,s,e)=>(k(l,o,"write to private field"),e?e.call(l,s):o.set(l,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../index-Cqw2NKev.cjs"),q=require("../dom-JBOkFLTh.cjs"),z=require("../gestures-C7gbKx11.cjs"),E=require("../ticker/index.cjs");var i,n,u,a,r,m,f,y,p,d,g;class T extends HTMLElement{constructor(){super(...arguments);h(this,i,null);h(this,n,null);h(this,u,0);h(this,a,0);h(this,r,!1);h(this,m);h(this,f,()=>{this.classList.add("active"),clearTimeout(t(this,m));const e=(t(this,r)?t(this,i).scrollLeft:t(this,i).scrollTop)/t(this,a)*t(this,u);t(this,r)?t(this,n).style.transform=`translate3d(${e}px, 0px, 0px)`:t(this,n).style.transform=`translate3d(0px, ${e}px, 0px)`,c(this,m,setTimeout(()=>{this.classList.remove("active")},1e3))});h(this,y,()=>{const s=t(this,r)?this.offsetWidth:this.offsetHeight;c(this,a,t(this,r)?t(this,i).scrollWidth-t(this,i).offsetWidth:t(this,i).scrollHeight-t(this,i).offsetHeight);let e=s*s/(t(this,a)+s);e=Math.max(e,30),t(this,r)?(t(this,n).style.width=e+"px",t(this,n).style.height="100%"):(t(this,n).style.width="100%",t(this,n).style.height=e+"px"),c(this,u,s-e),t(this,r)&&!(t(this,i).scrollWidth>t(this,i).offsetWidth)||!t(this,r)&&!(t(this,i).scrollHeight>t(this,i).offsetHeight)?this.style.display="none":this.style.display="block"});h(this,p,s=>{document.documentElement.classList.add("grabbing");const e=t(this,r)?t(this,i).scrollLeft:t(this,i).scrollTop,b=t(this,r)?s.x:s.y;z.setupDrag(x=>{const H=t(this,a)/t(this,u),S=(t(this,r)?x.x-b:x.y-b)*H;t(this,r)?t(this,i).scroll({left:e+S,behavior:"instant"}):t(this,i).scroll({top:e+S,behavior:"instant"})},()=>{document.documentElement.classList.remove("grabbing")})});h(this,d,()=>{t(this,y).call(this)});h(this,g,s=>{s.isIntersecting?E.ticker.subscribe(t(this,d),{maxFPS:5}):E.ticker.unsubscribe(t(this,d))})}connectedCallback(){const s=this.getAttribute("data-scroll");c(this,r,this.getAttribute("orientation")==="horizontal");let e=null;s&&(s==="parent"?e=this.parentElement:e=document.querySelector(s)),e||(e=q.findScrollParentElement(this));const b=this.querySelector("[data-thumb]");e&&b&&(c(this,i,e),c(this,n,b),t(this,i).addEventListener("scroll",t(this,f)),t(this,n).addEventListener("pointerdown",t(this,p)),L.intersector.subscribe(this.parentElement,t(this,g)))}disconnectedCallback(){t(this,i).removeEventListener("scroll",t(this,f)),t(this,n).removeEventListener("pointerdown",t(this,p)),clearTimeout(t(this,m)),L.intersector.unsubscribe(t(this,g)),E.ticker.unsubscribe(t(this,d))}}i=new WeakMap,n=new WeakMap,u=new WeakMap,a=new WeakMap,r=new WeakMap,m=new WeakMap,f=new WeakMap,y=new WeakMap,p=new WeakMap,d=new WeakMap,g=new WeakMap;L.isBrowser&&!customElements.get("e-custom-scrollbar")&&customElements.define("e-custom-scrollbar",T);exports.CustomScrollbarElement=T;
@@ -1,6 +1,3 @@
1
- /**
2
- * TODO horisontal
3
- */
4
1
  export declare class CustomScrollbarElement extends HTMLElement {
5
2
  #private;
6
3
  protected connectedCallback(): void;
@@ -1,42 +1,46 @@
1
- var g = (e) => {
2
- throw TypeError(e);
1
+ var v = (l) => {
2
+ throw TypeError(l);
3
3
  };
4
- var E = (e, o, s) => o.has(e) || g("Cannot " + s);
5
- var t = (e, o, s) => (E(e, o, "read from private field"), s ? s.call(e) : o.get(e)), l = (e, o, s) => o.has(e) ? g("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, s), m = (e, o, s, i) => (E(e, o, "write to private field"), i ? i.call(e, s) : o.set(e, s), s);
6
- import { elementResizer as L } from "../element-resizer/index.js";
7
- import { windowResizer as v } from "../window-resizer/index.js";
8
- import { i as w } from "../index-euf5anj6.js";
9
- import { f as z } from "../dom-CVWzyXPH.js";
10
- import { s as H } from "../gestures-CcXV6fCp.js";
11
- import { ticker as S } from "../ticker/index.js";
12
- var r, n, a, h, u, b, c, d, f;
13
- class k extends HTMLElement {
4
+ var S = (l, r, s) => r.has(l) || v("Cannot " + s);
5
+ var t = (l, r, s) => (S(l, r, "read from private field"), s ? s.call(l) : r.get(l)), h = (l, r, s) => r.has(l) ? v("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(l) : r.set(l, s), c = (l, r, s, e) => (S(l, r, "write to private field"), e ? e.call(l, s) : r.set(l, s), s);
6
+ import { i as z, a as H } from "../index-euf5anj6.js";
7
+ import { f as k } from "../dom-CVWzyXPH.js";
8
+ import { s as w } from "../gestures-CcXV6fCp.js";
9
+ import { ticker as E } from "../ticker/index.js";
10
+ var i, n, m, a, o, u, b, L, p, d, g;
11
+ class W extends HTMLElement {
14
12
  constructor() {
15
13
  super(...arguments);
16
- l(this, r, null);
17
- l(this, n, null);
18
- l(this, a, 0);
19
- l(this, h, 0);
20
- l(this, u);
21
- l(this, b, () => {
14
+ h(this, i, null);
15
+ h(this, n, null);
16
+ h(this, m, 0);
17
+ h(this, a, 0);
18
+ h(this, o, !1);
19
+ h(this, u);
20
+ h(this, b, () => {
22
21
  this.classList.add("active"), clearTimeout(t(this, u));
23
- const s = t(this, r).scrollTop / t(this, h) * t(this, a);
24
- t(this, n).style.transform = `translate3d(0px, ${s}px, 0px)`, m(this, u, setTimeout(() => {
22
+ const e = (t(this, o) ? t(this, i).scrollLeft : t(this, i).scrollTop) / t(this, a) * t(this, m);
23
+ t(this, o) ? t(this, n).style.transform = `translate3d(${e}px, 0px, 0px)` : t(this, n).style.transform = `translate3d(0px, ${e}px, 0px)`, c(this, u, setTimeout(() => {
25
24
  this.classList.remove("active");
26
25
  }, 1e3));
27
26
  });
28
- l(this, c, () => {
29
- const s = this.offsetHeight;
30
- m(this, h, t(this, r).scrollHeight - t(this, r).offsetHeight);
31
- let i = s / (t(this, h) / s);
32
- i = Math.max(i, 30), t(this, n).style.width = "100%", t(this, n).style.height = i + "px", m(this, a, s - i), t(this, r).scrollHeight > t(this, r).offsetHeight || (this.style.display = "none");
27
+ h(this, L, () => {
28
+ const s = t(this, o) ? this.offsetWidth : this.offsetHeight;
29
+ c(this, a, t(this, o) ? t(this, i).scrollWidth - t(this, i).offsetWidth : t(this, i).scrollHeight - t(this, i).offsetHeight);
30
+ let e = s * s / (t(this, a) + s);
31
+ e = Math.max(e, 30), t(this, o) ? (t(this, n).style.width = e + "px", t(this, n).style.height = "100%") : (t(this, n).style.width = "100%", t(this, n).style.height = e + "px"), c(this, m, s - e), t(this, o) && !(t(this, i).scrollWidth > t(this, i).offsetWidth) || !t(this, o) && !(t(this, i).scrollHeight > t(this, i).offsetHeight) ? this.style.display = "none" : this.style.display = "block";
33
32
  });
34
- l(this, d, (s) => {
35
- document.documentElement.classList.add("grabbing"), H(
36
- (y) => {
37
- const x = t(this, h) / t(this, a), T = (y.y - p) * x;
38
- t(this, r).scroll({
39
- top: i + T,
33
+ h(this, p, (s) => {
34
+ document.documentElement.classList.add("grabbing");
35
+ const e = t(this, o) ? t(this, i).scrollLeft : t(this, i).scrollTop, f = t(this, o) ? s.x : s.y;
36
+ w(
37
+ (x) => {
38
+ const T = t(this, a) / t(this, m), y = (t(this, o) ? x.x - f : x.y - f) * T;
39
+ t(this, o) ? t(this, i).scroll({
40
+ left: e + y,
41
+ behavior: "instant"
42
+ }) : t(this, i).scroll({
43
+ top: e + y,
40
44
  behavior: "instant"
41
45
  });
42
46
  },
@@ -44,25 +48,28 @@ class k extends HTMLElement {
44
48
  document.documentElement.classList.remove("grabbing");
45
49
  }
46
50
  );
47
- const i = t(this, r).scrollTop, p = s.y;
48
51
  });
49
- l(this, f, () => {
50
- t(this, c).call(this);
52
+ h(this, d, () => {
53
+ t(this, L).call(this);
54
+ });
55
+ h(this, g, (s) => {
56
+ s.isIntersecting ? E.subscribe(t(this, d), { maxFPS: 5 }) : E.unsubscribe(t(this, d));
51
57
  });
52
58
  }
53
59
  connectedCallback() {
54
60
  const s = this.getAttribute("data-scroll");
55
- let i = null;
56
- s && (i = document.querySelector(s)), i || (i = z(this));
57
- const p = this.querySelector("[data-thumb]");
58
- i && p && (m(this, r, i), m(this, n, p), L.subscribe(t(this, r), t(this, c)), v.subscribe(t(this, c)), t(this, r).addEventListener("scroll", t(this, b)), t(this, n).addEventListener("pointerdown", t(this, d)), S.subscribe(t(this, f), { maxFPS: 5 }));
61
+ c(this, o, this.getAttribute("orientation") === "horizontal");
62
+ let e = null;
63
+ s && (s === "parent" ? e = this.parentElement : e = document.querySelector(s)), e || (e = k(this));
64
+ const f = this.querySelector("[data-thumb]");
65
+ e && f && (c(this, i, e), c(this, n, f), t(this, i).addEventListener("scroll", t(this, b)), t(this, n).addEventListener("pointerdown", t(this, p)), H.subscribe(this.parentElement, t(this, g)));
59
66
  }
60
67
  disconnectedCallback() {
61
- L.unsubscribe(t(this, c)), v.unsubscribe(t(this, c)), t(this, r).removeEventListener("scroll", t(this, b)), t(this, n).removeEventListener("pointerdown", t(this, d)), clearTimeout(t(this, u)), S.unsubscribe(t(this, f));
68
+ t(this, i).removeEventListener("scroll", t(this, b)), t(this, n).removeEventListener("pointerdown", t(this, p)), clearTimeout(t(this, u)), H.unsubscribe(t(this, g)), E.unsubscribe(t(this, d));
62
69
  }
63
70
  }
64
- r = new WeakMap(), n = new WeakMap(), a = new WeakMap(), h = new WeakMap(), u = new WeakMap(), b = new WeakMap(), c = new WeakMap(), d = new WeakMap(), f = new WeakMap();
65
- w && !customElements.get("e-custom-scrollbar") && customElements.define("e-custom-scrollbar", k);
71
+ i = new WeakMap(), n = new WeakMap(), m = new WeakMap(), a = new WeakMap(), o = new WeakMap(), u = new WeakMap(), b = new WeakMap(), L = new WeakMap(), p = new WeakMap(), d = new WeakMap(), g = new WeakMap();
72
+ z && !customElements.get("e-custom-scrollbar") && customElements.define("e-custom-scrollbar", W);
66
73
  export {
67
- k as CustomScrollbarElement
74
+ W as CustomScrollbarElement
68
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.61.14",
3
+ "version": "0.62.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"