function activeElement() { var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _ownerDocument2.default)(); try { return doc.activeElement; } catch (e) {/* ie throws if no active element */} }
n/a
function onEnd(node, handler, duration) { var fakeEvent = { target: node, currentTarget: node }, backup; if (!_properties2.default.end) duration = 0;else if (duration == null) duration = parseDuration(node) || 0; if (_properties2.default.end) { node.addEventListener(_properties2.default.end, done, false); backup = setTimeout(function () { return done(fakeEvent); }, (duration || 100) * 1.5); } else setTimeout(done.bind(null, fakeEvent), 0); function done(event) { if (event.target !== event.currentTarget) return; clearTimeout(backup); event.target.removeEventListener(_properties2.default.end, done); handler.call(this); } }
n/a
function ownerDocument(node) { return node && node.ownerDocument || document; }
n/a
function ownerWindow(node) { var doc = (0, _ownerDocument2.default)(node); return doc && doc.defaultView || doc.parentWindow; }
n/a
function compatRaf(cb) { return raf(cb); }
n/a
function style(node, property, value) { var css = ''; var transforms = ''; var props = property; if (typeof property === 'string') { if (value === undefined) { return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2 .default)(property)); } else { (props = {})[property] = value; } } Object.keys(props).forEach(function (key) { var value = props[key]; if (!value && value !== 0) { (0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key)); } else if ((0, _isTransform2.default)(key)) { transforms += key + '(' + value + ') '; } else { css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';'; } }); if (transforms) { css += _properties.transform + ': ' + transforms + ';'; } node.style.cssText += ';' + css; }
n/a
function activeElement() { var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _ownerDocument2.default)(); try { return doc.activeElement; } catch (e) {/* ie throws if no active element */} }
n/a
function closest(node, selector, context) { while (node && (isDoc(node) || !(0, _matches2.default)(node, selector))) { node = node !== context && !isDoc(node) ? node.parentNode : undefined; } return node; }
n/a
function fallback(context, node) { if (node) do { if (node === context) return true; } while (node = node.parentNode); return false; }
...
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hasClass;
function hasClass(element, className) {
if (element.classList) return !!className && element.classList.contains(className
);else return (" " + element.className + " ").indexOf(" " + className + " ") !== -1;
}
module.exports = exports["default"];
...
function filterEvents(selector, handler) { return function filterHandler(e) { var top = e.currentTarget, target = e.target, matches = (0, _querySelectorAll2.default)(top, selector); if (matches.some(function (match) { return (0, _contains2.default)(match, target); })) handler.call(this, e); }; }
...
duration: // transition-duration
}
```
- events
+ `on(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `off(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `listen(node, eventName, handler, [capture])`: wraps `on` and returns a function that calls `off` for you
+ `filter(selector, fn)`: returns a function handler that only fires when the target matches or is contained in the selector
ex: `events.on(list, 'click', events.filter('li > a', handler
))`
- util
+ `requestAnimationFrame(cb)` returns an ID for canceling
* `requestAnimationFrame.cancel(id)`
+ `scrollTo(element, [scrollParent])`
...
function height(node, client) { var win = (0, _isWindow2.default)(node); return win ? win.innerHeight : client ? node.clientHeight : (0, _offset2.default)(node).height; }
n/a
function listen() {}
n/a
function off() {}
n/a
function offset(node) { var doc = (0, _ownerDocument2.default)(node), win = (0, _isWindow2.default)(doc), docElem = doc && doc.documentElement, box = { top: 0, left: 0, height: 0, width: 0 }; if (!doc) return; // Make sure it's not a disconnected DOM node if (!(0, _contains2.default)(docElem, node)) return box; if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect(); // IE8 getBoundingClientRect doesn't support width & height box = { top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0), width: (box.width == null ? node.offsetWidth : box.width) || 0, height: (box.height == null ? node.offsetHeight : box.height) || 0 }; return box; }
n/a
function offsetParent(node) { var doc = (0, _ownerDocument2.default)(node), offsetParent = node && node.offsetParent; while (offsetParent && nodeName(node) !== 'html' && (0, _style2.default)(offsetParent, 'position') === 'static') { offsetParent = offsetParent.offsetParent; } return offsetParent || doc.documentElement; }
n/a
function on() {}
...
duration: // transition-duration
}
```
- events
+ `on(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `off(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `listen(node, eventName, handler, [capture])`: wraps `on` and returns a function that calls `off` for you
+ `filter(selector, fn)`: returns a function handler that only fires when the target matches or is contained in the selector
ex: `events.on(list, 'click', events.filter('li > a', handler
))`
- util
+ `requestAnimationFrame(cb)` returns an ID for canceling
* `requestAnimationFrame.cancel(id)`
+ `scrollTo(element, [scrollParent])`
...
function ownerDocument(node) { return node && node.ownerDocument || document; }
n/a
function ownerWindow(node) { var doc = (0, _ownerDocument2.default)(node); return doc && doc.defaultView || doc.parentWindow; }
n/a
function position(node, offsetParent) { var parentOffset = { top: 0, left: 0 }, offset; // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, // because it is its only offset parent if ((0, _style2.default)(node, 'position') === 'fixed') { offset = node.getBoundingClientRect(); } else { offsetParent = offsetParent || (0, _offsetParent2.default)(node); offset = (0, _offset2.default)(node); if (nodeName(offsetParent) !== 'html') parentOffset = (0, _offset2.default)(offsetParent); parentOffset.top += parseInt((0, _style2.default)(offsetParent, 'borderTopWidth'), 10) - (0, _scrollTop2.default)(offsetParent ) || 0; parentOffset.left += parseInt((0, _style2.default)(offsetParent, 'borderLeftWidth'), 10) - (0, _scrollLeft2.default)(offsetParent ) || 0; } // Subtract parent offsets and node margins return _extends({}, offset, { top: offset.top - parentOffset.top - (parseInt((0, _style2.default)(node, 'marginTop'), 10) || 0), left: offset.left - parentOffset.left - (parseInt((0, _style2.default)(node, 'marginLeft'), 10) || 0) }); }
n/a
function qsa(element, selector) { var maybeID = selector[0] === '#', maybeClass = selector[0] === '.', nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, isSimple = simpleSelectorRE.test(nameOnly), found; if (isSimple) { if (maybeID) { element = element.getElementById ? element : document; return (found = element.getElementById(nameOnly)) ? [found] : []; } if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly)); return toArray(element.getElementsByTagName(selector)); } return toArray(element.querySelectorAll(selector)); }
...
}
if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly));
return toArray(element.getElementsByTagName(selector));
}
return toArray(element.querySelectorAll(selector));
}
module.exports = exports['default'];
...
function compatRaf(cb) { return raf(cb); }
n/a
function scrollPrarent(node) { var position = (0, _style2.default)(node, 'position'), excludeStatic = position === 'absolute', ownerDoc = node.ownerDocument; if (position === 'fixed') return ownerDoc || document; while ((node = node.parentNode) && node.nodeType !== 9) { var isStatic = excludeStatic && (0, _style2.default)(node, 'position') === 'static', style = (0, _style2.default)(node, 'overflow') + (0, _style2.default)(node, 'overflow-y') + (0, _style2.default)(node, ' overflow-x'); if (isStatic) continue; if (/(auto|scroll)/.test(style) && (0, _height2.default)(node) < node.scrollHeight) return node; } return document; }
n/a
function scrollTop(node, val) { var win = (0, _isWindow2.default)(node); if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop ; if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val; }
n/a
function style(node, property, value) { var css = ''; var transforms = ''; var props = property; if (typeof property === 'string') { if (value === undefined) { return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2 .default)(property)); } else { (props = {})[property] = value; } } Object.keys(props).forEach(function (key) { var value = props[key]; if (!value && value !== 0) { (0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key)); } else if ((0, _isTransform2.default)(key)) { transforms += key + '(' + value + ') '; } else { css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';'; } }); if (transforms) { css += _properties.transform + ': ' + transforms + ';'; } node.style.cssText += ';' + css; }
n/a
function width(node, client) { var win = (0, _isWindow2.default)(node); return win ? win.innerWidth : client ? node.clientWidth : (0, _offset2.default)(node).width; }
n/a
function onEnd(node, handler, duration) { var fakeEvent = { target: node, currentTarget: node }, backup; if (!_properties2.default.end) duration = 0;else if (duration == null) duration = parseDuration(node) || 0; if (_properties2.default.end) { node.addEventListener(_properties2.default.end, done, false); backup = setTimeout(function () { return done(fakeEvent); }, (duration || 100) * 1.5); } else setTimeout(done.bind(null, fakeEvent), 0); function done(event) { if (event.target !== event.currentTarget) return; clearTimeout(backup); event.target.removeEventListener(_properties2.default.end, done); handler.call(this); } }
n/a
function parseDuration(node) { var str = (0, _style2.default)(node, _properties2.default.duration), mult = str.indexOf('ms') === -1 ? 1000 : 1; return parseFloat(str) * mult; }
n/a
function filterEvents(selector, handler) { return function filterHandler(e) { var top = e.currentTarget, target = e.target, matches = (0, _querySelectorAll2.default)(top, selector); if (matches.some(function (match) { return (0, _contains2.default)(match, target); })) handler.call(this, e); }; }
...
duration: // transition-duration
}
```
- events
+ `on(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `off(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `listen(node, eventName, handler, [capture])`: wraps `on` and returns a function that calls `off` for you
+ `filter(selector, fn)`: returns a function handler that only fires when the target matches or is contained in the selector
ex: `events.on(list, 'click', events.filter('li > a', handler
))`
- util
+ `requestAnimationFrame(cb)` returns an ID for canceling
* `requestAnimationFrame.cancel(id)`
+ `scrollTo(element, [scrollParent])`
...
function listen() {}
n/a
function off() {}
n/a
function on() {}
...
duration: // transition-duration
}
```
- events
+ `on(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `off(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `listen(node, eventName, handler, [capture])`: wraps `on` and returns a function that calls `off` for you
+ `filter(selector, fn)`: returns a function handler that only fires when the target matches or is contained in the selector
ex: `events.on(list, 'click', events.filter('li > a', handler
))`
- util
+ `requestAnimationFrame(cb)` returns an ID for canceling
* `requestAnimationFrame.cancel(id)`
+ `scrollTo(element, [scrollParent])`
...
function closest(node, selector, context) { while (node && (isDoc(node) || !(0, _matches2.default)(node, selector))) { node = node !== context && !isDoc(node) ? node.parentNode : undefined; } return node; }
n/a
function fallback(context, node) { if (node) do { if (node === context) return true; } while (node = node.parentNode); return false; }
...
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hasClass;
function hasClass(element, className) {
if (element.classList) return !!className && element.classList.contains(className
);else return (" " + element.className + " ").indexOf(" " + className + " ") !== -1;
}
module.exports = exports["default"];
...
function height(node, client) { var win = (0, _isWindow2.default)(node); return win ? win.innerHeight : client ? node.clientHeight : (0, _offset2.default)(node).height; }
n/a
function offset(node) { var doc = (0, _ownerDocument2.default)(node), win = (0, _isWindow2.default)(doc), docElem = doc && doc.documentElement, box = { top: 0, left: 0, height: 0, width: 0 }; if (!doc) return; // Make sure it's not a disconnected DOM node if (!(0, _contains2.default)(docElem, node)) return box; if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect(); // IE8 getBoundingClientRect doesn't support width & height box = { top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0), width: (box.width == null ? node.offsetWidth : box.width) || 0, height: (box.height == null ? node.offsetHeight : box.height) || 0 }; return box; }
n/a
function offsetParent(node) { var doc = (0, _ownerDocument2.default)(node), offsetParent = node && node.offsetParent; while (offsetParent && nodeName(node) !== 'html' && (0, _style2.default)(offsetParent, 'position') === 'static') { offsetParent = offsetParent.offsetParent; } return offsetParent || doc.documentElement; }
n/a
function position(node, offsetParent) { var parentOffset = { top: 0, left: 0 }, offset; // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, // because it is its only offset parent if ((0, _style2.default)(node, 'position') === 'fixed') { offset = node.getBoundingClientRect(); } else { offsetParent = offsetParent || (0, _offsetParent2.default)(node); offset = (0, _offset2.default)(node); if (nodeName(offsetParent) !== 'html') parentOffset = (0, _offset2.default)(offsetParent); parentOffset.top += parseInt((0, _style2.default)(offsetParent, 'borderTopWidth'), 10) - (0, _scrollTop2.default)(offsetParent ) || 0; parentOffset.left += parseInt((0, _style2.default)(offsetParent, 'borderLeftWidth'), 10) - (0, _scrollLeft2.default)(offsetParent ) || 0; } // Subtract parent offsets and node margins return _extends({}, offset, { top: offset.top - parentOffset.top - (parseInt((0, _style2.default)(node, 'marginTop'), 10) || 0), left: offset.left - parentOffset.left - (parseInt((0, _style2.default)(node, 'marginLeft'), 10) || 0) }); }
n/a
function qsa(element, selector) { var maybeID = selector[0] === '#', maybeClass = selector[0] === '.', nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, isSimple = simpleSelectorRE.test(nameOnly), found; if (isSimple) { if (maybeID) { element = element.getElementById ? element : document; return (found = element.getElementById(nameOnly)) ? [found] : []; } if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly)); return toArray(element.getElementsByTagName(selector)); } return toArray(element.querySelectorAll(selector)); }
...
}
if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly));
return toArray(element.getElementsByTagName(selector));
}
return toArray(element.querySelectorAll(selector));
}
module.exports = exports['default'];
...
function scrollPrarent(node) { var position = (0, _style2.default)(node, 'position'), excludeStatic = position === 'absolute', ownerDoc = node.ownerDocument; if (position === 'fixed') return ownerDoc || document; while ((node = node.parentNode) && node.nodeType !== 9) { var isStatic = excludeStatic && (0, _style2.default)(node, 'position') === 'static', style = (0, _style2.default)(node, 'overflow') + (0, _style2.default)(node, 'overflow-y') + (0, _style2.default)(node, ' overflow-x'); if (isStatic) continue; if (/(auto|scroll)/.test(style) && (0, _height2.default)(node) < node.scrollHeight) return node; } return document; }
n/a
function scrollTop(node, val) { var win = (0, _isWindow2.default)(node); if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop ; if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val; }
n/a
function width(node, client) { var win = (0, _isWindow2.default)(node); return win ? win.innerWidth : client ? node.clientWidth : (0, _offset2.default)(node).width; }
n/a
function compatRaf(cb) { return raf(cb); }
n/a
cancel = function (id) { window[cancel] && typeof window[cancel] === 'function' && window[cancel](id); }
...
- events
+ `on(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `off(node, eventName, handler, [capture])`: capture is silently ignored in ie8
+ `listen(node, eventName, handler, [capture])`: wraps `on` and returns a function that calls `off` for you
+ `filter(selector, fn)`: returns a function handler that only fires when the target matches or is contained in the selector
ex: `events.on(list, 'click', events.filter('li > a', handler))`
- util
+ `requestAnimationFrame(cb)` returns an ID for canceling
* `requestAnimationFrame.cancel(id)`
+ `scrollTo(element, [scrollParent])`
...