| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720 |
- /**
- * Dom7 2.1.5
- * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
- * http://framework7.io/docs/dom.html
- *
- * Copyright 2020, Vladimir Kharlampidi
- * The iDangero.us
- * http://www.idangero.us/
- *
- * Licensed under MIT
- *
- * Released on: May 15, 2020
- */
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = global || self, global.Dom7 = factory());
- }(this, function () { 'use strict';
- /**
- * SSR Window 2.0.0
- * Better handling for window object in SSR environment
- * https://github.com/nolimits4web/ssr-window
- *
- * Copyright 2020, Vladimir Kharlampidi
- *
- * Licensed under MIT
- *
- * Released on: May 12, 2020
- */
- /* eslint-disable no-param-reassign */
- function isObject(obj) {
- return (obj !== null &&
- typeof obj === 'object' &&
- 'constructor' in obj &&
- obj.constructor === Object);
- }
- function extend(target, src) {
- if (target === void 0) { target = {}; }
- if (src === void 0) { src = {}; }
- Object.keys(src).forEach(function (key) {
- if (typeof target[key] === 'undefined')
- { target[key] = src[key]; }
- else if (isObject(src[key]) &&
- isObject(target[key]) &&
- Object.keys(src[key]).length > 0) {
- extend(target[key], src[key]);
- }
- });
- }
- var doc = typeof document !== 'undefined' ? document : {};
- var ssrDocument = {
- body: {},
- addEventListener: function () { },
- removeEventListener: function () { },
- activeElement: {
- blur: function () { },
- nodeName: '',
- },
- querySelector: function () {
- return null;
- },
- querySelectorAll: function () {
- return [];
- },
- getElementById: function () {
- return null;
- },
- createEvent: function () {
- return {
- initEvent: function () { },
- };
- },
- createElement: function () {
- return {
- children: [],
- childNodes: [],
- style: {},
- setAttribute: function () { },
- getElementsByTagName: function () {
- return [];
- },
- };
- },
- createElementNS: function () {
- return {};
- },
- importNode: function () {
- return null;
- },
- location: {
- hash: '',
- host: '',
- hostname: '',
- href: '',
- origin: '',
- pathname: '',
- protocol: '',
- search: '',
- },
- };
- extend(doc, ssrDocument);
- var win = typeof window !== 'undefined' ? window : {};
- var ssrWindow = {
- document: ssrDocument,
- navigator: {
- userAgent: '',
- },
- location: {
- hash: '',
- host: '',
- hostname: '',
- href: '',
- origin: '',
- pathname: '',
- protocol: '',
- search: '',
- },
- history: {
- replaceState: function () { },
- pushState: function () { },
- go: function () { },
- back: function () { },
- },
- CustomEvent: function CustomEvent() {
- return this;
- },
- addEventListener: function () { },
- removeEventListener: function () { },
- getComputedStyle: function () {
- return {
- getPropertyValue: function () {
- return '';
- },
- };
- },
- Image: function () { },
- Date: function () { },
- screen: {},
- setTimeout: function () { },
- clearTimeout: function () { },
- matchMedia: function () {
- return {};
- },
- };
- extend(win, ssrWindow);
- var Dom7 = function Dom7(arr) {
- var self = this;
- // Create array-like object
- for (var i = 0; i < arr.length; i += 1) {
- self[i] = arr[i];
- }
- self.length = arr.length;
- // Return collection with methods
- return this;
- };
- function $(selector, context) {
- var arr = [];
- var i = 0;
- if (selector && !context) {
- if (selector instanceof Dom7) {
- return selector;
- }
- }
- if (selector) {
- // String
- if (typeof selector === 'string') {
- var els;
- var tempParent;
- var html = selector.trim();
- if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
- var toCreate = 'div';
- if (html.indexOf('<li') === 0) { toCreate = 'ul'; }
- if (html.indexOf('<tr') === 0) { toCreate = 'tbody'; }
- if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) { toCreate = 'tr'; }
- if (html.indexOf('<tbody') === 0) { toCreate = 'table'; }
- if (html.indexOf('<option') === 0) { toCreate = 'select'; }
- tempParent = doc.createElement(toCreate);
- tempParent.innerHTML = html;
- for (i = 0; i < tempParent.childNodes.length; i += 1) {
- arr.push(tempParent.childNodes[i]);
- }
- } else {
- if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) {
- // Pure ID selector
- els = [doc.getElementById(selector.trim().split('#')[1])];
- } else {
- // Other selectors
- els = (context || doc).querySelectorAll(selector.trim());
- }
- for (i = 0; i < els.length; i += 1) {
- if (els[i]) { arr.push(els[i]); }
- }
- }
- } else if (selector.nodeType || selector === win || selector === doc) {
- // Node/element
- arr.push(selector);
- } else if (selector.length > 0 && selector[0].nodeType) {
- // Array of elements or instance of Dom
- for (i = 0; i < selector.length; i += 1) {
- arr.push(selector[i]);
- }
- }
- }
- return new Dom7(arr);
- }
- $.fn = Dom7.prototype;
- $.Class = Dom7;
- $.Dom7 = Dom7;
- function unique(arr) {
- var uniqueArray = [];
- for (var i = 0; i < arr.length; i += 1) {
- if (uniqueArray.indexOf(arr[i]) === -1) { uniqueArray.push(arr[i]); }
- }
- return uniqueArray;
- }
- function toCamelCase(string) {
- return string.toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); });
- }
- function requestAnimationFrame(callback) {
- if (win.requestAnimationFrame) { return win.requestAnimationFrame(callback); }
- else if (win.webkitRequestAnimationFrame) { return win.webkitRequestAnimationFrame(callback); }
- return win.setTimeout(callback, 1000 / 60);
- }
- function cancelAnimationFrame(id) {
- if (win.cancelAnimationFrame) { return win.cancelAnimationFrame(id); }
- else if (win.webkitCancelAnimationFrame) { return win.webkitCancelAnimationFrame(id); }
- return win.clearTimeout(id);
- }
- // Classes and attributes
- function addClass(className) {
- if (typeof className === 'undefined') {
- return this;
- }
- var classes = className.split(' ');
- for (var i = 0; i < classes.length; i += 1) {
- for (var j = 0; j < this.length; j += 1) {
- if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') { this[j].classList.add(classes[i]); }
- }
- }
- return this;
- }
- function removeClass(className) {
- var classes = className.split(' ');
- for (var i = 0; i < classes.length; i += 1) {
- for (var j = 0; j < this.length; j += 1) {
- if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') { this[j].classList.remove(classes[i]); }
- }
- }
- return this;
- }
- function hasClass(className) {
- if (!this[0]) { return false; }
- return this[0].classList.contains(className);
- }
- function toggleClass(className) {
- var classes = className.split(' ');
- for (var i = 0; i < classes.length; i += 1) {
- for (var j = 0; j < this.length; j += 1) {
- if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') { this[j].classList.toggle(classes[i]); }
- }
- }
- return this;
- }
- function attr(attrs, value) {
- var arguments$1 = arguments;
- if (arguments.length === 1 && typeof attrs === 'string') {
- // Get attr
- if (this[0]) { return this[0].getAttribute(attrs); }
- return undefined;
- }
- // Set attrs
- for (var i = 0; i < this.length; i += 1) {
- if (arguments$1.length === 2) {
- // String
- this[i].setAttribute(attrs, value);
- } else {
- // Object
- // eslint-disable-next-line
- for (var attrName in attrs) {
- this[i][attrName] = attrs[attrName];
- this[i].setAttribute(attrName, attrs[attrName]);
- }
- }
- }
- return this;
- }
- // eslint-disable-next-line
- function removeAttr(attr) {
- for (var i = 0; i < this.length; i += 1) {
- this[i].removeAttribute(attr);
- }
- return this;
- }
- // eslint-disable-next-line
- function prop(props, value) {
- var arguments$1 = arguments;
- if (arguments.length === 1 && typeof props === 'string') {
- // Get prop
- if (this[0]) { return this[0][props]; }
- } else {
- // Set props
- for (var i = 0; i < this.length; i += 1) {
- if (arguments$1.length === 2) {
- // String
- this[i][props] = value;
- } else {
- // Object
- // eslint-disable-next-line
- for (var propName in props) {
- this[i][propName] = props[propName];
- }
- }
- }
- return this;
- }
- }
- function data(key, value) {
- var el;
- if (typeof value === 'undefined') {
- el = this[0];
- // Get value
- if (el) {
- if (el.dom7ElementDataStorage && (key in el.dom7ElementDataStorage)) {
- return el.dom7ElementDataStorage[key];
- }
- var dataKey = el.getAttribute(("data-" + key));
- if (dataKey) {
- return dataKey;
- }
- return undefined;
- }
- return undefined;
- }
- // Set value
- for (var i = 0; i < this.length; i += 1) {
- el = this[i];
- if (!el.dom7ElementDataStorage) { el.dom7ElementDataStorage = {}; }
- el.dom7ElementDataStorage[key] = value;
- }
- return this;
- }
- function removeData(key) {
- for (var i = 0; i < this.length; i += 1) {
- var el = this[i];
- if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {
- el.dom7ElementDataStorage[key] = null;
- delete el.dom7ElementDataStorage[key];
- }
- }
- }
- function dataset() {
- var el = this[0];
- if (!el) { return undefined; }
- var dataset = {}; // eslint-disable-line
- if (el.dataset) {
- // eslint-disable-next-line
- for (var dataKey in el.dataset) {
- dataset[dataKey] = el.dataset[dataKey];
- }
- } else {
- for (var i = 0; i < el.attributes.length; i += 1) {
- // eslint-disable-next-line
- var attr = el.attributes[i];
- if (attr.name.indexOf('data-') >= 0) {
- dataset[toCamelCase(attr.name.split('data-')[1])] = attr.value;
- }
- }
- }
- // eslint-disable-next-line
- for (var key in dataset) {
- if (dataset[key] === 'false') { dataset[key] = false; }
- else if (dataset[key] === 'true') { dataset[key] = true; }
- else if (parseFloat(dataset[key]) === dataset[key] * 1) { dataset[key] *= 1; }
- }
- return dataset;
- }
- function val(value) {
- var dom = this;
- if (typeof value === 'undefined') {
- if (dom[0]) {
- if (dom[0].multiple && dom[0].nodeName.toLowerCase() === 'select') {
- var values = [];
- for (var i = 0; i < dom[0].selectedOptions.length; i += 1) {
- values.push(dom[0].selectedOptions[i].value);
- }
- return values;
- }
- return dom[0].value;
- }
- return undefined;
- }
- for (var i$1 = 0; i$1 < dom.length; i$1 += 1) {
- var el = dom[i$1];
- if (Array.isArray(value) && el.multiple && el.nodeName.toLowerCase() === 'select') {
- for (var j = 0; j < el.options.length; j += 1) {
- el.options[j].selected = value.indexOf(el.options[j].value) >= 0;
- }
- } else {
- el.value = value;
- }
- }
- return dom;
- }
- // Transforms
- // eslint-disable-next-line
- function transform(transform) {
- for (var i = 0; i < this.length; i += 1) {
- var elStyle = this[i].style;
- elStyle.webkitTransform = transform;
- elStyle.transform = transform;
- }
- return this;
- }
- function transition(duration) {
- if (typeof duration !== 'string') {
- duration = duration + "ms"; // eslint-disable-line
- }
- for (var i = 0; i < this.length; i += 1) {
- var elStyle = this[i].style;
- elStyle.webkitTransitionDuration = duration;
- elStyle.transitionDuration = duration;
- }
- return this;
- }
- // Events
- function on() {
- var assign;
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var eventType = args[0];
- var targetSelector = args[1];
- var listener = args[2];
- var capture = args[3];
- if (typeof args[1] === 'function') {
- (assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]);
- targetSelector = undefined;
- }
- if (!capture) { capture = false; }
- function handleLiveEvent(e) {
- var target = e.target;
- if (!target) { return; }
- var eventData = e.target.dom7EventData || [];
- if (eventData.indexOf(e) < 0) {
- eventData.unshift(e);
- }
- if ($(target).is(targetSelector)) { listener.apply(target, eventData); }
- else {
- var parents = $(target).parents(); // eslint-disable-line
- for (var k = 0; k < parents.length; k += 1) {
- if ($(parents[k]).is(targetSelector)) { listener.apply(parents[k], eventData); }
- }
- }
- }
- function handleEvent(e) {
- var eventData = e && e.target ? e.target.dom7EventData || [] : [];
- if (eventData.indexOf(e) < 0) {
- eventData.unshift(e);
- }
- listener.apply(this, eventData);
- }
- var events = eventType.split(' ');
- var j;
- for (var i = 0; i < this.length; i += 1) {
- var el = this[i];
- if (!targetSelector) {
- for (j = 0; j < events.length; j += 1) {
- var event = events[j];
- if (!el.dom7Listeners) { el.dom7Listeners = {}; }
- if (!el.dom7Listeners[event]) { el.dom7Listeners[event] = []; }
- el.dom7Listeners[event].push({
- listener: listener,
- proxyListener: handleEvent,
- });
- el.addEventListener(event, handleEvent, capture);
- }
- } else {
- // Live events
- for (j = 0; j < events.length; j += 1) {
- var event$1 = events[j];
- if (!el.dom7LiveListeners) { el.dom7LiveListeners = {}; }
- if (!el.dom7LiveListeners[event$1]) { el.dom7LiveListeners[event$1] = []; }
- el.dom7LiveListeners[event$1].push({
- listener: listener,
- proxyListener: handleLiveEvent,
- });
- el.addEventListener(event$1, handleLiveEvent, capture);
- }
- }
- }
- return this;
- }
- function off() {
- var assign;
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var eventType = args[0];
- var targetSelector = args[1];
- var listener = args[2];
- var capture = args[3];
- if (typeof args[1] === 'function') {
- (assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]);
- targetSelector = undefined;
- }
- if (!capture) { capture = false; }
- var events = eventType.split(' ');
- for (var i = 0; i < events.length; i += 1) {
- var event = events[i];
- for (var j = 0; j < this.length; j += 1) {
- var el = this[j];
- var handlers = (void 0);
- if (!targetSelector && el.dom7Listeners) {
- handlers = el.dom7Listeners[event];
- } else if (targetSelector && el.dom7LiveListeners) {
- handlers = el.dom7LiveListeners[event];
- }
- if (handlers && handlers.length) {
- for (var k = handlers.length - 1; k >= 0; k -= 1) {
- var handler = handlers[k];
- if (listener && handler.listener === listener) {
- el.removeEventListener(event, handler.proxyListener, capture);
- handlers.splice(k, 1);
- } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {
- el.removeEventListener(event, handler.proxyListener, capture);
- handlers.splice(k, 1);
- } else if (!listener) {
- el.removeEventListener(event, handler.proxyListener, capture);
- handlers.splice(k, 1);
- }
- }
- }
- }
- }
- return this;
- }
- function once() {
- var assign;
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var dom = this;
- var eventName = args[0];
- var targetSelector = args[1];
- var listener = args[2];
- var capture = args[3];
- if (typeof args[1] === 'function') {
- (assign = args, eventName = assign[0], listener = assign[1], capture = assign[2]);
- targetSelector = undefined;
- }
- function onceHandler() {
- var eventArgs = [], len = arguments.length;
- while ( len-- ) eventArgs[ len ] = arguments[ len ];
- listener.apply(this, eventArgs);
- dom.off(eventName, targetSelector, onceHandler, capture);
- if (onceHandler.dom7proxy) {
- delete onceHandler.dom7proxy;
- }
- }
- onceHandler.dom7proxy = listener;
- return dom.on(eventName, targetSelector, onceHandler, capture);
- }
- function trigger() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var events = args[0].split(' ');
- var eventData = args[1];
- for (var i = 0; i < events.length; i += 1) {
- var event = events[i];
- for (var j = 0; j < this.length; j += 1) {
- var el = this[j];
- var evt = (void 0);
- try {
- evt = new win.CustomEvent(event, {
- detail: eventData,
- bubbles: true,
- cancelable: true,
- });
- } catch (e) {
- evt = doc.createEvent('Event');
- evt.initEvent(event, true, true);
- evt.detail = eventData;
- }
- // eslint-disable-next-line
- el.dom7EventData = args.filter(function (data, dataIndex) { return dataIndex > 0; });
- el.dispatchEvent(evt);
- el.dom7EventData = [];
- delete el.dom7EventData;
- }
- }
- return this;
- }
- function transitionEnd(callback) {
- var events = ['webkitTransitionEnd', 'transitionend'];
- var dom = this;
- var i;
- function fireCallBack(e) {
- /* jshint validthis:true */
- if (e.target !== this) { return; }
- callback.call(this, e);
- for (i = 0; i < events.length; i += 1) {
- dom.off(events[i], fireCallBack);
- }
- }
- if (callback) {
- for (i = 0; i < events.length; i += 1) {
- dom.on(events[i], fireCallBack);
- }
- }
- return this;
- }
- function animationEnd(callback) {
- var events = ['webkitAnimationEnd', 'animationend'];
- var dom = this;
- var i;
- function fireCallBack(e) {
- if (e.target !== this) { return; }
- callback.call(this, e);
- for (i = 0; i < events.length; i += 1) {
- dom.off(events[i], fireCallBack);
- }
- }
- if (callback) {
- for (i = 0; i < events.length; i += 1) {
- dom.on(events[i], fireCallBack);
- }
- }
- return this;
- }
- // Sizing/Styles
- function width() {
- if (this[0] === win) {
- return win.innerWidth;
- }
- if (this.length > 0) {
- return parseFloat(this.css('width'));
- }
- return null;
- }
- function outerWidth(includeMargins) {
- if (this.length > 0) {
- if (includeMargins) {
- // eslint-disable-next-line
- var styles = this.styles();
- return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left'));
- }
- return this[0].offsetWidth;
- }
- return null;
- }
- function height() {
- if (this[0] === win) {
- return win.innerHeight;
- }
- if (this.length > 0) {
- return parseFloat(this.css('height'));
- }
- return null;
- }
- function outerHeight(includeMargins) {
- if (this.length > 0) {
- if (includeMargins) {
- // eslint-disable-next-line
- var styles = this.styles();
- return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom'));
- }
- return this[0].offsetHeight;
- }
- return null;
- }
- function offset() {
- if (this.length > 0) {
- var el = this[0];
- var box = el.getBoundingClientRect();
- var body = doc.body;
- var clientTop = el.clientTop || body.clientTop || 0;
- var clientLeft = el.clientLeft || body.clientLeft || 0;
- var scrollTop = el === win ? win.scrollY : el.scrollTop;
- var scrollLeft = el === win ? win.scrollX : el.scrollLeft;
- return {
- top: (box.top + scrollTop) - clientTop,
- left: (box.left + scrollLeft) - clientLeft,
- };
- }
- return null;
- }
- function hide() {
- for (var i = 0; i < this.length; i += 1) {
- this[i].style.display = 'none';
- }
- return this;
- }
- function show() {
- for (var i = 0; i < this.length; i += 1) {
- var el = this[i];
- if (el.style.display === 'none') {
- el.style.display = '';
- }
- if (win.getComputedStyle(el, null).getPropertyValue('display') === 'none') {
- // Still not visible
- el.style.display = 'block';
- }
- }
- return this;
- }
- function styles() {
- if (this[0]) { return win.getComputedStyle(this[0], null); }
- return {};
- }
- function css(props, value) {
- var i;
- if (arguments.length === 1) {
- if (typeof props === 'string') {
- if (this[0]) { return win.getComputedStyle(this[0], null).getPropertyValue(props); }
- } else {
- for (i = 0; i < this.length; i += 1) {
- // eslint-disable-next-line
- for (var prop in props) {
- this[i].style[prop] = props[prop];
- }
- }
- return this;
- }
- }
- if (arguments.length === 2 && typeof props === 'string') {
- for (i = 0; i < this.length; i += 1) {
- this[i].style[props] = value;
- }
- return this;
- }
- return this;
- }
- // Dom manipulation
- function toArray() {
- var arr = [];
- for (var i = 0; i < this.length; i += 1) {
- arr.push(this[i]);
- }
- return arr;
- }
- // Iterate over the collection passing elements to `callback`
- function each(callback) {
- // Don't bother continuing without a callback
- if (!callback) { return this; }
- // Iterate over the current collection
- for (var i = 0; i < this.length; i += 1) {
- // If the callback returns false
- if (callback.call(this[i], i, this[i]) === false) {
- // End the loop early
- return this;
- }
- }
- // Return `this` to allow chained DOM operations
- return this;
- }
- function forEach(callback) {
- // Don't bother continuing without a callback
- if (!callback) { return this; }
- // Iterate over the current collection
- for (var i = 0; i < this.length; i += 1) {
- // If the callback returns false
- if (callback.call(this[i], this[i], i) === false) {
- // End the loop early
- return this;
- }
- }
- // Return `this` to allow chained DOM operations
- return this;
- }
- function filter(callback) {
- var matchedItems = [];
- var dom = this;
- for (var i = 0; i < dom.length; i += 1) {
- if (callback.call(dom[i], i, dom[i])) { matchedItems.push(dom[i]); }
- }
- return new Dom7(matchedItems);
- }
- function map(callback) {
- var modifiedItems = [];
- var dom = this;
- for (var i = 0; i < dom.length; i += 1) {
- modifiedItems.push(callback.call(dom[i], i, dom[i]));
- }
- return new Dom7(modifiedItems);
- }
- // eslint-disable-next-line
- function html(html) {
- if (typeof html === 'undefined') {
- return this[0] ? this[0].innerHTML : undefined;
- }
- for (var i = 0; i < this.length; i += 1) {
- this[i].innerHTML = html;
- }
- return this;
- }
- // eslint-disable-next-line
- function text(text) {
- if (typeof text === 'undefined') {
- if (this[0]) {
- return this[0].textContent.trim();
- }
- return null;
- }
- for (var i = 0; i < this.length; i += 1) {
- this[i].textContent = text;
- }
- return this;
- }
- function is(selector) {
- var el = this[0];
- var compareWith;
- var i;
- if (!el || typeof selector === 'undefined') { return false; }
- if (typeof selector === 'string') {
- if (el.matches) { return el.matches(selector); }
- else if (el.webkitMatchesSelector) { return el.webkitMatchesSelector(selector); }
- else if (el.msMatchesSelector) { return el.msMatchesSelector(selector); }
- compareWith = $(selector);
- for (i = 0; i < compareWith.length; i += 1) {
- if (compareWith[i] === el) { return true; }
- }
- return false;
- } else if (selector === doc) { return el === doc; }
- else if (selector === win) { return el === win; }
- if (selector.nodeType || selector instanceof Dom7) {
- compareWith = selector.nodeType ? [selector] : selector;
- for (i = 0; i < compareWith.length; i += 1) {
- if (compareWith[i] === el) { return true; }
- }
- return false;
- }
- return false;
- }
- function indexOf(el) {
- for (var i = 0; i < this.length; i += 1) {
- if (this[i] === el) { return i; }
- }
- return -1;
- }
- function index() {
- var child = this[0];
- var i;
- if (child) {
- i = 0;
- // eslint-disable-next-line
- while ((child = child.previousSibling) !== null) {
- if (child.nodeType === 1) { i += 1; }
- }
- return i;
- }
- return undefined;
- }
- // eslint-disable-next-line
- function eq(index) {
- if (typeof index === 'undefined') { return this; }
- var length = this.length;
- var returnIndex;
- if (index > length - 1) {
- return new Dom7([]);
- }
- if (index < 0) {
- returnIndex = length + index;
- if (returnIndex < 0) { return new Dom7([]); }
- return new Dom7([this[returnIndex]]);
- }
- return new Dom7([this[index]]);
- }
- function append() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var newChild;
- for (var k = 0; k < args.length; k += 1) {
- newChild = args[k];
- for (var i = 0; i < this.length; i += 1) {
- if (typeof newChild === 'string') {
- var tempDiv = doc.createElement('div');
- tempDiv.innerHTML = newChild;
- while (tempDiv.firstChild) {
- this[i].appendChild(tempDiv.firstChild);
- }
- } else if (newChild instanceof Dom7) {
- for (var j = 0; j < newChild.length; j += 1) {
- this[i].appendChild(newChild[j]);
- }
- } else {
- this[i].appendChild(newChild);
- }
- }
- }
- return this;
- }
- // eslint-disable-next-line
- function appendTo(parent) {
- $(parent).append(this);
- return this;
- }
- function prepend(newChild) {
- var i;
- var j;
- for (i = 0; i < this.length; i += 1) {
- if (typeof newChild === 'string') {
- var tempDiv = doc.createElement('div');
- tempDiv.innerHTML = newChild;
- for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {
- this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
- }
- } else if (newChild instanceof Dom7) {
- for (j = 0; j < newChild.length; j += 1) {
- this[i].insertBefore(newChild[j], this[i].childNodes[0]);
- }
- } else {
- this[i].insertBefore(newChild, this[i].childNodes[0]);
- }
- }
- return this;
- }
- // eslint-disable-next-line
- function prependTo(parent) {
- $(parent).prepend(this);
- return this;
- }
- function insertBefore(selector) {
- var before = $(selector);
- for (var i = 0; i < this.length; i += 1) {
- if (before.length === 1) {
- before[0].parentNode.insertBefore(this[i], before[0]);
- } else if (before.length > 1) {
- for (var j = 0; j < before.length; j += 1) {
- before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);
- }
- }
- }
- }
- function insertAfter(selector) {
- var after = $(selector);
- for (var i = 0; i < this.length; i += 1) {
- if (after.length === 1) {
- after[0].parentNode.insertBefore(this[i], after[0].nextSibling);
- } else if (after.length > 1) {
- for (var j = 0; j < after.length; j += 1) {
- after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);
- }
- }
- }
- }
- function next(selector) {
- if (this.length > 0) {
- if (selector) {
- if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {
- return new Dom7([this[0].nextElementSibling]);
- }
- return new Dom7([]);
- }
- if (this[0].nextElementSibling) { return new Dom7([this[0].nextElementSibling]); }
- return new Dom7([]);
- }
- return new Dom7([]);
- }
- function nextAll(selector) {
- var nextEls = [];
- var el = this[0];
- if (!el) { return new Dom7([]); }
- while (el.nextElementSibling) {
- var next = el.nextElementSibling; // eslint-disable-line
- if (selector) {
- if ($(next).is(selector)) { nextEls.push(next); }
- } else { nextEls.push(next); }
- el = next;
- }
- return new Dom7(nextEls);
- }
- function prev(selector) {
- if (this.length > 0) {
- var el = this[0];
- if (selector) {
- if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {
- return new Dom7([el.previousElementSibling]);
- }
- return new Dom7([]);
- }
- if (el.previousElementSibling) { return new Dom7([el.previousElementSibling]); }
- return new Dom7([]);
- }
- return new Dom7([]);
- }
- function prevAll(selector) {
- var prevEls = [];
- var el = this[0];
- if (!el) { return new Dom7([]); }
- while (el.previousElementSibling) {
- var prev = el.previousElementSibling; // eslint-disable-line
- if (selector) {
- if ($(prev).is(selector)) { prevEls.push(prev); }
- } else { prevEls.push(prev); }
- el = prev;
- }
- return new Dom7(prevEls);
- }
- function siblings(selector) {
- return this.nextAll(selector).add(this.prevAll(selector));
- }
- function parent(selector) {
- var parents = []; // eslint-disable-line
- for (var i = 0; i < this.length; i += 1) {
- if (this[i].parentNode !== null) {
- if (selector) {
- if ($(this[i].parentNode).is(selector)) { parents.push(this[i].parentNode); }
- } else {
- parents.push(this[i].parentNode);
- }
- }
- }
- return $(unique(parents));
- }
- function parents(selector) {
- var parents = []; // eslint-disable-line
- for (var i = 0; i < this.length; i += 1) {
- var parent = this[i].parentNode; // eslint-disable-line
- while (parent) {
- if (selector) {
- if ($(parent).is(selector)) { parents.push(parent); }
- } else {
- parents.push(parent);
- }
- parent = parent.parentNode;
- }
- }
- return $(unique(parents));
- }
- function closest(selector) {
- var closest = this; // eslint-disable-line
- if (typeof selector === 'undefined') {
- return new Dom7([]);
- }
- if (!closest.is(selector)) {
- closest = closest.parents(selector).eq(0);
- }
- return closest;
- }
- function find(selector) {
- var foundElements = [];
- for (var i = 0; i < this.length; i += 1) {
- var found = this[i].querySelectorAll(selector);
- for (var j = 0; j < found.length; j += 1) {
- foundElements.push(found[j]);
- }
- }
- return new Dom7(foundElements);
- }
- function children(selector) {
- var children = []; // eslint-disable-line
- for (var i = 0; i < this.length; i += 1) {
- var childNodes = this[i].childNodes;
- for (var j = 0; j < childNodes.length; j += 1) {
- if (!selector) {
- if (childNodes[j].nodeType === 1) { children.push(childNodes[j]); }
- } else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) {
- children.push(childNodes[j]);
- }
- }
- }
- return new Dom7(unique(children));
- }
- function remove() {
- for (var i = 0; i < this.length; i += 1) {
- if (this[i].parentNode) { this[i].parentNode.removeChild(this[i]); }
- }
- return this;
- }
- function detach() {
- return this.remove();
- }
- function add() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var dom = this;
- var i;
- var j;
- for (i = 0; i < args.length; i += 1) {
- var toAdd = $(args[i]);
- for (j = 0; j < toAdd.length; j += 1) {
- dom[dom.length] = toAdd[j];
- dom.length += 1;
- }
- }
- return dom;
- }
- function empty() {
- for (var i = 0; i < this.length; i += 1) {
- var el = this[i];
- if (el.nodeType === 1) {
- for (var j = 0; j < el.childNodes.length; j += 1) {
- if (el.childNodes[j].parentNode) {
- el.childNodes[j].parentNode.removeChild(el.childNodes[j]);
- }
- }
- el.textContent = '';
- }
- }
- return this;
- }
- var Methods = /*#__PURE__*/Object.freeze({
- addClass: addClass,
- removeClass: removeClass,
- hasClass: hasClass,
- toggleClass: toggleClass,
- attr: attr,
- removeAttr: removeAttr,
- prop: prop,
- data: data,
- removeData: removeData,
- dataset: dataset,
- val: val,
- transform: transform,
- transition: transition,
- on: on,
- off: off,
- once: once,
- trigger: trigger,
- transitionEnd: transitionEnd,
- animationEnd: animationEnd,
- width: width,
- outerWidth: outerWidth,
- height: height,
- outerHeight: outerHeight,
- offset: offset,
- hide: hide,
- show: show,
- styles: styles,
- css: css,
- toArray: toArray,
- each: each,
- forEach: forEach,
- filter: filter,
- map: map,
- html: html,
- text: text,
- is: is,
- indexOf: indexOf,
- index: index,
- eq: eq,
- append: append,
- appendTo: appendTo,
- prepend: prepend,
- prependTo: prependTo,
- insertBefore: insertBefore,
- insertAfter: insertAfter,
- next: next,
- nextAll: nextAll,
- prev: prev,
- prevAll: prevAll,
- siblings: siblings,
- parent: parent,
- parents: parents,
- closest: closest,
- find: find,
- children: children,
- remove: remove,
- detach: detach,
- add: add,
- empty: empty
- });
- function scrollTo() {
- var assign;
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var left = args[0];
- var top = args[1];
- var duration = args[2];
- var easing = args[3];
- var callback = args[4];
- if (args.length === 4 && typeof easing === 'function') {
- callback = easing;
- (assign = args, left = assign[0], top = assign[1], duration = assign[2], callback = assign[3], easing = assign[4]);
- }
- if (typeof easing === 'undefined') { easing = 'swing'; }
- return this.each(function animate() {
- var el = this;
- var currentTop;
- var currentLeft;
- var maxTop;
- var maxLeft;
- var newTop;
- var newLeft;
- var scrollTop; // eslint-disable-line
- var scrollLeft; // eslint-disable-line
- var animateTop = top > 0 || top === 0;
- var animateLeft = left > 0 || left === 0;
- if (typeof easing === 'undefined') {
- easing = 'swing';
- }
- if (animateTop) {
- currentTop = el.scrollTop;
- if (!duration) {
- el.scrollTop = top;
- }
- }
- if (animateLeft) {
- currentLeft = el.scrollLeft;
- if (!duration) {
- el.scrollLeft = left;
- }
- }
- if (!duration) { return; }
- if (animateTop) {
- maxTop = el.scrollHeight - el.offsetHeight;
- newTop = Math.max(Math.min(top, maxTop), 0);
- }
- if (animateLeft) {
- maxLeft = el.scrollWidth - el.offsetWidth;
- newLeft = Math.max(Math.min(left, maxLeft), 0);
- }
- var startTime = null;
- if (animateTop && newTop === currentTop) { animateTop = false; }
- if (animateLeft && newLeft === currentLeft) { animateLeft = false; }
- function render(time) {
- if ( time === void 0 ) time = new Date().getTime();
- if (startTime === null) {
- startTime = time;
- }
- var progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
- var easeProgress = easing === 'linear' ? progress : (0.5 - (Math.cos(progress * Math.PI) / 2));
- var done;
- if (animateTop) { scrollTop = currentTop + (easeProgress * (newTop - currentTop)); }
- if (animateLeft) { scrollLeft = currentLeft + (easeProgress * (newLeft - currentLeft)); }
- if (animateTop && newTop > currentTop && scrollTop >= newTop) {
- el.scrollTop = newTop;
- done = true;
- }
- if (animateTop && newTop < currentTop && scrollTop <= newTop) {
- el.scrollTop = newTop;
- done = true;
- }
- if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) {
- el.scrollLeft = newLeft;
- done = true;
- }
- if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) {
- el.scrollLeft = newLeft;
- done = true;
- }
- if (done) {
- if (callback) { callback(); }
- return;
- }
- if (animateTop) { el.scrollTop = scrollTop; }
- if (animateLeft) { el.scrollLeft = scrollLeft; }
- requestAnimationFrame(render);
- }
- requestAnimationFrame(render);
- });
- }
- // scrollTop(top, duration, easing, callback) {
- function scrollTop() {
- var assign;
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var top = args[0];
- var duration = args[1];
- var easing = args[2];
- var callback = args[3];
- if (args.length === 3 && typeof easing === 'function') {
- (assign = args, top = assign[0], duration = assign[1], callback = assign[2], easing = assign[3]);
- }
- var dom = this;
- if (typeof top === 'undefined') {
- if (dom.length > 0) { return dom[0].scrollTop; }
- return null;
- }
- return dom.scrollTo(undefined, top, duration, easing, callback);
- }
- function scrollLeft() {
- var assign;
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var left = args[0];
- var duration = args[1];
- var easing = args[2];
- var callback = args[3];
- if (args.length === 3 && typeof easing === 'function') {
- (assign = args, left = assign[0], duration = assign[1], callback = assign[2], easing = assign[3]);
- }
- var dom = this;
- if (typeof left === 'undefined') {
- if (dom.length > 0) { return dom[0].scrollLeft; }
- return null;
- }
- return dom.scrollTo(left, undefined, duration, easing, callback);
- }
- var Scroll = /*#__PURE__*/Object.freeze({
- scrollTo: scrollTo,
- scrollTop: scrollTop,
- scrollLeft: scrollLeft
- });
- function animate(initialProps, initialParams) {
- var els = this;
- var a = {
- props: Object.assign({}, initialProps),
- params: Object.assign({
- duration: 300,
- easing: 'swing', // or 'linear'
- /* Callbacks
- begin(elements)
- complete(elements)
- progress(elements, complete, remaining, start, tweenValue)
- */
- }, initialParams),
- elements: els,
- animating: false,
- que: [],
- easingProgress: function easingProgress(easing, progress) {
- if (easing === 'swing') {
- return 0.5 - (Math.cos(progress * Math.PI) / 2);
- }
- if (typeof easing === 'function') {
- return easing(progress);
- }
- return progress;
- },
- stop: function stop() {
- if (a.frameId) {
- cancelAnimationFrame(a.frameId);
- }
- a.animating = false;
- a.elements.each(function (index, el) {
- var element = el;
- delete element.dom7AnimateInstance;
- });
- a.que = [];
- },
- done: function done(complete) {
- a.animating = false;
- a.elements.each(function (index, el) {
- var element = el;
- delete element.dom7AnimateInstance;
- });
- if (complete) { complete(els); }
- if (a.que.length > 0) {
- var que = a.que.shift();
- a.animate(que[0], que[1]);
- }
- },
- animate: function animate(props, params) {
- if (a.animating) {
- a.que.push([props, params]);
- return a;
- }
- var elements = [];
- // Define & Cache Initials & Units
- a.elements.each(function (index, el) {
- var initialFullValue;
- var initialValue;
- var unit;
- var finalValue;
- var finalFullValue;
- if (!el.dom7AnimateInstance) { a.elements[index].dom7AnimateInstance = a; }
- elements[index] = {
- container: el,
- };
- Object.keys(props).forEach(function (prop) {
- initialFullValue = win.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.');
- initialValue = parseFloat(initialFullValue);
- unit = initialFullValue.replace(initialValue, '');
- finalValue = parseFloat(props[prop]);
- finalFullValue = props[prop] + unit;
- elements[index][prop] = {
- initialFullValue: initialFullValue,
- initialValue: initialValue,
- unit: unit,
- finalValue: finalValue,
- finalFullValue: finalFullValue,
- currentValue: initialValue,
- };
- });
- });
- var startTime = null;
- var time;
- var elementsDone = 0;
- var propsDone = 0;
- var done;
- var began = false;
- a.animating = true;
- function render() {
- time = new Date().getTime();
- var progress;
- var easeProgress;
- // let el;
- if (!began) {
- began = true;
- if (params.begin) { params.begin(els); }
- }
- if (startTime === null) {
- startTime = time;
- }
- if (params.progress) {
- // eslint-disable-next-line
- params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), ((startTime + params.duration) - time < 0 ? 0 : (startTime + params.duration) - time), startTime);
- }
- elements.forEach(function (element) {
- var el = element;
- if (done || el.done) { return; }
- Object.keys(props).forEach(function (prop) {
- if (done || el.done) { return; }
- progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0);
- easeProgress = a.easingProgress(params.easing, progress);
- var ref = el[prop];
- var initialValue = ref.initialValue;
- var finalValue = ref.finalValue;
- var unit = ref.unit;
- el[prop].currentValue = initialValue + (easeProgress * (finalValue - initialValue));
- var currentValue = el[prop].currentValue;
- if (
- (finalValue > initialValue && currentValue >= finalValue) ||
- (finalValue < initialValue && currentValue <= finalValue)) {
- el.container.style[prop] = finalValue + unit;
- propsDone += 1;
- if (propsDone === Object.keys(props).length) {
- el.done = true;
- elementsDone += 1;
- }
- if (elementsDone === elements.length) {
- done = true;
- }
- }
- if (done) {
- a.done(params.complete);
- return;
- }
- el.container.style[prop] = currentValue + unit;
- });
- });
- if (done) { return; }
- // Then call
- a.frameId = requestAnimationFrame(render);
- }
- a.frameId = requestAnimationFrame(render);
- return a;
- },
- };
- if (a.elements.length === 0) {
- return els;
- }
- var animateInstance;
- for (var i = 0; i < a.elements.length; i += 1) {
- if (a.elements[i].dom7AnimateInstance) {
- animateInstance = a.elements[i].dom7AnimateInstance;
- } else { a.elements[i].dom7AnimateInstance = a; }
- }
- if (!animateInstance) {
- animateInstance = a;
- }
- if (initialProps === 'stop') {
- animateInstance.stop();
- } else {
- animateInstance.animate(a.props, a.params);
- }
- return els;
- }
- function stop() {
- var els = this;
- for (var i = 0; i < els.length; i += 1) {
- if (els[i].dom7AnimateInstance) {
- els[i].dom7AnimateInstance.stop();
- }
- }
- }
- var Animate = /*#__PURE__*/Object.freeze({
- animate: animate,
- stop: stop
- });
- var noTrigger = ('resize scroll').split(' ');
- function eventShortcut(name) {
- var ref;
- var args = [], len = arguments.length - 1;
- while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
- if (typeof args[0] === 'undefined') {
- for (var i = 0; i < this.length; i += 1) {
- if (noTrigger.indexOf(name) < 0) {
- if (name in this[i]) { this[i][name](); }
- else {
- $(this[i]).trigger(name);
- }
- }
- }
- return this;
- }
- return (ref = this).on.apply(ref, [ name ].concat( args ));
- }
- function click() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'click' ].concat( args ));
- }
- function blur() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'blur' ].concat( args ));
- }
- function focus() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'focus' ].concat( args ));
- }
- function focusin() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'focusin' ].concat( args ));
- }
- function focusout() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'focusout' ].concat( args ));
- }
- function keyup() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'keyup' ].concat( args ));
- }
- function keydown() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'keydown' ].concat( args ));
- }
- function keypress() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'keypress' ].concat( args ));
- }
- function submit() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'submit' ].concat( args ));
- }
- function change() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'change' ].concat( args ));
- }
- function mousedown() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mousedown' ].concat( args ));
- }
- function mousemove() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mousemove' ].concat( args ));
- }
- function mouseup() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mouseup' ].concat( args ));
- }
- function mouseenter() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mouseenter' ].concat( args ));
- }
- function mouseleave() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mouseleave' ].concat( args ));
- }
- function mouseout() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mouseout' ].concat( args ));
- }
- function mouseover() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'mouseover' ].concat( args ));
- }
- function touchstart() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'touchstart' ].concat( args ));
- }
- function touchend() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'touchend' ].concat( args ));
- }
- function touchmove() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'touchmove' ].concat( args ));
- }
- function resize() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'resize' ].concat( args ));
- }
- function scroll() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return eventShortcut.bind(this).apply(void 0, [ 'scroll' ].concat( args ));
- }
- var eventShortcuts = /*#__PURE__*/Object.freeze({
- click: click,
- blur: blur,
- focus: focus,
- focusin: focusin,
- focusout: focusout,
- keyup: keyup,
- keydown: keydown,
- keypress: keypress,
- submit: submit,
- change: change,
- mousedown: mousedown,
- mousemove: mousemove,
- mouseup: mouseup,
- mouseenter: mouseenter,
- mouseleave: mouseleave,
- mouseout: mouseout,
- mouseover: mouseover,
- touchstart: touchstart,
- touchend: touchend,
- touchmove: touchmove,
- resize: resize,
- scroll: scroll
- });
- [Methods, Scroll, Animate, eventShortcuts].forEach(function (group) {
- Object.keys(group).forEach(function (methodName) {
- $.fn[methodName] = group[methodName];
- });
- });
- return $;
- }));
|