aptechka 0.46.1 → 0.47.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/billboard/index.cjs +1 -0
- package/lib/billboard/index.d.ts +12 -0
- package/lib/billboard/index.js +58 -0
- package/package.json +9 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=s=>{throw TypeError(s)};var f=(s,i,e)=>i.has(s)||y("Cannot "+e);var t=(s,i,e)=>(f(s,i,"read from private field"),e?e.call(s):i.get(s)),r=(s,i,e)=>i.has(s)?y("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,e),u=(s,i,e,d)=>(f(s,i,"write to private field"),d?d.call(s,e):i.set(s,e),e),I=(s,i,e)=>(f(s,i,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../css-property/index.cjs"),g=require("../index-Cqw2NKev.cjs"),q=require("../number-0243DApo.cjs");var l,n,h,c,a,b,o,m,p,v;class E extends HTMLElement{constructor(){super(...arguments);r(this,m);r(this,l,new L.CSSProperty(this,"--delay","2s"));r(this,n);r(this,h,!1);r(this,c,[]);r(this,a,0);r(this,b,e=>{u(this,h,e.isIntersecting),t(this,h)?t(this,o).call(this):clearInterval(t(this,n))});r(this,o,()=>{clearInterval(t(this,n)),t(this,h)&&u(this,n,setInterval(t(this,v),parseFloat(t(this,l).current||"0")*1e3))});r(this,v,()=>{I(this,m,p).call(this,t(this,a)+1)})}set(e){I(this,m,p).call(this,e),t(this,o).call(this)}shift(e){this.set(t(this,a)+e)}connectedCallback(){var e;u(this,c,[...this.querySelectorAll("[data-billboard-item]")]),(e=t(this,c)[0])==null||e.classList.add("current"),t(this,l).subscribe(()=>{t(this,o).call(this)}),t(this,l).observe(),g.intersector.subscribe(this,t(this,b))}disconnectedCallback(){t(this,l).unobserve(),g.intersector.unsubscribe(t(this,b)),clearInterval(t(this,n))}}l=new WeakMap,n=new WeakMap,h=new WeakMap,c=new WeakMap,a=new WeakMap,b=new WeakMap,o=new WeakMap,m=new WeakSet,p=function(e){u(this,a,q.loopNumber(e,t(this,c).length)),t(this,c).forEach((d,S)=>{S===t(this,a)?d.classList.add("current"):d.classList.remove("current")})},v=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",E);exports.BillboardElement=E;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class BillboardElement extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
set(value: number): void;
|
|
4
|
+
shift(value: number): void;
|
|
5
|
+
protected connectedCallback(): void;
|
|
6
|
+
protected disconnectedCallback(): void;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'e-billboard': BillboardElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var E = (s) => {
|
|
2
|
+
throw TypeError(s);
|
|
3
|
+
};
|
|
4
|
+
var p = (s, i, t) => i.has(s) || E("Cannot " + t);
|
|
5
|
+
var e = (s, i, t) => (p(s, i, "read from private field"), t ? t.call(s) : i.get(s)), r = (s, i, t) => i.has(s) ? E("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), b = (s, i, t, d) => (p(s, i, "write to private field"), d ? d.call(s, t) : i.set(s, t), t), v = (s, i, t) => (p(s, i, "access private method"), t);
|
|
6
|
+
import { CSSProperty as y } from "../css-property/index.js";
|
|
7
|
+
import { a as L } from "../index-euf5anj6.js";
|
|
8
|
+
import { l as C } from "../number-DwCxt_Ck.js";
|
|
9
|
+
var l, a, c, n, h, u, o, m, I, f;
|
|
10
|
+
class S extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
r(this, m);
|
|
14
|
+
r(this, l, new y(this, "--delay", "2s"));
|
|
15
|
+
r(this, a);
|
|
16
|
+
r(this, c, !1);
|
|
17
|
+
r(this, n, []);
|
|
18
|
+
r(this, h, 0);
|
|
19
|
+
r(this, u, (t) => {
|
|
20
|
+
b(this, c, t.isIntersecting), e(this, c) ? e(this, o).call(this) : clearInterval(e(this, a));
|
|
21
|
+
});
|
|
22
|
+
r(this, o, () => {
|
|
23
|
+
clearInterval(e(this, a)), e(this, c) && b(this, a, setInterval(
|
|
24
|
+
e(this, f),
|
|
25
|
+
parseFloat(e(this, l).current || "0") * 1e3
|
|
26
|
+
));
|
|
27
|
+
});
|
|
28
|
+
r(this, f, () => {
|
|
29
|
+
v(this, m, I).call(this, e(this, h) + 1);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
set(t) {
|
|
33
|
+
v(this, m, I).call(this, t), e(this, o).call(this);
|
|
34
|
+
}
|
|
35
|
+
shift(t) {
|
|
36
|
+
this.set(e(this, h) + t);
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
var t;
|
|
40
|
+
b(this, n, [
|
|
41
|
+
...this.querySelectorAll("[data-billboard-item]")
|
|
42
|
+
]), (t = e(this, n)[0]) == null || t.classList.add("current"), e(this, l).subscribe(() => {
|
|
43
|
+
e(this, o).call(this);
|
|
44
|
+
}), e(this, l).observe(), L.subscribe(this, e(this, u));
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
e(this, l).unobserve(), L.unsubscribe(e(this, u)), clearInterval(e(this, a));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
l = new WeakMap(), a = new WeakMap(), c = new WeakMap(), n = new WeakMap(), h = new WeakMap(), u = new WeakMap(), o = new WeakMap(), m = new WeakSet(), I = function(t) {
|
|
51
|
+
b(this, h, C(t, e(this, n).length)), e(this, n).forEach((d, g) => {
|
|
52
|
+
g === e(this, h) ? d.classList.add("current") : d.classList.remove("current");
|
|
53
|
+
});
|
|
54
|
+
}, f = new WeakMap();
|
|
55
|
+
customElements.get("e-billboard") || customElements.define("e-billboard", S);
|
|
56
|
+
export {
|
|
57
|
+
S as BillboardElement
|
|
58
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aptechka",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/denisavitski/aptechka.git"
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
"default": "./lib/attribute/index.js",
|
|
34
34
|
"types": "./lib/attribute/index.d.ts"
|
|
35
35
|
},
|
|
36
|
+
"./billboard": {
|
|
37
|
+
"require": "./lib/billboard/index.cjs",
|
|
38
|
+
"default": "./lib/billboard/index.js",
|
|
39
|
+
"types": "./lib/billboard/index.d.ts"
|
|
40
|
+
},
|
|
36
41
|
"./canvas": {
|
|
37
42
|
"require": "./lib/canvas/index.cjs",
|
|
38
43
|
"default": "./lib/canvas/index.js",
|
|
@@ -245,6 +250,9 @@
|
|
|
245
250
|
"attribute": [
|
|
246
251
|
"lib/attribute/index.d.ts"
|
|
247
252
|
],
|
|
253
|
+
"billboard": [
|
|
254
|
+
"lib/billboard/index.d.ts"
|
|
255
|
+
],
|
|
248
256
|
"canvas": [
|
|
249
257
|
"lib/canvas/index.d.ts"
|
|
250
258
|
],
|