@koine/dom 2.0.0-beta.1 → 2.0.0-beta.11
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 -1
- package/$$.mjs +1 -2
- package/$.d.ts +1 -1
- package/$.mjs +1 -2
- package/$each.mjs +3 -4
- package/_listen-delegation.d.ts +3 -2
- package/_listen-delegation.mjs +17 -23
- package/addClass.mjs +2 -5
- package/calculateFixedOffset.mjs +3 -4
- package/createElement.mjs +2 -3
- package/emitEvent.mjs +3 -7
- package/escapeSelector.mjs +1 -2
- package/exists.mjs +1 -2
- package/forEach.d.ts +3 -5
- package/forEach.mjs +29 -8
- package/getDataAttr.mjs +1 -2
- package/getDocumentHeight.mjs +2 -3
- package/getHeight.mjs +1 -2
- package/getListeners.d.ts +1 -1
- package/getListeners.mjs +4 -5
- package/getOffset.mjs +8 -6
- package/getOffsetTop.mjs +3 -4
- package/getOffsetTopSlim.mjs +1 -2
- package/getScrollbarWidth.mjs +1 -2
- package/getStyleValue.mjs +1 -2
- package/getVisualBackgroundColor.mjs +8 -10
- package/injectCss.mjs +2 -5
- package/isHidden.mjs +1 -2
- package/isInViewport.mjs +3 -9
- package/isNodeList.mjs +3 -8
- package/isTotallyScrolled.mjs +1 -2
- package/listen.d.ts +2 -1
- package/listen.mjs +11 -8
- package/listenLoaded.mjs +2 -3
- package/listenOnce.mjs +2 -3
- package/listenResize.mjs +1 -2
- package/listenResizeDebounced.mjs +28 -36
- package/listenResizeThrottled.mjs +1 -8
- package/listenScroll.mjs +2 -5
- package/listenScrollDebounced.mjs +1 -8
- package/listenScrollThrottled.mjs +1 -8
- package/off.d.ts +2 -2
- package/off.mjs +2 -5
- package/on.d.ts +2 -2
- package/on.mjs +5 -5
- package/onClickOutside.mjs +5 -7
- package/once.mjs +3 -5
- package/package.json +8 -5
- package/removeClass.mjs +3 -6
- package/scrollTo.mjs +13 -14
- package/setDataAttr.mjs +1 -2
- package/setVendorCSS.mjs +2 -3
- package/siblings.mjs +4 -5
- package/toArray.mjs +1 -2
- package/types.d.ts +5 -0
- package/types.mjs +1 -1
- package/unlisten.d.ts +2 -1
- package/unlisten.mjs +11 -9
- package/$$.js +0 -16
- package/$.js +0 -19
- package/$each.js +0 -22
- package/_listen-delegation.js +0 -90
- package/addClass.js +0 -19
- package/calculateFixedOffset.js +0 -14
- package/createElement.js +0 -21
- package/emitEvent.js +0 -18
- package/escapeSelector.js +0 -14
- package/exists.js +0 -16
- package/forEach.js +0 -17
- package/getDataAttr.js +0 -17
- package/getDocumentHeight.js +0 -14
- package/getHeight.js +0 -11
- package/getListeners.js +0 -22
- package/getOffset.js +0 -22
- package/getOffsetTop.js +0 -24
- package/getOffsetTopSlim.js +0 -17
- package/getScrollbarWidth.js +0 -11
- package/getStyleValue.js +0 -14
- package/getVisualBackground.d.ts +0 -6
- package/getVisualBackground.js +0 -25
- package/getVisualBackground.mjs +0 -21
- package/getVisualBackgroundColor.js +0 -25
- package/index.js +0 -93
- package/injectCss.js +0 -20
- package/isHidden.js +0 -11
- package/isInViewport.js +0 -22
- package/isNodeList.js +0 -18
- package/isTotallyScrolled.js +0 -14
- package/listen.js +0 -37
- package/listenLoaded.js +0 -15
- package/listenOnce.js +0 -24
- package/listenResize.js +0 -12
- package/listenResizeDebounced.js +0 -47
- package/listenResizeThrottled.js +0 -20
- package/listenScroll.js +0 -17
- package/listenScrollDebounced.js +0 -20
- package/listenScrollThrottled.js +0 -20
- package/off.js +0 -18
- package/on.js +0 -26
- package/onClickOutside.js +0 -21
- package/once.js +0 -20
- package/removeClass.js +0 -19
- package/scrollTo.js +0 -44
- package/setDataAttr.js +0 -22
- package/setVendorCSS.js +0 -25
- package/siblings.js +0 -23
- package/toArray.js +0 -13
- package/types.js +0 -2
- package/unlisten.js +0 -37
package/createElement.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createElement = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var addClass_1 = tslib_1.__importDefault(require("./addClass"));
|
|
6
|
-
/**
|
|
7
|
-
* Shortcut for `document.createElement`, allowing to to create an HTML element
|
|
8
|
-
* with a given className directly (a very common use case)
|
|
9
|
-
*
|
|
10
|
-
* @param type
|
|
11
|
-
* @param className
|
|
12
|
-
*/
|
|
13
|
-
function createElement(type, className) {
|
|
14
|
-
var el = document.createElement(type);
|
|
15
|
-
if (className) {
|
|
16
|
-
(0, addClass_1.default)(el, className);
|
|
17
|
-
}
|
|
18
|
-
return el;
|
|
19
|
-
}
|
|
20
|
-
exports.createElement = createElement;
|
|
21
|
-
exports.default = createElement;
|
package/emitEvent.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emitEvent = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Emit event (use only if the targeted browser supports `CustomEvent`s)
|
|
6
|
-
*/
|
|
7
|
-
function emitEvent(type, detail) {
|
|
8
|
-
if (type === void 0) { type = "customEvent"; }
|
|
9
|
-
if (detail === void 0) { detail = {}; }
|
|
10
|
-
if (typeof window.CustomEvent !== "function")
|
|
11
|
-
return;
|
|
12
|
-
document.dispatchEvent(new CustomEvent(type, {
|
|
13
|
-
bubbles: true,
|
|
14
|
-
detail: detail,
|
|
15
|
-
}));
|
|
16
|
-
}
|
|
17
|
-
exports.emitEvent = emitEvent;
|
|
18
|
-
exports.default = emitEvent;
|
package/escapeSelector.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeSelector = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Escape colons to allow use class names as `.module:block__element`
|
|
6
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector#Escaping_special_characters
|
|
7
|
-
*
|
|
8
|
-
* @param selector
|
|
9
|
-
*/
|
|
10
|
-
function escapeSelector(selector) {
|
|
11
|
-
return selector.replace(/:/g, "\\:");
|
|
12
|
-
}
|
|
13
|
-
exports.escapeSelector = escapeSelector;
|
|
14
|
-
exports.default = escapeSelector;
|
package/exists.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exists = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Checks if passed node exist and is a valid element.
|
|
6
|
-
*
|
|
7
|
-
* @borrows @glidejs/glide/src/utils/dom (source)
|
|
8
|
-
*/
|
|
9
|
-
function exists(node) {
|
|
10
|
-
if (node && node instanceof window.HTMLElement) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
exports.exists = exists;
|
|
16
|
-
exports.default = exists;
|
package/forEach.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forEach = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* For each, iterate through a NodeList of HTMLElements
|
|
6
|
-
*
|
|
7
|
-
* @param nodes DOM nodes collection
|
|
8
|
-
* @param callback
|
|
9
|
-
* @param scope
|
|
10
|
-
*/
|
|
11
|
-
function forEach(nodes, callback, scope) {
|
|
12
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
13
|
-
callback.call(scope, nodes[i], i);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.forEach = forEach;
|
|
17
|
-
exports.default = forEach;
|
package/getDataAttr.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// TODO: maybe move to `dataset` API but consider the comment about Safari here
|
|
3
|
-
// https://stackoverflow.com/a/9201264/1938970
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getDataAttr = void 0;
|
|
6
|
-
/**
|
|
7
|
-
* Get data attribute
|
|
8
|
-
*
|
|
9
|
-
* @param element
|
|
10
|
-
* @param attribute The name of the `data-{attr}`
|
|
11
|
-
*/
|
|
12
|
-
function getDataAttr(element, attribute) {
|
|
13
|
-
// return element.dataset[attribute];
|
|
14
|
-
return element.getAttribute("data-" + attribute);
|
|
15
|
-
}
|
|
16
|
-
exports.getDataAttr = getDataAttr;
|
|
17
|
-
exports.default = getDataAttr;
|
package/getDocumentHeight.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDocumentHeight = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Determine the document's height
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/cferdinandi/smooth-scroll (credits)
|
|
8
|
-
*/
|
|
9
|
-
function getDocumentHeight() {
|
|
10
|
-
var body = document.body, documentElement = document.documentElement;
|
|
11
|
-
return Math.max(body.scrollHeight, documentElement.scrollHeight, body.offsetHeight, documentElement.offsetHeight, body.clientHeight, documentElement.clientHeight);
|
|
12
|
-
}
|
|
13
|
-
exports.getDocumentHeight = getDocumentHeight;
|
|
14
|
-
exports.default = getDocumentHeight;
|
package/getHeight.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHeight = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get element height
|
|
6
|
-
*/
|
|
7
|
-
function getHeight(element) {
|
|
8
|
-
return parseInt(window.getComputedStyle(element).height, 10);
|
|
9
|
-
}
|
|
10
|
-
exports.getHeight = getHeight;
|
|
11
|
-
exports.default = getHeight;
|
package/getListeners.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getListeners = void 0;
|
|
4
|
-
var _listen_delegation_1 = require("./_listen-delegation");
|
|
5
|
-
/**
|
|
6
|
-
* Get an immutable copy of all active event listeners
|
|
7
|
-
*
|
|
8
|
-
* @category listen-delegation
|
|
9
|
-
*
|
|
10
|
-
* @return Active event listeners
|
|
11
|
-
*/
|
|
12
|
-
function getListeners() {
|
|
13
|
-
var obj = {};
|
|
14
|
-
for (var type in _listen_delegation_1.activeEvents) {
|
|
15
|
-
// if (activeEvents.hasOwnProperty(type)) {
|
|
16
|
-
obj[type] = _listen_delegation_1.activeEvents[type];
|
|
17
|
-
// }
|
|
18
|
-
}
|
|
19
|
-
return obj;
|
|
20
|
-
}
|
|
21
|
-
exports.getListeners = getListeners;
|
|
22
|
-
exports.default = getListeners;
|
package/getOffset.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOffset = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get an element's distance from the top and left of the Document.
|
|
6
|
-
*
|
|
7
|
-
* @param elem The HTML node element
|
|
8
|
-
* @return Distance from the top and left in pixels
|
|
9
|
-
*/
|
|
10
|
-
function getOffset(elem) {
|
|
11
|
-
var left = 0;
|
|
12
|
-
var top = 0;
|
|
13
|
-
while (elem && !isNaN(elem.offsetLeft) && !isNaN(elem.offsetTop)) {
|
|
14
|
-
left += elem.offsetLeft - elem.scrollLeft;
|
|
15
|
-
top += elem.offsetTop - elem.scrollTop;
|
|
16
|
-
// @ts-expect-error nevermind?
|
|
17
|
-
elem = elem.offsetParent;
|
|
18
|
-
}
|
|
19
|
-
return { top: top, left: left };
|
|
20
|
-
}
|
|
21
|
-
exports.getOffset = getOffset;
|
|
22
|
-
exports.default = getOffset;
|
package/getOffsetTop.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOffsetTop = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get an element's distance from the top of the Document.
|
|
6
|
-
*
|
|
7
|
-
* @see https://vanillajstoolkit.com/helpers/getoffsettop/
|
|
8
|
-
*
|
|
9
|
-
* @param elem The HTML node element
|
|
10
|
-
* @return Distance from the top in pixels
|
|
11
|
-
*/
|
|
12
|
-
function getOffsetTop(elem) {
|
|
13
|
-
var location = 0;
|
|
14
|
-
if (elem.offsetParent) {
|
|
15
|
-
while (elem) {
|
|
16
|
-
location += elem.offsetTop;
|
|
17
|
-
// @ts-expect-error nevermind?
|
|
18
|
-
elem = elem.offsetParent;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return location >= 0 ? location : 0;
|
|
22
|
-
}
|
|
23
|
-
exports.getOffsetTop = getOffsetTop;
|
|
24
|
-
exports.default = getOffsetTop;
|
package/getOffsetTopSlim.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOffsetTopSlim = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get an element's distance from the top of the Document (using more modern/performant
|
|
6
|
-
* technique compared to {@link ./getOffsetTop})
|
|
7
|
-
*
|
|
8
|
-
* @see https://stackoverflow.com/q/5598743/1938970
|
|
9
|
-
*
|
|
10
|
-
* @param elem The HTML node element
|
|
11
|
-
* @return Distance from the top in pixels
|
|
12
|
-
*/
|
|
13
|
-
function getOffsetTopSlim(elem) {
|
|
14
|
-
return elem.getBoundingClientRect().top + window.scrollY;
|
|
15
|
-
}
|
|
16
|
-
exports.getOffsetTopSlim = getOffsetTopSlim;
|
|
17
|
-
exports.default = getOffsetTopSlim;
|
package/getScrollbarWidth.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getScrollbarWidth = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get scrollbar's current width
|
|
6
|
-
*/
|
|
7
|
-
function getScrollbarWidth(element) {
|
|
8
|
-
return window.innerWidth - (element || document.documentElement).clientWidth;
|
|
9
|
-
}
|
|
10
|
-
exports.getScrollbarWidth = getScrollbarWidth;
|
|
11
|
-
exports.default = getScrollbarWidth;
|
package/getStyleValue.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStyleValue = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Return the current style value for an element CSS property
|
|
6
|
-
*
|
|
7
|
-
* @param el The element to compute
|
|
8
|
-
* @param prop The style property
|
|
9
|
-
*/
|
|
10
|
-
function getStyleValue(el, prop) {
|
|
11
|
-
return getComputedStyle(el, null).getPropertyValue(prop);
|
|
12
|
-
}
|
|
13
|
-
exports.getStyleValue = getStyleValue;
|
|
14
|
-
exports.default = getStyleValue;
|
package/getVisualBackground.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the background color of an element eventually looking recursively into
|
|
3
|
-
* its parents, if nothing is found it returns a `#fff` background
|
|
4
|
-
*/
|
|
5
|
-
export declare function getVisualBackgroundColor(elem?: null | HTMLElement): string;
|
|
6
|
-
export default getVisualBackgroundColor;
|
package/getVisualBackground.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVisualBackgroundColor = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get the background color of an element eventually looking recursively into
|
|
6
|
-
* its parents, if nothing is found it returns a `#fff` background
|
|
7
|
-
*/
|
|
8
|
-
function getVisualBackgroundColor(elem) {
|
|
9
|
-
if (!elem)
|
|
10
|
-
return "#fff";
|
|
11
|
-
var transparent = "rgba(0, 0, 0, 0)";
|
|
12
|
-
var transparentIE11 = "transparent";
|
|
13
|
-
// if (!elem) return transparent;
|
|
14
|
-
var bg = window.getComputedStyle(elem).backgroundColor;
|
|
15
|
-
if (bg === transparent || bg === transparentIE11) {
|
|
16
|
-
var parent_1 = elem.parentElement;
|
|
17
|
-
if (parent_1) {
|
|
18
|
-
return getVisualBackgroundColor(parent_1);
|
|
19
|
-
}
|
|
20
|
-
return "#fff";
|
|
21
|
-
}
|
|
22
|
-
return bg;
|
|
23
|
-
}
|
|
24
|
-
exports.getVisualBackgroundColor = getVisualBackgroundColor;
|
|
25
|
-
exports.default = getVisualBackgroundColor;
|
package/getVisualBackground.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the background color of an element eventually looking recursively into
|
|
3
|
-
* its parents, if nothing is found it returns a `#fff` background
|
|
4
|
-
*/
|
|
5
|
-
export function getVisualBackgroundColor(elem) {
|
|
6
|
-
if (!elem)
|
|
7
|
-
return "#fff";
|
|
8
|
-
var transparent = "rgba(0, 0, 0, 0)";
|
|
9
|
-
var transparentIE11 = "transparent";
|
|
10
|
-
// if (!elem) return transparent;
|
|
11
|
-
var bg = window.getComputedStyle(elem).backgroundColor;
|
|
12
|
-
if (bg === transparent || bg === transparentIE11) {
|
|
13
|
-
var parent_1 = elem.parentElement;
|
|
14
|
-
if (parent_1) {
|
|
15
|
-
return getVisualBackgroundColor(parent_1);
|
|
16
|
-
}
|
|
17
|
-
return "#fff";
|
|
18
|
-
}
|
|
19
|
-
return bg;
|
|
20
|
-
}
|
|
21
|
-
export default getVisualBackgroundColor;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVisualBackgroundColor = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get the background color of an element eventually looking recursively into
|
|
6
|
-
* its parents, if nothing is found it returns a `#fff` background
|
|
7
|
-
*/
|
|
8
|
-
function getVisualBackgroundColor(elem) {
|
|
9
|
-
if (!elem)
|
|
10
|
-
return "#fff";
|
|
11
|
-
var transparent = "rgba(0, 0, 0, 0)";
|
|
12
|
-
var transparentIE11 = "transparent";
|
|
13
|
-
// if (!elem) return transparent;
|
|
14
|
-
var bg = window.getComputedStyle(elem).backgroundColor;
|
|
15
|
-
if (bg === transparent || bg === transparentIE11) {
|
|
16
|
-
var parent_1 = elem.parentElement;
|
|
17
|
-
if (parent_1) {
|
|
18
|
-
return getVisualBackgroundColor(parent_1);
|
|
19
|
-
}
|
|
20
|
-
return "#fff";
|
|
21
|
-
}
|
|
22
|
-
return bg;
|
|
23
|
-
}
|
|
24
|
-
exports.getVisualBackgroundColor = getVisualBackgroundColor;
|
|
25
|
-
exports.default = getVisualBackgroundColor;
|
package/index.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unlisten = exports.toArray = exports.siblings = exports.setVendorCSS = exports.setDataAttr = exports.scrollTo = exports.removeClass = exports.on = exports.onClickOutside = exports.once = exports.off = exports.listen = exports.listenScrollThrottled = exports.listenScrollDebounced = exports.listenScroll = exports.listenResizeThrottled = exports.listenResizeDebounced = exports.listenResize = exports.listenOnce = exports.listenLoaded = exports.isTotallyScrolled = exports.isNodeList = exports.isInViewport = exports.isHidden = exports.injectCss = exports.getVisualBackgroundColor = exports.getStyleValue = exports.getScrollbarWidth = exports.getOffsetTopSlim = exports.getOffsetTop = exports.getOffset = exports.getListeners = exports.getHeight = exports.getDocumentHeight = exports.getDataAttr = exports.forEach = exports.exists = exports.escapeSelector = exports.emitEvent = exports.createElement = exports.calculateFixedOffset = exports.addClass = exports.$ = exports.$each = exports.$$ = void 0;
|
|
4
|
-
var __1 = require("./$$");
|
|
5
|
-
Object.defineProperty(exports, "$$", { enumerable: true, get: function () { return __1.$$; } });
|
|
6
|
-
var _each_1 = require("./$each");
|
|
7
|
-
Object.defineProperty(exports, "$each", { enumerable: true, get: function () { return _each_1.$each; } });
|
|
8
|
-
var _1 = require("./$");
|
|
9
|
-
Object.defineProperty(exports, "$", { enumerable: true, get: function () { return _1.$; } });
|
|
10
|
-
var addClass_1 = require("./addClass");
|
|
11
|
-
Object.defineProperty(exports, "addClass", { enumerable: true, get: function () { return addClass_1.addClass; } });
|
|
12
|
-
var calculateFixedOffset_1 = require("./calculateFixedOffset");
|
|
13
|
-
Object.defineProperty(exports, "calculateFixedOffset", { enumerable: true, get: function () { return calculateFixedOffset_1.calculateFixedOffset; } });
|
|
14
|
-
var createElement_1 = require("./createElement");
|
|
15
|
-
Object.defineProperty(exports, "createElement", { enumerable: true, get: function () { return createElement_1.createElement; } });
|
|
16
|
-
var emitEvent_1 = require("./emitEvent");
|
|
17
|
-
Object.defineProperty(exports, "emitEvent", { enumerable: true, get: function () { return emitEvent_1.emitEvent; } });
|
|
18
|
-
var escapeSelector_1 = require("./escapeSelector");
|
|
19
|
-
Object.defineProperty(exports, "escapeSelector", { enumerable: true, get: function () { return escapeSelector_1.escapeSelector; } });
|
|
20
|
-
var exists_1 = require("./exists");
|
|
21
|
-
Object.defineProperty(exports, "exists", { enumerable: true, get: function () { return exists_1.exists; } });
|
|
22
|
-
var forEach_1 = require("./forEach");
|
|
23
|
-
Object.defineProperty(exports, "forEach", { enumerable: true, get: function () { return forEach_1.forEach; } });
|
|
24
|
-
var getDataAttr_1 = require("./getDataAttr");
|
|
25
|
-
Object.defineProperty(exports, "getDataAttr", { enumerable: true, get: function () { return getDataAttr_1.getDataAttr; } });
|
|
26
|
-
var getDocumentHeight_1 = require("./getDocumentHeight");
|
|
27
|
-
Object.defineProperty(exports, "getDocumentHeight", { enumerable: true, get: function () { return getDocumentHeight_1.getDocumentHeight; } });
|
|
28
|
-
var getHeight_1 = require("./getHeight");
|
|
29
|
-
Object.defineProperty(exports, "getHeight", { enumerable: true, get: function () { return getHeight_1.getHeight; } });
|
|
30
|
-
var getListeners_1 = require("./getListeners");
|
|
31
|
-
Object.defineProperty(exports, "getListeners", { enumerable: true, get: function () { return getListeners_1.getListeners; } });
|
|
32
|
-
var getOffset_1 = require("./getOffset");
|
|
33
|
-
Object.defineProperty(exports, "getOffset", { enumerable: true, get: function () { return getOffset_1.getOffset; } });
|
|
34
|
-
var getOffsetTop_1 = require("./getOffsetTop");
|
|
35
|
-
Object.defineProperty(exports, "getOffsetTop", { enumerable: true, get: function () { return getOffsetTop_1.getOffsetTop; } });
|
|
36
|
-
var getOffsetTopSlim_1 = require("./getOffsetTopSlim");
|
|
37
|
-
Object.defineProperty(exports, "getOffsetTopSlim", { enumerable: true, get: function () { return getOffsetTopSlim_1.getOffsetTopSlim; } });
|
|
38
|
-
var getScrollbarWidth_1 = require("./getScrollbarWidth");
|
|
39
|
-
Object.defineProperty(exports, "getScrollbarWidth", { enumerable: true, get: function () { return getScrollbarWidth_1.getScrollbarWidth; } });
|
|
40
|
-
var getStyleValue_1 = require("./getStyleValue");
|
|
41
|
-
Object.defineProperty(exports, "getStyleValue", { enumerable: true, get: function () { return getStyleValue_1.getStyleValue; } });
|
|
42
|
-
var getVisualBackgroundColor_1 = require("./getVisualBackgroundColor");
|
|
43
|
-
Object.defineProperty(exports, "getVisualBackgroundColor", { enumerable: true, get: function () { return getVisualBackgroundColor_1.getVisualBackgroundColor; } });
|
|
44
|
-
var injectCss_1 = require("./injectCss");
|
|
45
|
-
Object.defineProperty(exports, "injectCss", { enumerable: true, get: function () { return injectCss_1.injectCss; } });
|
|
46
|
-
var isHidden_1 = require("./isHidden");
|
|
47
|
-
Object.defineProperty(exports, "isHidden", { enumerable: true, get: function () { return isHidden_1.isHidden; } });
|
|
48
|
-
var isInViewport_1 = require("./isInViewport");
|
|
49
|
-
Object.defineProperty(exports, "isInViewport", { enumerable: true, get: function () { return isInViewport_1.isInViewport; } });
|
|
50
|
-
var isNodeList_1 = require("./isNodeList");
|
|
51
|
-
Object.defineProperty(exports, "isNodeList", { enumerable: true, get: function () { return isNodeList_1.isNodeList; } });
|
|
52
|
-
var isTotallyScrolled_1 = require("./isTotallyScrolled");
|
|
53
|
-
Object.defineProperty(exports, "isTotallyScrolled", { enumerable: true, get: function () { return isTotallyScrolled_1.isTotallyScrolled; } });
|
|
54
|
-
var listenLoaded_1 = require("./listenLoaded");
|
|
55
|
-
Object.defineProperty(exports, "listenLoaded", { enumerable: true, get: function () { return listenLoaded_1.listenLoaded; } });
|
|
56
|
-
var listenOnce_1 = require("./listenOnce");
|
|
57
|
-
Object.defineProperty(exports, "listenOnce", { enumerable: true, get: function () { return listenOnce_1.listenOnce; } });
|
|
58
|
-
var listenResize_1 = require("./listenResize");
|
|
59
|
-
Object.defineProperty(exports, "listenResize", { enumerable: true, get: function () { return listenResize_1.listenResize; } });
|
|
60
|
-
var listenResizeDebounced_1 = require("./listenResizeDebounced");
|
|
61
|
-
Object.defineProperty(exports, "listenResizeDebounced", { enumerable: true, get: function () { return listenResizeDebounced_1.listenResizeDebounced; } });
|
|
62
|
-
var listenResizeThrottled_1 = require("./listenResizeThrottled");
|
|
63
|
-
Object.defineProperty(exports, "listenResizeThrottled", { enumerable: true, get: function () { return listenResizeThrottled_1.listenResizeThrottled; } });
|
|
64
|
-
var listenScroll_1 = require("./listenScroll");
|
|
65
|
-
Object.defineProperty(exports, "listenScroll", { enumerable: true, get: function () { return listenScroll_1.listenScroll; } });
|
|
66
|
-
var listenScrollDebounced_1 = require("./listenScrollDebounced");
|
|
67
|
-
Object.defineProperty(exports, "listenScrollDebounced", { enumerable: true, get: function () { return listenScrollDebounced_1.listenScrollDebounced; } });
|
|
68
|
-
var listenScrollThrottled_1 = require("./listenScrollThrottled");
|
|
69
|
-
Object.defineProperty(exports, "listenScrollThrottled", { enumerable: true, get: function () { return listenScrollThrottled_1.listenScrollThrottled; } });
|
|
70
|
-
var listen_1 = require("./listen");
|
|
71
|
-
Object.defineProperty(exports, "listen", { enumerable: true, get: function () { return listen_1.listen; } });
|
|
72
|
-
var off_1 = require("./off");
|
|
73
|
-
Object.defineProperty(exports, "off", { enumerable: true, get: function () { return off_1.off; } });
|
|
74
|
-
var once_1 = require("./once");
|
|
75
|
-
Object.defineProperty(exports, "once", { enumerable: true, get: function () { return once_1.once; } });
|
|
76
|
-
var onClickOutside_1 = require("./onClickOutside");
|
|
77
|
-
Object.defineProperty(exports, "onClickOutside", { enumerable: true, get: function () { return onClickOutside_1.onClickOutside; } });
|
|
78
|
-
var on_1 = require("./on");
|
|
79
|
-
Object.defineProperty(exports, "on", { enumerable: true, get: function () { return on_1.on; } });
|
|
80
|
-
var removeClass_1 = require("./removeClass");
|
|
81
|
-
Object.defineProperty(exports, "removeClass", { enumerable: true, get: function () { return removeClass_1.removeClass; } });
|
|
82
|
-
var scrollTo_1 = require("./scrollTo");
|
|
83
|
-
Object.defineProperty(exports, "scrollTo", { enumerable: true, get: function () { return scrollTo_1.scrollTo; } });
|
|
84
|
-
var setDataAttr_1 = require("./setDataAttr");
|
|
85
|
-
Object.defineProperty(exports, "setDataAttr", { enumerable: true, get: function () { return setDataAttr_1.setDataAttr; } });
|
|
86
|
-
var setVendorCSS_1 = require("./setVendorCSS");
|
|
87
|
-
Object.defineProperty(exports, "setVendorCSS", { enumerable: true, get: function () { return setVendorCSS_1.setVendorCSS; } });
|
|
88
|
-
var siblings_1 = require("./siblings");
|
|
89
|
-
Object.defineProperty(exports, "siblings", { enumerable: true, get: function () { return siblings_1.siblings; } });
|
|
90
|
-
var toArray_1 = require("./toArray");
|
|
91
|
-
Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return toArray_1.toArray; } });
|
|
92
|
-
var unlisten_1 = require("./unlisten");
|
|
93
|
-
Object.defineProperty(exports, "unlisten", { enumerable: true, get: function () { return unlisten_1.unlisten; } });
|
package/injectCss.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.injectCss = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Inject css
|
|
6
|
-
*/
|
|
7
|
-
function injectCss(id, cssString, root) {
|
|
8
|
-
if (cssString === void 0) { cssString = ""; }
|
|
9
|
-
if (root === void 0) { root = document; }
|
|
10
|
-
var styleblock;
|
|
11
|
-
styleblock = root.getElementById(id);
|
|
12
|
-
if (!styleblock) {
|
|
13
|
-
styleblock = root.createElement("style");
|
|
14
|
-
styleblock.id = id;
|
|
15
|
-
root.body.appendChild(styleblock);
|
|
16
|
-
}
|
|
17
|
-
styleblock.innerHTML = cssString;
|
|
18
|
-
}
|
|
19
|
-
exports.injectCss = injectCss;
|
|
20
|
-
exports.default = injectCss;
|
package/isHidden.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isHidden = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Is element hidden?
|
|
6
|
-
*/
|
|
7
|
-
function isHidden(el) {
|
|
8
|
-
return !el || el.offsetParent === null;
|
|
9
|
-
}
|
|
10
|
-
exports.isHidden = isHidden;
|
|
11
|
-
exports.default = isHidden;
|
package/isInViewport.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInViewport = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Determine if an element is in the viewport
|
|
6
|
-
*
|
|
7
|
-
* @borrows (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
8
|
-
*
|
|
9
|
-
* @param elem The element
|
|
10
|
-
* @return Returns true if element is in the viewport
|
|
11
|
-
*/
|
|
12
|
-
function isInViewport(elem) {
|
|
13
|
-
var distance = elem.getBoundingClientRect();
|
|
14
|
-
return (distance.top >= 0 &&
|
|
15
|
-
distance.left >= 0 &&
|
|
16
|
-
distance.bottom <=
|
|
17
|
-
(window.innerHeight || document.documentElement.clientHeight) &&
|
|
18
|
-
distance.right <=
|
|
19
|
-
(window.innerWidth || document.documentElement.clientWidth));
|
|
20
|
-
}
|
|
21
|
-
exports.isInViewport = isInViewport;
|
|
22
|
-
exports.default = isInViewport;
|
package/isNodeList.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNodeList = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Is node list
|
|
6
|
-
*
|
|
7
|
-
* @param nodes The object to check
|
|
8
|
-
*/
|
|
9
|
-
function isNodeList(nodes) {
|
|
10
|
-
var stringRepr = Object.prototype.toString.call(nodes);
|
|
11
|
-
return (typeof nodes === "object" &&
|
|
12
|
-
/^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) &&
|
|
13
|
-
typeof nodes.length === "number" &&
|
|
14
|
-
(nodes.length === 0 ||
|
|
15
|
-
(typeof nodes[0] === "object" && nodes[0].nodeType > 0)));
|
|
16
|
-
}
|
|
17
|
-
exports.isNodeList = isNodeList;
|
|
18
|
-
exports.default = isNodeList;
|
package/isTotallyScrolled.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTotallyScrolled = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Is element totally scrolled
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/willmcpo/body-scroll-lock/blob/master/src/bodyScrollLock.js#L116
|
|
8
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions
|
|
9
|
-
*/
|
|
10
|
-
function isTotallyScrolled(el) {
|
|
11
|
-
return el ? el.scrollHeight - el.scrollTop <= el.clientHeight : false;
|
|
12
|
-
}
|
|
13
|
-
exports.isTotallyScrolled = isTotallyScrolled;
|
|
14
|
-
exports.default = isTotallyScrolled;
|
package/listen.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listen = void 0;
|
|
4
|
-
var _listen_delegation_1 = require("./_listen-delegation");
|
|
5
|
-
var on_1 = require("./on");
|
|
6
|
-
// import { off } from "./off";
|
|
7
|
-
/**
|
|
8
|
-
* Listen an event
|
|
9
|
-
*
|
|
10
|
-
* @category listen-delegation
|
|
11
|
-
*
|
|
12
|
-
* @param types The event type or types (comma separated)
|
|
13
|
-
* @param selector The selector to run the event on
|
|
14
|
-
* @param callback The function to run when the event fires
|
|
15
|
-
*/
|
|
16
|
-
function listen(types, selector, callback) {
|
|
17
|
-
// Make sure there's a selector and callback
|
|
18
|
-
if (!selector || !callback)
|
|
19
|
-
return;
|
|
20
|
-
// Loop through each event type
|
|
21
|
-
types.split(",").forEach(function (type) {
|
|
22
|
-
// Remove whitespace
|
|
23
|
-
type = type.trim();
|
|
24
|
-
// If no event of this type yet, setup
|
|
25
|
-
if (!_listen_delegation_1.activeEvents[type]) {
|
|
26
|
-
_listen_delegation_1.activeEvents[type] = [];
|
|
27
|
-
(0, on_1.on)(window, type, _listen_delegation_1.eventHandler, true);
|
|
28
|
-
}
|
|
29
|
-
// Push to active events
|
|
30
|
-
_listen_delegation_1.activeEvents[type].push({
|
|
31
|
-
selector: selector,
|
|
32
|
-
callback: callback,
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
exports.listen = listen;
|
|
37
|
-
exports.default = listen;
|
package/listenLoaded.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listenLoaded = void 0;
|
|
4
|
-
var on_1 = require("./on");
|
|
5
|
-
/**
|
|
6
|
-
* Fires a callback when the DOM content is loaded
|
|
7
|
-
*
|
|
8
|
-
* @see https://mathiasbynens.be/notes/settimeout-onload
|
|
9
|
-
*/
|
|
10
|
-
function listenLoaded(handler) {
|
|
11
|
-
(0, on_1.on)(document, "DOMContentLoaded", handler);
|
|
12
|
-
// document.addEventListener("DOMContentLoaded", setTimeout(handler, 4));
|
|
13
|
-
}
|
|
14
|
-
exports.listenLoaded = listenLoaded;
|
|
15
|
-
exports.default = listenLoaded;
|
package/listenOnce.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listenOnce = void 0;
|
|
4
|
-
var _listen_delegation_1 = require("./_listen-delegation");
|
|
5
|
-
var listen_1 = require("./listen");
|
|
6
|
-
var unlisten_1 = require("./unlisten");
|
|
7
|
-
/**
|
|
8
|
-
* Listen an event, and automatically unlisten it after it's first run
|
|
9
|
-
*
|
|
10
|
-
* @category listen-delegation
|
|
11
|
-
*
|
|
12
|
-
* @param types The event type or types (comma separated)
|
|
13
|
-
* @param selector The selector to run the event on
|
|
14
|
-
* @param callback The function to run when the event fires
|
|
15
|
-
*/
|
|
16
|
-
function listenOnce(types, selector, callback) {
|
|
17
|
-
(0, listen_1.listen)(types, selector, function temp(event) {
|
|
18
|
-
var target = (0, _listen_delegation_1.getRunTarget)(event.target, selector);
|
|
19
|
-
callback(event, target || window);
|
|
20
|
-
(0, unlisten_1.unlisten)(types, selector, temp);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.listenOnce = listenOnce;
|
|
24
|
-
exports.default = listenOnce;
|
package/listenResize.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listenResize = void 0;
|
|
4
|
-
var on_1 = require("./on");
|
|
5
|
-
/**
|
|
6
|
-
* Listen element's (`window` by default) _scroll_ event
|
|
7
|
-
*
|
|
8
|
-
* @returns An automatic unbinding function to run to deregister the listener upon call
|
|
9
|
-
*/
|
|
10
|
-
var listenResize = function (handler, el) { return (0, on_1.on)(el || window, "resize", handler); };
|
|
11
|
-
exports.listenResize = listenResize;
|
|
12
|
-
exports.default = exports.listenResize;
|