@koine/dom 2.0.0-beta.5 → 2.0.0-beta.51
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/$.d.ts +1 -13
- package/$all.d.ts +1 -0
- package/$each.d.ts +1 -11
- package/_listen-delegation.d.ts +4 -33
- package/addClass.d.ts +1 -5
- package/calculateFixedOffset.d.ts +1 -2
- package/createElement.d.ts +2 -9
- package/emitEvent.d.ts +1 -5
- package/escapeSelector.d.ts +1 -8
- package/exists.d.ts +1 -7
- package/forEach.d.ts +1 -8
- package/getDataAttr.d.ts +1 -8
- package/getDocumentHeight.d.ts +1 -7
- package/getHeight.d.ts +1 -5
- package/getListeners.d.ts +1 -9
- package/getOffset.d.ts +1 -8
- package/getOffsetTop.d.ts +1 -10
- package/getOffsetTopSlim.d.ts +1 -11
- package/getScrollbarWidth.d.ts +1 -5
- package/getStyleValue.d.ts +1 -8
- package/getVisualBackgroundColor.d.ts +1 -6
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +143 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +3 -3
- package/index.esm.js +95 -0
- package/injectCss.d.ts +1 -5
- package/isHidden.d.ts +1 -5
- package/isInViewport.d.ts +1 -10
- package/isNodeList.d.ts +1 -7
- package/isTotallyScrolled.d.ts +1 -8
- package/listen.d.ts +1 -11
- package/listenLoaded.d.ts +1 -7
- package/listenOnce.d.ts +1 -11
- package/listenResize.d.ts +1 -7
- package/listenResizeDebounced.d.ts +2 -8
- package/listenResizeThrottled.d.ts +1 -7
- package/listenScroll.d.ts +1 -7
- package/listenScrollDebounced.d.ts +1 -7
- package/listenScrollThrottled.d.ts +1 -7
- package/off.d.ts +1 -5
- package/on.d.ts +1 -7
- package/onClickOutside.d.ts +1 -1
- package/once.d.ts +2 -7
- package/package.json +9 -11
- package/removeClass.d.ts +1 -5
- package/scrollTo.d.ts +1 -12
- package/setDataAttr.d.ts +1 -9
- package/setVendorCSS.d.ts +1 -9
- package/siblings.d.ts +1 -7
- package/toArray.d.ts +1 -7
- package/types.d.ts +1 -6
- package/unlisten.d.ts +1 -11
- package/$$.d.ts +0 -10
- package/$$.js +0 -29
- package/$$.mjs +0 -11
- package/$.js +0 -32
- package/$.mjs +0 -14
- package/$each.js +0 -27
- package/$each.mjs +0 -16
- package/_listen-delegation.js +0 -83
- package/_listen-delegation.mjs +0 -77
- package/addClass.js +0 -30
- package/addClass.mjs +0 -12
- package/calculateFixedOffset.js +0 -27
- package/calculateFixedOffset.mjs +0 -9
- package/createElement.js +0 -28
- package/createElement.mjs +0 -15
- package/emitEvent.js +0 -28
- package/emitEvent.mjs +0 -10
- package/escapeSelector.js +0 -27
- package/escapeSelector.mjs +0 -9
- package/exists.js +0 -29
- package/exists.mjs +0 -11
- package/forEach.js +0 -28
- package/forEach.mjs +0 -10
- package/getDataAttr.js +0 -30
- package/getDataAttr.mjs +0 -12
- package/getDocumentHeight.js +0 -27
- package/getDocumentHeight.mjs +0 -9
- package/getHeight.js +0 -24
- package/getHeight.mjs +0 -6
- package/getListeners.js +0 -29
- package/getListeners.mjs +0 -17
- package/getOffset.js +0 -38
- package/getOffset.mjs +0 -20
- package/getOffsetTop.js +0 -37
- package/getOffsetTop.mjs +0 -19
- package/getOffsetTopSlim.js +0 -30
- package/getOffsetTopSlim.mjs +0 -12
- package/getScrollbarWidth.js +0 -24
- package/getScrollbarWidth.mjs +0 -6
- package/getStyleValue.js +0 -27
- package/getStyleValue.mjs +0 -9
- package/getVisualBackgroundColor.js +0 -37
- package/getVisualBackgroundColor.mjs +0 -19
- package/index.js +0 -192
- package/index.mjs +0 -45
- package/injectCss.js +0 -31
- package/injectCss.mjs +0 -13
- package/isHidden.js +0 -24
- package/isHidden.mjs +0 -6
- package/isInViewport.js +0 -30
- package/isInViewport.mjs +0 -12
- package/isNodeList.js +0 -27
- package/isNodeList.mjs +0 -9
- package/isTotallyScrolled.js +0 -27
- package/isTotallyScrolled.mjs +0 -9
- package/listen.js +0 -45
- package/listen.mjs +0 -36
- package/listenLoaded.js +0 -24
- package/listenLoaded.mjs +0 -10
- package/listenOnce.js +0 -29
- package/listenOnce.mjs +0 -19
- package/listenResize.js +0 -21
- package/listenResize.mjs +0 -7
- package/listenResizeDebounced.js +0 -50
- package/listenResizeDebounced.mjs +0 -34
- package/listenResizeThrottled.js +0 -23
- package/listenResizeThrottled.mjs +0 -8
- package/listenScroll.js +0 -24
- package/listenScroll.mjs +0 -10
- package/listenScrollDebounced.js +0 -23
- package/listenScrollDebounced.mjs +0 -8
- package/listenScrollThrottled.js +0 -23
- package/listenScrollThrottled.mjs +0 -8
- package/off.js +0 -27
- package/off.mjs +0 -11
- package/on.js +0 -36
- package/on.mjs +0 -21
- package/onClickOutside.js +0 -25
- package/onClickOutside.mjs +0 -15
- package/once.js +0 -29
- package/once.mjs +0 -13
- package/removeClass.js +0 -30
- package/removeClass.mjs +0 -12
- package/scrollTo.js +0 -48
- package/scrollTo.mjs +0 -39
- package/setDataAttr.js +0 -35
- package/setDataAttr.mjs +0 -17
- package/setVendorCSS.js +0 -38
- package/setVendorCSS.mjs +0 -20
- package/siblings.js +0 -36
- package/siblings.mjs +0 -18
- package/toArray.js +0 -26
- package/toArray.mjs +0 -8
- package/types.js +0 -4
- package/types.mjs +0 -1
- package/unlisten.js +0 -45
- package/unlisten.mjs +0 -35
package/index.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
$$: function() {
|
|
13
|
-
return _$$.$$;
|
|
14
|
-
},
|
|
15
|
-
$each: function() {
|
|
16
|
-
return _$each.$each;
|
|
17
|
-
},
|
|
18
|
-
$: function() {
|
|
19
|
-
return _$.$;
|
|
20
|
-
},
|
|
21
|
-
addClass: function() {
|
|
22
|
-
return _addClass.addClass;
|
|
23
|
-
},
|
|
24
|
-
calculateFixedOffset: function() {
|
|
25
|
-
return _calculateFixedOffset.calculateFixedOffset;
|
|
26
|
-
},
|
|
27
|
-
createElement: function() {
|
|
28
|
-
return _createElement.createElement;
|
|
29
|
-
},
|
|
30
|
-
emitEvent: function() {
|
|
31
|
-
return _emitEvent.emitEvent;
|
|
32
|
-
},
|
|
33
|
-
escapeSelector: function() {
|
|
34
|
-
return _escapeSelector.escapeSelector;
|
|
35
|
-
},
|
|
36
|
-
exists: function() {
|
|
37
|
-
return _exists.exists;
|
|
38
|
-
},
|
|
39
|
-
forEach: function() {
|
|
40
|
-
return _forEach.forEach;
|
|
41
|
-
},
|
|
42
|
-
getDataAttr: function() {
|
|
43
|
-
return _getDataAttr.getDataAttr;
|
|
44
|
-
},
|
|
45
|
-
getDocumentHeight: function() {
|
|
46
|
-
return _getDocumentHeight.getDocumentHeight;
|
|
47
|
-
},
|
|
48
|
-
getHeight: function() {
|
|
49
|
-
return _getHeight.getHeight;
|
|
50
|
-
},
|
|
51
|
-
getListeners: function() {
|
|
52
|
-
return _getListeners.getListeners;
|
|
53
|
-
},
|
|
54
|
-
getOffset: function() {
|
|
55
|
-
return _getOffset.getOffset;
|
|
56
|
-
},
|
|
57
|
-
getOffsetTop: function() {
|
|
58
|
-
return _getOffsetTop.getOffsetTop;
|
|
59
|
-
},
|
|
60
|
-
getOffsetTopSlim: function() {
|
|
61
|
-
return _getOffsetTopSlim.getOffsetTopSlim;
|
|
62
|
-
},
|
|
63
|
-
getScrollbarWidth: function() {
|
|
64
|
-
return _getScrollbarWidth.getScrollbarWidth;
|
|
65
|
-
},
|
|
66
|
-
getStyleValue: function() {
|
|
67
|
-
return _getStyleValue.getStyleValue;
|
|
68
|
-
},
|
|
69
|
-
getVisualBackgroundColor: function() {
|
|
70
|
-
return _getVisualBackgroundColor.getVisualBackgroundColor;
|
|
71
|
-
},
|
|
72
|
-
injectCss: function() {
|
|
73
|
-
return _injectCss.injectCss;
|
|
74
|
-
},
|
|
75
|
-
isHidden: function() {
|
|
76
|
-
return _isHidden.isHidden;
|
|
77
|
-
},
|
|
78
|
-
isInViewport: function() {
|
|
79
|
-
return _isInViewport.isInViewport;
|
|
80
|
-
},
|
|
81
|
-
isNodeList: function() {
|
|
82
|
-
return _isNodeList.isNodeList;
|
|
83
|
-
},
|
|
84
|
-
isTotallyScrolled: function() {
|
|
85
|
-
return _isTotallyScrolled.isTotallyScrolled;
|
|
86
|
-
},
|
|
87
|
-
listenLoaded: function() {
|
|
88
|
-
return _listenLoaded.listenLoaded;
|
|
89
|
-
},
|
|
90
|
-
listenOnce: function() {
|
|
91
|
-
return _listenOnce.listenOnce;
|
|
92
|
-
},
|
|
93
|
-
listenResize: function() {
|
|
94
|
-
return _listenResize.listenResize;
|
|
95
|
-
},
|
|
96
|
-
listenResizeDebounced: function() {
|
|
97
|
-
return _listenResizeDebounced.listenResizeDebounced;
|
|
98
|
-
},
|
|
99
|
-
listenResizeThrottled: function() {
|
|
100
|
-
return _listenResizeThrottled.listenResizeThrottled;
|
|
101
|
-
},
|
|
102
|
-
listenScroll: function() {
|
|
103
|
-
return _listenScroll.listenScroll;
|
|
104
|
-
},
|
|
105
|
-
listenScrollDebounced: function() {
|
|
106
|
-
return _listenScrollDebounced.listenScrollDebounced;
|
|
107
|
-
},
|
|
108
|
-
listenScrollThrottled: function() {
|
|
109
|
-
return _listenScrollThrottled.listenScrollThrottled;
|
|
110
|
-
},
|
|
111
|
-
listen: function() {
|
|
112
|
-
return _listen.listen;
|
|
113
|
-
},
|
|
114
|
-
off: function() {
|
|
115
|
-
return _off.off;
|
|
116
|
-
},
|
|
117
|
-
once: function() {
|
|
118
|
-
return _once.once;
|
|
119
|
-
},
|
|
120
|
-
onClickOutside: function() {
|
|
121
|
-
return _onClickOutside.onClickOutside;
|
|
122
|
-
},
|
|
123
|
-
on: function() {
|
|
124
|
-
return _on.on;
|
|
125
|
-
},
|
|
126
|
-
removeClass: function() {
|
|
127
|
-
return _removeClass.removeClass;
|
|
128
|
-
},
|
|
129
|
-
scrollTo: function() {
|
|
130
|
-
return _scrollTo.scrollTo;
|
|
131
|
-
},
|
|
132
|
-
setDataAttr: function() {
|
|
133
|
-
return _setDataAttr.setDataAttr;
|
|
134
|
-
},
|
|
135
|
-
setVendorCSS: function() {
|
|
136
|
-
return _setVendorCSS.setVendorCSS;
|
|
137
|
-
},
|
|
138
|
-
siblings: function() {
|
|
139
|
-
return _siblings.siblings;
|
|
140
|
-
},
|
|
141
|
-
toArray: function() {
|
|
142
|
-
return _toArray.toArray;
|
|
143
|
-
},
|
|
144
|
-
unlisten: function() {
|
|
145
|
-
return _unlisten.unlisten;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
const _$$ = require("./$$");
|
|
149
|
-
const _$each = require("./$each");
|
|
150
|
-
const _$ = require("./$");
|
|
151
|
-
const _addClass = require("./addClass");
|
|
152
|
-
const _calculateFixedOffset = require("./calculateFixedOffset");
|
|
153
|
-
const _createElement = require("./createElement");
|
|
154
|
-
const _emitEvent = require("./emitEvent");
|
|
155
|
-
const _escapeSelector = require("./escapeSelector");
|
|
156
|
-
const _exists = require("./exists");
|
|
157
|
-
const _forEach = require("./forEach");
|
|
158
|
-
const _getDataAttr = require("./getDataAttr");
|
|
159
|
-
const _getDocumentHeight = require("./getDocumentHeight");
|
|
160
|
-
const _getHeight = require("./getHeight");
|
|
161
|
-
const _getListeners = require("./getListeners");
|
|
162
|
-
const _getOffset = require("./getOffset");
|
|
163
|
-
const _getOffsetTop = require("./getOffsetTop");
|
|
164
|
-
const _getOffsetTopSlim = require("./getOffsetTopSlim");
|
|
165
|
-
const _getScrollbarWidth = require("./getScrollbarWidth");
|
|
166
|
-
const _getStyleValue = require("./getStyleValue");
|
|
167
|
-
const _getVisualBackgroundColor = require("./getVisualBackgroundColor");
|
|
168
|
-
const _injectCss = require("./injectCss");
|
|
169
|
-
const _isHidden = require("./isHidden");
|
|
170
|
-
const _isInViewport = require("./isInViewport");
|
|
171
|
-
const _isNodeList = require("./isNodeList");
|
|
172
|
-
const _isTotallyScrolled = require("./isTotallyScrolled");
|
|
173
|
-
const _listenLoaded = require("./listenLoaded");
|
|
174
|
-
const _listenOnce = require("./listenOnce");
|
|
175
|
-
const _listenResize = require("./listenResize");
|
|
176
|
-
const _listenResizeDebounced = require("./listenResizeDebounced");
|
|
177
|
-
const _listenResizeThrottled = require("./listenResizeThrottled");
|
|
178
|
-
const _listenScroll = require("./listenScroll");
|
|
179
|
-
const _listenScrollDebounced = require("./listenScrollDebounced");
|
|
180
|
-
const _listenScrollThrottled = require("./listenScrollThrottled");
|
|
181
|
-
const _listen = require("./listen");
|
|
182
|
-
const _off = require("./off");
|
|
183
|
-
const _once = require("./once");
|
|
184
|
-
const _onClickOutside = require("./onClickOutside");
|
|
185
|
-
const _on = require("./on");
|
|
186
|
-
const _removeClass = require("./removeClass");
|
|
187
|
-
const _scrollTo = require("./scrollTo");
|
|
188
|
-
const _setDataAttr = require("./setDataAttr");
|
|
189
|
-
const _setVendorCSS = require("./setVendorCSS");
|
|
190
|
-
const _siblings = require("./siblings");
|
|
191
|
-
const _toArray = require("./toArray");
|
|
192
|
-
const _unlisten = require("./unlisten");
|
package/index.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export { $$ } from "./$$";
|
|
2
|
-
export { $each } from "./$each";
|
|
3
|
-
export { $ } from "./$";
|
|
4
|
-
export { addClass } from "./addClass";
|
|
5
|
-
export { calculateFixedOffset } from "./calculateFixedOffset";
|
|
6
|
-
export { createElement } from "./createElement";
|
|
7
|
-
export { emitEvent } from "./emitEvent";
|
|
8
|
-
export { escapeSelector } from "./escapeSelector";
|
|
9
|
-
export { exists } from "./exists";
|
|
10
|
-
export { forEach } from "./forEach";
|
|
11
|
-
export { getDataAttr } from "./getDataAttr";
|
|
12
|
-
export { getDocumentHeight } from "./getDocumentHeight";
|
|
13
|
-
export { getHeight } from "./getHeight";
|
|
14
|
-
export { getListeners } from "./getListeners";
|
|
15
|
-
export { getOffset } from "./getOffset";
|
|
16
|
-
export { getOffsetTop } from "./getOffsetTop";
|
|
17
|
-
export { getOffsetTopSlim } from "./getOffsetTopSlim";
|
|
18
|
-
export { getScrollbarWidth } from "./getScrollbarWidth";
|
|
19
|
-
export { getStyleValue } from "./getStyleValue";
|
|
20
|
-
export { getVisualBackgroundColor } from "./getVisualBackgroundColor";
|
|
21
|
-
export { injectCss } from "./injectCss";
|
|
22
|
-
export { isHidden } from "./isHidden";
|
|
23
|
-
export { isInViewport } from "./isInViewport";
|
|
24
|
-
export { isNodeList } from "./isNodeList";
|
|
25
|
-
export { isTotallyScrolled } from "./isTotallyScrolled";
|
|
26
|
-
export { listenLoaded } from "./listenLoaded";
|
|
27
|
-
export { listenOnce } from "./listenOnce";
|
|
28
|
-
export { listenResize } from "./listenResize";
|
|
29
|
-
export { listenResizeDebounced } from "./listenResizeDebounced";
|
|
30
|
-
export { listenResizeThrottled } from "./listenResizeThrottled";
|
|
31
|
-
export { listenScroll } from "./listenScroll";
|
|
32
|
-
export { listenScrollDebounced } from "./listenScrollDebounced";
|
|
33
|
-
export { listenScrollThrottled } from "./listenScrollThrottled";
|
|
34
|
-
export { listen } from "./listen";
|
|
35
|
-
export { off } from "./off";
|
|
36
|
-
export { once } from "./once";
|
|
37
|
-
export { onClickOutside } from "./onClickOutside";
|
|
38
|
-
export { on } from "./on";
|
|
39
|
-
export { removeClass } from "./removeClass";
|
|
40
|
-
export { scrollTo } from "./scrollTo";
|
|
41
|
-
export { setDataAttr } from "./setDataAttr";
|
|
42
|
-
export { setVendorCSS } from "./setVendorCSS";
|
|
43
|
-
export { siblings } from "./siblings";
|
|
44
|
-
export { toArray } from "./toArray";
|
|
45
|
-
export { unlisten } from "./unlisten";
|
package/injectCss.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inject css
|
|
3
|
-
*/ "use strict";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
function _export(target, all) {
|
|
8
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: all[name]
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
_export(exports, {
|
|
14
|
-
injectCss: function() {
|
|
15
|
-
return injectCss;
|
|
16
|
-
},
|
|
17
|
-
default: function() {
|
|
18
|
-
return _default;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function injectCss(id, cssString = "", root = document) {
|
|
22
|
-
let styleblock;
|
|
23
|
-
styleblock = root.getElementById(id);
|
|
24
|
-
if (!styleblock) {
|
|
25
|
-
styleblock = root.createElement("style");
|
|
26
|
-
styleblock.id = id;
|
|
27
|
-
root.body.appendChild(styleblock);
|
|
28
|
-
}
|
|
29
|
-
styleblock.innerHTML = cssString;
|
|
30
|
-
}
|
|
31
|
-
const _default = injectCss;
|
package/injectCss.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inject css
|
|
3
|
-
*/ export function injectCss(id, cssString = "", root = document) {
|
|
4
|
-
let styleblock;
|
|
5
|
-
styleblock = root.getElementById(id);
|
|
6
|
-
if (!styleblock) {
|
|
7
|
-
styleblock = root.createElement("style");
|
|
8
|
-
styleblock.id = id;
|
|
9
|
-
root.body.appendChild(styleblock);
|
|
10
|
-
}
|
|
11
|
-
styleblock.innerHTML = cssString;
|
|
12
|
-
}
|
|
13
|
-
export default injectCss;
|
package/isHidden.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is element hidden?
|
|
3
|
-
*/ "use strict";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
function _export(target, all) {
|
|
8
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: all[name]
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
_export(exports, {
|
|
14
|
-
isHidden: function() {
|
|
15
|
-
return isHidden;
|
|
16
|
-
},
|
|
17
|
-
default: function() {
|
|
18
|
-
return _default;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function isHidden(el) {
|
|
22
|
-
return !el || el.offsetParent === null;
|
|
23
|
-
}
|
|
24
|
-
const _default = isHidden;
|
package/isHidden.mjs
DELETED
package/isInViewport.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determine if an element is in the viewport
|
|
3
|
-
*
|
|
4
|
-
* @borrows (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
5
|
-
*
|
|
6
|
-
* @param elem The element
|
|
7
|
-
* @return Returns true if element is in the viewport
|
|
8
|
-
*/ "use strict";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
function _export(target, all) {
|
|
13
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: all[name]
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
_export(exports, {
|
|
19
|
-
isInViewport: function() {
|
|
20
|
-
return isInViewport;
|
|
21
|
-
},
|
|
22
|
-
default: function() {
|
|
23
|
-
return _default;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
function isInViewport(elem) {
|
|
27
|
-
const distance = elem.getBoundingClientRect();
|
|
28
|
-
return distance.top >= 0 && distance.left >= 0 && distance.bottom <= (window.innerHeight || document.documentElement.clientHeight) && distance.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
29
|
-
}
|
|
30
|
-
const _default = isInViewport;
|
package/isInViewport.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determine if an element is in the viewport
|
|
3
|
-
*
|
|
4
|
-
* @borrows (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
5
|
-
*
|
|
6
|
-
* @param elem The element
|
|
7
|
-
* @return Returns true if element is in the viewport
|
|
8
|
-
*/ export function isInViewport(elem) {
|
|
9
|
-
const distance = elem.getBoundingClientRect();
|
|
10
|
-
return distance.top >= 0 && distance.left >= 0 && distance.bottom <= (window.innerHeight || document.documentElement.clientHeight) && distance.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
11
|
-
}
|
|
12
|
-
export default isInViewport;
|
package/isNodeList.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is node list
|
|
3
|
-
*
|
|
4
|
-
* @param nodes The object to check
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
function _export(target, all) {
|
|
10
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: all[name]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
_export(exports, {
|
|
16
|
-
isNodeList: function() {
|
|
17
|
-
return isNodeList;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function isNodeList(nodes) {
|
|
24
|
-
const stringRepr = Object.prototype.toString.call(nodes);
|
|
25
|
-
return typeof nodes === "object" && /^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) && typeof nodes.length === "number" && (nodes.length === 0 || typeof nodes[0] === "object" && nodes[0].nodeType > 0);
|
|
26
|
-
}
|
|
27
|
-
const _default = isNodeList;
|
package/isNodeList.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is node list
|
|
3
|
-
*
|
|
4
|
-
* @param nodes The object to check
|
|
5
|
-
*/ export function isNodeList(nodes) {
|
|
6
|
-
const stringRepr = Object.prototype.toString.call(nodes);
|
|
7
|
-
return typeof nodes === "object" && /^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) && typeof nodes.length === "number" && (nodes.length === 0 || typeof nodes[0] === "object" && nodes[0].nodeType > 0);
|
|
8
|
-
}
|
|
9
|
-
export default isNodeList;
|
package/isTotallyScrolled.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is element totally scrolled
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/willmcpo/body-scroll-lock/blob/master/src/bodyScrollLock.js#L116
|
|
5
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions
|
|
6
|
-
*/ "use strict";
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
function _export(target, all) {
|
|
11
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: all[name]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
_export(exports, {
|
|
17
|
-
isTotallyScrolled: function() {
|
|
18
|
-
return isTotallyScrolled;
|
|
19
|
-
},
|
|
20
|
-
default: function() {
|
|
21
|
-
return _default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function isTotallyScrolled(el) {
|
|
25
|
-
return el ? el.scrollHeight - el.scrollTop <= el.clientHeight : false;
|
|
26
|
-
}
|
|
27
|
-
const _default = isTotallyScrolled;
|
package/isTotallyScrolled.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is element totally scrolled
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/willmcpo/body-scroll-lock/blob/master/src/bodyScrollLock.js#L116
|
|
5
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions
|
|
6
|
-
*/ export function isTotallyScrolled(el) {
|
|
7
|
-
return el ? el.scrollHeight - el.scrollTop <= el.clientHeight : false;
|
|
8
|
-
}
|
|
9
|
-
export default isTotallyScrolled;
|
package/listen.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
listen: function() {
|
|
13
|
-
return listen;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _listendelegation = require("./_listen-delegation");
|
|
20
|
-
const _on = require("./on");
|
|
21
|
-
function listen(types, // | `${TTypes},${TTypes}`
|
|
22
|
-
// | `${TTypes},${TTypes},${TTypes}`
|
|
23
|
-
// | `${TTypes},${TTypes},${TTypes},${TTypes}`
|
|
24
|
-
// | `${TTypes},${TTypes},${TTypes},${TTypes},${TTypes}`,
|
|
25
|
-
selector, callback) {
|
|
26
|
-
// Make sure there's a selector and callback
|
|
27
|
-
if (!selector || !callback) return;
|
|
28
|
-
// Loop through each event type
|
|
29
|
-
types.split(",").forEach(function(type) {
|
|
30
|
-
// Remove whitespace
|
|
31
|
-
type = type.trim();
|
|
32
|
-
// If no event of this type yet, setup
|
|
33
|
-
if (!_listendelegation.activeEvents[type]) {
|
|
34
|
-
_listendelegation.activeEvents[type] = [];
|
|
35
|
-
(0, _on.on)(window, type, _listendelegation.eventHandler, true);
|
|
36
|
-
}
|
|
37
|
-
// Push to active events
|
|
38
|
-
_listendelegation.activeEvents[type]?.push({
|
|
39
|
-
selector: selector,
|
|
40
|
-
// @ts-expect-error FIXME: type...
|
|
41
|
-
callback: callback
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const _default = listen;
|
package/listen.mjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { activeEvents, eventHandler } from "./_listen-delegation";
|
|
2
|
-
import { on } from "./on";
|
|
3
|
-
// import { off } from "./off";
|
|
4
|
-
/**
|
|
5
|
-
* Listen an event
|
|
6
|
-
*
|
|
7
|
-
* @category listen-delegation
|
|
8
|
-
*
|
|
9
|
-
* @param types The event type or types (comma separated)
|
|
10
|
-
* @param selector The selector to run the event on
|
|
11
|
-
* @param callback The function to run when the event fires
|
|
12
|
-
*/ export function listen(types, // | `${TTypes},${TTypes}`
|
|
13
|
-
// | `${TTypes},${TTypes},${TTypes}`
|
|
14
|
-
// | `${TTypes},${TTypes},${TTypes},${TTypes}`
|
|
15
|
-
// | `${TTypes},${TTypes},${TTypes},${TTypes},${TTypes}`,
|
|
16
|
-
selector, callback) {
|
|
17
|
-
// Make sure there's a selector and callback
|
|
18
|
-
if (!selector || !callback) return;
|
|
19
|
-
// Loop through each event type
|
|
20
|
-
types.split(",").forEach(function(type) {
|
|
21
|
-
// Remove whitespace
|
|
22
|
-
type = type.trim();
|
|
23
|
-
// If no event of this type yet, setup
|
|
24
|
-
if (!activeEvents[type]) {
|
|
25
|
-
activeEvents[type] = [];
|
|
26
|
-
on(window, type, eventHandler, true);
|
|
27
|
-
}
|
|
28
|
-
// Push to active events
|
|
29
|
-
activeEvents[type]?.push({
|
|
30
|
-
selector: selector,
|
|
31
|
-
// @ts-expect-error FIXME: type...
|
|
32
|
-
callback: callback
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
export default listen;
|
package/listenLoaded.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
listenLoaded: function() {
|
|
13
|
-
return listenLoaded;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _on = require("./on");
|
|
20
|
-
function listenLoaded(handler) {
|
|
21
|
-
(0, _on.on)(document, "DOMContentLoaded", handler);
|
|
22
|
-
// document.addEventListener("DOMContentLoaded", setTimeout(handler, 4));
|
|
23
|
-
}
|
|
24
|
-
const _default = listenLoaded;
|
package/listenLoaded.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { on } from "./on";
|
|
2
|
-
/**
|
|
3
|
-
* Fires a callback when the DOM content is loaded
|
|
4
|
-
*
|
|
5
|
-
* @see https://mathiasbynens.be/notes/settimeout-onload
|
|
6
|
-
*/ export function listenLoaded(handler) {
|
|
7
|
-
on(document, "DOMContentLoaded", handler);
|
|
8
|
-
// document.addEventListener("DOMContentLoaded", setTimeout(handler, 4));
|
|
9
|
-
}
|
|
10
|
-
export default listenLoaded;
|
package/listenOnce.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
listenOnce: function() {
|
|
13
|
-
return listenOnce;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _listendelegation = require("./_listen-delegation");
|
|
20
|
-
const _listen = require("./listen");
|
|
21
|
-
const _unlisten = require("./unlisten");
|
|
22
|
-
function listenOnce(types, selector, callback) {
|
|
23
|
-
(0, _listen.listen)(types, selector, function temp(event) {
|
|
24
|
-
const target = (0, _listendelegation.getRunTarget)(event.target, selector);
|
|
25
|
-
callback(event, target || window);
|
|
26
|
-
(0, _unlisten.unlisten)(types, selector, temp);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const _default = listenOnce;
|
package/listenOnce.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { getRunTarget } from "./_listen-delegation";
|
|
2
|
-
import { listen } from "./listen";
|
|
3
|
-
import { unlisten } from "./unlisten";
|
|
4
|
-
/**
|
|
5
|
-
* Listen an event, and automatically unlisten it after it's first run
|
|
6
|
-
*
|
|
7
|
-
* @category listen-delegation
|
|
8
|
-
*
|
|
9
|
-
* @param types The event type or types (comma separated)
|
|
10
|
-
* @param selector The selector to run the event on
|
|
11
|
-
* @param callback The function to run when the event fires
|
|
12
|
-
*/ export function listenOnce(types, selector, callback) {
|
|
13
|
-
listen(types, selector, function temp(event) {
|
|
14
|
-
const target = getRunTarget(event.target, selector);
|
|
15
|
-
callback(event, target || window);
|
|
16
|
-
unlisten(types, selector, temp);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export default listenOnce;
|
package/listenResize.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
listenResize: function() {
|
|
13
|
-
return listenResize;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _on = require("./on");
|
|
20
|
-
const listenResize = (handler, el)=>(0, _on.on)(el || window, "resize", handler);
|
|
21
|
-
const _default = listenResize;
|
package/listenResize.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { on } from "./on";
|
|
2
|
-
/**
|
|
3
|
-
* Listen element's (`window` by default) _scroll_ event
|
|
4
|
-
*
|
|
5
|
-
* @returns An automatic unbinding function to run to deregister the listener upon call
|
|
6
|
-
*/ export const listenResize = (handler, el)=>on(el || window, "resize", handler);
|
|
7
|
-
export default listenResize;
|