diff --git a/dist/gaspard.umd.js b/dist/gaspard.umd.js index def084e..b0b418b 100644 --- a/dist/gaspard.umd.js +++ b/dist/gaspard.umd.js @@ -1,3 +1,3 @@ /*! gaspard | (c) 2018 Luca Perret | MIT | https://github.com/lucaperret/gaspard */ -!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("gaspard",[],n):"object"==typeof exports?exports.gaspard=n():t.gaspard=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){"use strict";function r(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n1&&void 0!==arguments[1]?arguments[1]:document;if(n instanceof Element==!1&&n instanceof HTMLDocument==!1)throw new TypeError("You should provide a valid dom node as second argument");var e=void 0;return(e=/^#[\w-]*$/.test(t)?document.getElementById(t.substr(1))||[]:/^\.[\w-]*$/.test(t)?n.getElementsByClassName(t.slice(1)):/^\w+$/.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t)).length&&(e=[].concat(r(e))),e}function i(t,n){return"string"==typeof n?(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,n):t===n}function u(t,n){return t!==n&&t.contains(n)}function c(t){return t.previousElementSibling}function f(t){return t.nextElementSibling}function a(t){return[].concat(r(t.parentNode.children)).filter(function(n){return n!==t})}function s(t){return t.parentNode}function d(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(" ").filter(function(t){return!!t})}function l(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n1&&void 0!==arguments[1]?arguments[1]:400,e=arguments[2];t.style.opacity=e?0:1;var r=+new Date;!function o(){var i=(new Date-r)*(e?1:-1);t.style.opacity=+t.style.opacity+i/n,r=+new Date,(e?+t.style.opacity<1:+t.style.opacity>0)&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))}()}function j(t,n){H(t,n,!0)}function N(t,n){H(t,n,!1)}function O(t){t.style.display="none"}function B(t){t.style.display=""}function D(t){return t.getBoundingClientRect()}function I(t){var n=D(t);return{top:n.top+document.body.scrollTop,left:n.left+document.body.scrollLeft}}function P(t){return{left:t.offsetLeft,top:t.offsetTop}}function R(t,n){var e=t.offsetHeight;if(n){var r=getComputedStyle(t);e+=parseInt(r.marginTop||0)+parseInt(r.marginBottom||0)}return e}function $(t,n){var e=t.offsetWidth;if(n){var r=getComputedStyle(t);e+=parseInt(r.marginLeft||0)+parseInt(r.marginRight||0)}return e}function _(t,n,e){t.removeEventListener(n,e)}function q(t,n,e){t.addEventListener(n,e)}function W(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!!t["on"+n],o=void 0;window.CustomEvent?o=new CustomEvent(n,{detail:e}):(o=document.createEvent("CustomEvent")).initCustomEvent(n,!0,!r,e),t.dispatchEvent(o)}function F(t){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?t():document.addEventListener("DOMContentLoaded",t)}e.r(n),e.d(n,"find",function(){return o}),e.d(n,"is",function(){return i}),e.d(n,"contains",function(){return u}),e.d(n,"prev",function(){return c}),e.d(n,"next",function(){return f}),e.d(n,"siblings",function(){return a}),e.d(n,"parent",function(){return s}),e.d(n,"hasClass",function(){return p}),e.d(n,"addClass",function(){return m}),e.d(n,"removeClass",function(){return v}),e.d(n,"toggleClass",function(){return y}),e.d(n,"attr",function(){return g}),e.d(n,"css",function(){return h}),e.d(n,"parseHTML",function(){return b}),e.d(n,"before",function(){return L}),e.d(n,"after",function(){return w}),e.d(n,"prepend",function(){return C}),e.d(n,"append",function(){return E}),e.d(n,"clone",function(){return x}),e.d(n,"remove",function(){return A}),e.d(n,"text",function(){return M}),e.d(n,"html",function(){return T}),e.d(n,"replaceWith",function(){return S}),e.d(n,"fadeIn",function(){return j}),e.d(n,"fadeOut",function(){return N}),e.d(n,"hide",function(){return O}),e.d(n,"show",function(){return B}),e.d(n,"viewportPosition",function(){return D}),e.d(n,"offset",function(){return I}),e.d(n,"position",function(){return P}),e.d(n,"outerHeight",function(){return R}),e.d(n,"outerWidth",function(){return $}),e.d(n,"off",function(){return _}),e.d(n,"on",function(){return q}),e.d(n,"trigger",function(){return W}),e.d(n,"documentReady",function(){return F})}])}); +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("gaspard",[],n):"object"==typeof exports?exports.gaspard=n():t.gaspard=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){"use strict";function r(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n1&&void 0!==arguments[1]?arguments[1]:document;if(n instanceof Element==!1&&n instanceof Document==!1)throw new TypeError("You should provide a valid dom node as second argument");var e=void 0;return(e=/^#[\w-]*$/.test(t)?document.getElementById(t.substr(1))||[]:/^\.[\w-]*$/.test(t)?n.getElementsByClassName(t.slice(1)):/^\w+$/.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t)).length&&(e=[].concat(r(e))),e}function i(t,n){return"string"==typeof n?(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,n):t===n}function u(t,n){return t!==n&&t.contains(n)}function c(t){return t.previousElementSibling}function f(t){return t.nextElementSibling}function a(t){return[].concat(r(t.parentNode.children)).filter(function(n){return n!==t})}function s(t){return t.parentNode}function d(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(" ").filter(function(t){return!!t})}function l(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n1&&void 0!==arguments[1]?arguments[1]:400,e=arguments[2];t.style.opacity=e?0:1;var r=+new Date;!function o(){var i=(new Date-r)*(e?1:-1);t.style.opacity=+t.style.opacity+i/n,r=+new Date,(e?+t.style.opacity<1:+t.style.opacity>0)&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))}()}function H(t,n){j(t,n,!0)}function N(t,n){j(t,n,!1)}function O(t){t.style.display="none"}function B(t){t.style.display=""}function D(t){return t.getBoundingClientRect()}function I(t){var n=D(t);return{top:n.top+document.body.scrollTop,left:n.left+document.body.scrollLeft}}function P(t){return{left:t.offsetLeft,top:t.offsetTop}}function R(t,n){var e=t.offsetHeight;if(n){var r=getComputedStyle(t);e+=parseInt(r.marginTop||0)+parseInt(r.marginBottom||0)}return e}function $(t,n){var e=t.offsetWidth;if(n){var r=getComputedStyle(t);e+=parseInt(r.marginLeft||0)+parseInt(r.marginRight||0)}return e}function _(t,n,e){t.removeEventListener(n,e)}function q(t,n,e){t.addEventListener(n,e)}function W(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!!t["on"+n],o=void 0;window.CustomEvent?o=new CustomEvent(n,{detail:e}):(o=document.createEvent("CustomEvent")).initCustomEvent(n,!0,!r,e),t.dispatchEvent(o)}function F(t){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?t():document.addEventListener("DOMContentLoaded",t)}e.r(n),e.d(n,"find",function(){return o}),e.d(n,"is",function(){return i}),e.d(n,"contains",function(){return u}),e.d(n,"prev",function(){return c}),e.d(n,"next",function(){return f}),e.d(n,"siblings",function(){return a}),e.d(n,"parent",function(){return s}),e.d(n,"hasClass",function(){return p}),e.d(n,"addClass",function(){return m}),e.d(n,"removeClass",function(){return v}),e.d(n,"toggleClass",function(){return y}),e.d(n,"attr",function(){return g}),e.d(n,"css",function(){return h}),e.d(n,"parseHTML",function(){return b}),e.d(n,"before",function(){return L}),e.d(n,"after",function(){return w}),e.d(n,"prepend",function(){return C}),e.d(n,"append",function(){return E}),e.d(n,"clone",function(){return x}),e.d(n,"remove",function(){return A}),e.d(n,"text",function(){return M}),e.d(n,"html",function(){return S}),e.d(n,"replaceWith",function(){return T}),e.d(n,"fadeIn",function(){return H}),e.d(n,"fadeOut",function(){return N}),e.d(n,"hide",function(){return O}),e.d(n,"show",function(){return B}),e.d(n,"viewportPosition",function(){return D}),e.d(n,"offset",function(){return I}),e.d(n,"position",function(){return P}),e.d(n,"outerHeight",function(){return R}),e.d(n,"outerWidth",function(){return $}),e.d(n,"off",function(){return _}),e.d(n,"on",function(){return q}),e.d(n,"trigger",function(){return W}),e.d(n,"documentReady",function(){return F})}])}); //# sourceMappingURL=gaspard.umd.js.map \ No newline at end of file diff --git a/dist/gaspard.umd.js.map b/dist/gaspard.umd.js.map index d9b4409..d71bbd5 100644 --- a/dist/gaspard.umd.js.map +++ b/dist/gaspard.umd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://gaspard/webpack/universalModuleDefinition","webpack://gaspard/webpack/bootstrap","webpack://gaspard/./src/selectors.js","webpack://gaspard/./src/utils.js","webpack://gaspard/./src/attributes.js","webpack://gaspard/./src/content.js","webpack://gaspard/./src/effects.js","webpack://gaspard/./src/positions.js","webpack://gaspard/./src/events.js","webpack://gaspard/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","find","selector","context","arguments","length","undefined","document","Element","HTMLDocument","TypeError","elements","test","getElementById","substr","getElementsByClassName","slice","getElementsByTagName","querySelectorAll","selectors_toConsumableArray","is","element","selectorOrElement","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","contains","child","prev","previousElementSibling","next","nextElementSibling","siblings","concat","parentNode","children","filter","selectors_parent","getRealClassNamesArray","split","className","attributes_hasClass","classList","indexOf","attributes_addClass","classNames","_element$classList","add","apply","attributes_toConsumableArray","join","attributes_removeClass","_element$classList2","remove","reduce","accumulator","replace","RegExp","trim","attributes_toggleClass","state","forEach","attributes_attr","attribute","getAttribute","removeAttribute","setAttribute","attributes_css","ruleName","getComputedStyle","kebabCaseString","style","memo","token","toUpperCase","parseHTML","htmlString","tmp","implementation","createHTMLDocument","body","innerHTML","before","insertAdjacentHTML","after","prepend","parent","insertBefore","firstChild","append","appendChild","clone","cloneNode","removeChild","content_text","textString","textContent","String","html","replaceWith","outerHTML","fade","duration","isFadeIn","opacity","last","Date","tick","timeDifference","requestAnimationFrame","setTimeout","fadeIn","fadeOut","hide","display","show","viewportPosition","getBoundingClientRect","offset","rect","top","scrollTop","left","scrollLeft","position","offsetLeft","offsetTop","positions_outerHeight","withMargin","height","offsetHeight","parseInt","marginTop","marginBottom","positions_outerWidth","width","offsetWidth","marginLeft","marginRight","off","eventName","eventHandler","removeEventListener","on","addEventListener","trigger","data","isNativeEvent","event","CustomEvent","detail","createEvent","initCustomEvent","dispatchEvent","documentReady","callback","attachEvent","readyState","__webpack_exports__"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,aAAAH,GACA,iBAAAC,QACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE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Aa,GAAKD,SAAS5D,EAAM8D,cAAgB,GAE5E,OAAOJ,EAUF,SAASK,EAAYpH,EAAS8G,GACnC,IAAIO,EAAQrH,EAAQsH,YACpB,GAAIR,EAAY,CACd,IAAMzD,EAAQF,iBAAiBnD,GAC/BqH,GAASJ,SAAS5D,EAAMkE,YAAc,GAAKN,SAAS5D,EAAMmE,aAAe,GAE3E,OAAOH,EC3DF,SAASI,EAAKzH,EAAS0H,EAAWC,GACvC3H,EAAQ4H,oBAAoBF,EAAWC,GAUlC,SAASE,EAAI7H,EAAS0H,EAAWC,GACtC3H,EAAQ8H,iBAAiBJ,EAAWC,GAU/B,SAASI,EAAS/H,EAAS0H,GAAsB,IAAXM,EAAWjJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAChDkJ,IAAkBjI,EAAQ,KAAO0H,GACnCQ,SACAnL,OAAOoL,YACTD,EAAQ,IAAIC,YAAYT,GAAaU,OAAQJ,KAE7CE,EAAQhJ,SAASmJ,YAAY,gBACvBC,gBAAgBZ,GAAW,GAAOO,EAAeD,GAEzDhI,EAAQuI,cAAcL,GAQjB,SAASM,EAAeC,IACzBvJ,SAASwJ,YAAsC,aAAxBxJ,SAASyJ,WAAoD,YAAxBzJ,SAASyJ,YACvEF,IAEAvJ,SAAS4I,iBAAiB,mBAAoBW,2yCCvDlDxL,EAAAQ,EAAAmL,EAAA,kCAAAJ","file":"gaspard.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"gaspard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"gaspard\"] = factory();\n\telse\n\t\troot[\"gaspard\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/***\n * Selectors Module\n * @namespace selectors\n */\n\n/**\n * Returns a collection of matched elements either found in the DOM based on passed argument\n *\n * @param {string} selector Accepts a string containing a CSS selector which is then used to match a set of elements\n * @param {(HTMLDocument|Element)} [context=document] A DOM Element or Document\n * @return {Array} A collection of DOM Elements\n */\nexport function find (selector, context = document) {\n if (context instanceof Element === false && context instanceof HTMLDocument === false) {\n throw new TypeError('You should provide a valid dom node as second argument')\n }\n let elements\n if (/^#[\\w-]*$/.test(selector)) {\n elements = document.getElementById(selector.substr(1)) || []\n } else if (/^\\.[\\w-]*$/.test(selector)) {\n elements = context.getElementsByClassName(selector.slice(1))\n } else if (/^\\w+$/.test(selector)) {\n elements = context.getElementsByTagName(selector)\n } else {\n elements = context.querySelectorAll(selector)\n }\n if (elements.length) {\n elements = [...elements]\n }\n return elements\n}\n\n/**\n * Check the element against a selector or element, and returns true if the element match the given argument.\n *\n * @param {Element} element A DOM node\n * @param {(string|Element)} selectorOrElement A string containing a selector expression or a DOM node\n * @return {boolean} Is element match with selectorOrElement\n */\nexport function is (element, selectorOrElement) {\n if (typeof selectorOrElement === 'string') {\n return (\n element.matches ||\n element.matchesSelector ||\n element.msMatchesSelector ||\n element.mozMatchesSelector ||\n element.webkitMatchesSelector ||\n element.oMatchesSelector\n ).call(element, selectorOrElement)\n } else {\n return element === selectorOrElement\n }\n}\n\n/**\n * Check to see if a DOM element is a descendant of another DOM element.\n *\n * @param {Element} element A DOM node\n * @param {Element} child A potential child DOM node\n * @return {boolean} Is element has child as a descendant\n */\nexport function contains (element, child) {\n return element !== child && element.contains(child)\n}\n\n/**\n * Get the immediately preceding sibling of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} The previous DOM node\n */\nexport function prev (element) {\n return element.previousElementSibling\n}\n\n/**\n * Get the immediately following sibling of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} The following DOM node\n */\nexport function next (element) {\n return element.nextElementSibling\n}\n\n/**\n * Get the siblings of the element.\n *\n * @param {Element} element A DOM node\n * @return {Array} Siblings DOM nodes\n */\nexport function siblings (element) {\n return [...element.parentNode.children].filter(child => child !== element)\n}\n\n/**\n * Get the parent of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} The parent DOM node\n */\nexport function parent (element) {\n return element.parentNode\n}\n","/***\n * Utils Module\n * @module utils\n */\n\n/**\n * Transform kebab case string into camel case strings array\n *\n * @param {string} kebabCaseString The kebab case string\n * @return {string} The camel case transformed string\n */\nexport function toCamelCase (kebabCaseString) {\n return kebabCaseString.split('-').reduce((memo, token) => {\n return memo + token.slice(0, 1).toUpperCase() + token.slice(1)\n })\n}\n\n/**\n * Filter incorrect class names.\n *\n * @param {string} [classNames=''] One or more space-separated classes to be filtered\n * @return {Array} Valid class names array\n */\nexport function getRealClassNamesArray (classNames = '') {\n return classNames.split(' ').filter(className => !!className)\n}\n","/***\n * Attributes Module\n * @module attributes\n */\n\nimport { toCamelCase, getRealClassNamesArray } from './utils'\n\n/**\n * Determine whether the element is assigned the given class.\n *\n * @param {Element} element A DOM node\n * @param {string} className The class name to search for\n * @return {boolean} Result\n */\nexport function hasClass (element, className) {\n if (element.classList) {\n return element.classList.contains(className)\n } else {\n return !!~element.className.indexOf(className)\n }\n}\n\n/**\n * Adds the specified class(es) to element.\n *\n * @param {Element} element A DOM node\n * @param {string} classNames One or more space-separated classes to be added to the class attribute\n */\nexport function addClass (element, classNames) {\n classNames = getRealClassNamesArray(classNames)\n if (element.classList) {\n element.classList.add(...classNames)\n } else {\n element.className += ' ' + classNames.join(' ')\n }\n}\n\n/**\n * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.\n *\n * @param {Element} element A DOM node\n * @param {string} classNames One or more space-separated classes to be removed to the class attribute\n */\nexport function removeClass (element, classNames) {\n classNames = getRealClassNamesArray(classNames)\n if (element.classList) {\n element.classList.remove(...classNames)\n } else {\n element.className = classNames.reduce((accumulator, className) => accumulator.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' '), element.className).trim()\n }\n}\n\n/**\n * Add or remove one or more classes from element, depending on either the class's presence or the value of the state argument.\n *\n * @param {Element} element A DOM node\n * @param {string} classNames One or more class names (separated by spaces) to be toggled for each element in the matched set\n * @param {boolean} state A Boolean value to determine whether the class should be added or removed\n */\nexport function toggleClass (element, classNames, state) {\n if (typeof state === 'boolean') {\n if (state) {\n addClass(element, classNames)\n } else {\n removeClass(element, classNames)\n }\n } else {\n classNames = getRealClassNamesArray(classNames)\n classNames.forEach(className => hasClass(element, className) ? removeClass(element, className) : addClass(element, className))\n }\n}\n\n/**\n * Get the value of an attribute for the element\n *\n * @param {Element} element A DOM node\n * @param {string} attribute The name of the attribute to get\n * @return {string} The value of the attribute\n */\n/**\n * Set the value of an attribute for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} attribute The name of the attribute to set\n * @param {string} [value] A value to set for the attribute. If null, the specified attribute will be removed\n */\nexport function attr (element, attribute, value) {\n if (value !== undefined) {\n if (value === null) {\n element.removeAttribute(attribute)\n } else {\n element.setAttribute(attribute, value)\n }\n } else {\n return element.getAttribute(attribute)\n }\n}\n\n/**\n * Get the computed style properties for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} ruleName A CSS property\n * @return {string} The value of the CSS property\n */\n/**\n * Set a CSS property for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} ruleName A CSS property\n * @param {string} [value] A value to set for the property\n */\nexport function css (element, ruleName, value) {\n if (value !== undefined) {\n element.style[toCamelCase(ruleName)] = value\n } else {\n return getComputedStyle(element)[ruleName]\n }\n}\n","/***\n * Content Module\n * @module content\n */\n\n/**\n * Parses a string into an array of DOM nodes.\n *\n * @param {string} htmlString HTML string to be parsed\n * @return {Element[]} DOM nodes\n */\nexport function parseHTML (htmlString) {\n const tmp = document.implementation.createHTMLDocument()\n tmp.body.innerHTML = htmlString\n return tmp.body.children\n}\n\n/**\n * Insert content, specified by the second parameter, before the element.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString HTML string to insert\n */\nexport function before (element, htmlString) {\n element.insertAdjacentHTML('beforebegin', htmlString)\n}\n\n/**\n * Insert content, specified by the second parameter, after the element.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString HTML string to insert\n */\nexport function after (element, htmlString) {\n element.insertAdjacentHTML('afterend', htmlString)\n}\n\n/**\n * Insert an element, specified by the second parameter, to the beginning of the parent element.\n *\n * @param {Element} parent Parent DOM element\n * @param {Element} element DOM element to insert\n */\nexport function prepend (parent, element) {\n parent.insertBefore(element, parent.firstChild)\n}\n\n/**\n * Insert an element, specified by the second parameter, to the end of the parent element.\n *\n * @param {Element} parent Parent DOM element\n * @param {Element} element DOM element to insert\n */\nexport function append (parent, element) {\n parent.appendChild(element)\n}\n\n/**\n * Create a deep copy of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} Cloned DOM Element\n */\nexport function clone (element) {\n return element.cloneNode(true)\n}\n\n/**\n * Remove the element from the DOM\n *\n * @param {Element} element The element to remove\n */\nexport function remove (element) {\n element.parentNode.removeChild(element)\n}\n\n/**\n * Get the combined text contents of the element, including his descendants.\n *\n * @param {Element} element A DOM node\n * @return {string}\n */\n/**\n * Set the content of the element to the specified text.\n *\n * @param {Element} element A DOM node\n * @param {string} textString The text to set as the content of the element. When Number or Boolean is supplied, it will be converted to a String representation.\n */\nexport function text (element, textString) {\n if (textString !== undefined) {\n element.textContent = String(textString)\n } else {\n return element.textContent\n }\n}\n\n/**\n * Get the HTML contents of the element.\n *\n * @param {Element} element A DOM node\n * @return {string}\n */\n/**\n * Set the HTML contents of the element.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString A string of HTML to set as the content\n */\nexport function html (element, htmlString) {\n if (htmlString !== undefined) {\n element.innerHTML = htmlString\n } else {\n return element.innerHTML\n }\n}\n\n/**\n * Replace element with the provided new content.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString The HTML string content to insert\n */\nexport function replaceWith (element, htmlString) {\n element.outerHTML = htmlString\n}\n","/***\n * Effects Module\n * @module effects\n */\n\n/**\n * Fade in or out the element.\n * @private\n *\n * @param {Element} element A DOM node\n * @param {number} [duration=400] A number determining how long the animation will run\n * @param {boolean} isFadeIn Determine fadeIn or fadeOut\n */\nfunction fade (element, duration = 400, isFadeIn) {\n element.style.opacity = isFadeIn ? 0 : 1\n\n let last = +new Date()\n function tick () {\n const timeDifference = (new Date() - last) * (isFadeIn ? 1 : -1)\n element.style.opacity = +element.style.opacity + timeDifference / duration\n last = +new Date()\n\n const targetOpacity = isFadeIn ? +element.style.opacity < 1 : +element.style.opacity > 0\n if (targetOpacity) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16)\n }\n }\n\n tick()\n}\n\n/**\n * Display the elements by fading them to opaque.\n *\n * @param {Element} element A DOM node\n * @param {number} [duration=400] A number determining how long the animation will run\n */\nexport function fadeIn (element, duration) {\n fade(element, duration, true)\n}\n\n/**\n * Hide the element by fading them to transparent.\n *\n * @param {Element} element A DOM node\n * @param {number} [duration=400] A number determining how long the animation will run\n */\nexport function fadeOut (element, duration) {\n fade(element, duration, false)\n}\n\n/**\n * Hide the element.\n *\n * @param {Element} element A DOM node\n */\nexport function hide (element) {\n element.style.display = 'none'\n}\n\n/**\n * Show the element.\n *\n * @param {Element} element A DOM node\n */\nexport function show (element) {\n element.style.display = ''\n}\n","/***\n * Positions Module\n * @module positions\n */\n\n/**\n * Get the size of the element and its position relative to the viewport.\n *\n * @param {Element} element A DOM node\n * @return {Object} Object with properties: left, top, right, bottom, x, y, width, height\n */\nexport function viewportPosition (element) {\n return element.getBoundingClientRect()\n}\n\n/**\n * Get the current coordinates of the element, relative to the document.\n *\n * @param {Element} element A DOM node\n * @return {Object} Contain the properties top and left\n */\nexport function offset (element) {\n const rect = viewportPosition(element)\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n}\n\n/**\n * Get the current coordinates of the element, relative to the offset parent.\n *\n * @param {Element} element A DOM node\n * @return {Object} Contain the properties top and left\n */\nexport function position (element) {\n return {\n left: element.offsetLeft,\n top: element.offsetTop\n }\n}\n\n/**\n * Get the current computed outer height (including padding, border, and optionally margin) for the element.\n *\n * @param {Element} element A DOM node\n * @param {boolean} withMargin A Boolean indicating whether to include the element's margin in the calculation.\n * @return {number} Height of the element, including top and bottom padding, border, and optionally margin, in pixels\n */\nexport function outerHeight (element, withMargin) {\n let height = element.offsetHeight\n if (withMargin) {\n const style = getComputedStyle(element)\n height += parseInt(style.marginTop || 0) + parseInt(style.marginBottom || 0)\n }\n return height\n}\n\n/**\n * Get the current computed outer width (including padding, border, and optionally margin) for the element.\n *\n * @param {Element} element A DOM node\n * @param {boolean} withMargin A Boolean indicating whether to include the element's margin in the calculation.\n * @return {number} Width of the element, including left and right padding, border, and optionally margin, in pixels\n */\nexport function outerWidth (element, withMargin) {\n let width = element.offsetWidth\n if (withMargin) {\n const style = getComputedStyle(element)\n width += parseInt(style.marginLeft || 0) + parseInt(style.marginRight || 0)\n }\n return width\n}\n","/***\n * Events Module\n * @module events\n */\n\n/**\n * Remove an event handler.\n *\n * @param {Element} element A DOM node\n * @param {string} eventName An event type\n * @param {Function} eventHandler A handler function previously attached for the event\n */\nexport function off (element, eventName, eventHandler) {\n element.removeEventListener(eventName, eventHandler)\n}\n\n/**\n * Attach an event handler function for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} eventName An event type\n * @param {Function} eventHandler A function to execute when the event is triggered\n */\nexport function on (element, eventName, eventHandler) {\n element.addEventListener(eventName, eventHandler)\n}\n\n/**\n * Execute all handlers and behaviors attached to the element for the given event type.\n *\n * @param {Element} element A DOM node\n * @param {string} eventName An event type\n * @param {Object} [data={}] Additional parameters to pass along to the event handler.\n */\nexport function trigger (element, eventName, data = {}) {\n const isNativeEvent = !!element['on' + eventName]\n let event\n if (window.CustomEvent) {\n event = new CustomEvent(eventName, { detail: data })\n } else {\n event = document.createEvent('CustomEvent')\n event.initCustomEvent(eventName, true, !isNativeEvent, data)\n }\n element.dispatchEvent(event)\n}\n\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Function} callback A function to execute after the DOM is ready.\n */\nexport function documentReady (callback) {\n if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n callback()\n } else {\n document.addEventListener('DOMContentLoaded', callback)\n }\n}\n","/***\n * Index Module\n * @module index\n */\n\nexport { find, is, contains, prev, next, siblings, parent } from './selectors'\nexport { hasClass, addClass, removeClass, toggleClass, attr, css } from './attributes'\nexport { parseHTML, before, after, prepend, append, clone, remove, text, html, replaceWith } from './content'\nexport { fadeIn, fadeOut, hide, show } from './effects'\nexport { viewportPosition, offset, position, outerHeight, outerWidth } from './positions'\nexport { off, on, trigger, documentReady } from './events'\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://gaspard/webpack/universalModuleDefinition","webpack://gaspard/webpack/bootstrap","webpack://gaspard/./src/selectors.js","webpack://gaspard/./src/utils.js","webpack://gaspard/./src/attributes.js","webpack://gaspard/./src/content.js","webpack://gaspard/./src/effects.js","webpack://gaspard/./src/positions.js","webpack://gaspard/./src/events.js","webpack://gaspard/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","find","selector","context","arguments","length","undefined","document","Element","Document","TypeError","elements","test","getElementById","substr","getElementsByClassName","slice","getElementsByTagName","querySelectorAll","selectors_toConsumableArray","is","element","selectorOrElement","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","contains","child","prev","previousElementSibling","next","nextElementSibling","siblings","concat","parentNode","children","filter","selectors_parent","getRealClassNamesArray","split","className","attributes_hasClass","classList","indexOf","attributes_addClass","classNames","_element$classList","add","apply","attributes_toConsumableArray","join","attributes_removeClass","_element$classList2","remove","reduce","accumulator","replace","RegExp","trim","attributes_toggleClass","state","forEach","attributes_attr","attribute","getAttribute","removeAttribute","setAttribute","attributes_css","ruleName","getComputedStyle","kebabCaseString","style","memo","token","toUpperCase","parseHTML","htmlString","tmp","implementation","createHTMLDocument","body","innerHTML","before","insertAdjacentHTML","after","prepend","parent","insertBefore","firstChild","append","appendChild","clone","cloneNode","removeChild","content_text","textString","textContent","String","html","replaceWith","outerHTML","fade","duration","isFadeIn","opacity","last","Date","tick","timeDifference","requestAnimationFrame","setTimeout","fadeIn","fadeOut","hide","display","show","viewportPosition","getBoundingClientRect","offset","rect","top","scrollTop","left","scrollLeft","position","offsetLeft","offsetTop","positions_outerHeight","withMargin","height","offsetHeight","parseInt","marginTop","marginBottom","positions_outerWidth","width","offsetWidth","marginLeft","marginRight","off","eventName","eventHandler","removeEventListener","on","addEventListener","trigger","data","isNativeEvent","event","CustomEvent","detail","createEvent","initCustomEvent","dispatchEvent","documentReady","callback","attachEvent","readyState","__webpack_exports__"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,aAAAH,GACA,iBAAAC,QACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA2CA,OAtCAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACAkB,OAAAC,eAAAnB,EAAA,cAAiDwB,OAAA,KAIjDlB,EAAAmB,EAAA,SAAAxB,GACA,IAAAe,EAAAf,KAAAyB,WACA,WAA2B,OAAAzB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAK,EAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAU,EAAAC,GAAs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W,GAAOO,EAAeD,GAEzDhI,EAAQuI,cAAcL,GAQjB,SAASM,EAAeC,IACzBvJ,SAASwJ,YAAsC,aAAxBxJ,SAASyJ,WAAoD,YAAxBzJ,SAASyJ,YACvEF,IAEAvJ,SAAS4I,iBAAiB,mBAAoBW,2yCCvDlDxL,EAAAQ,EAAAmL,EAAA,kCAAAJ","file":"gaspard.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"gaspard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"gaspard\"] = factory();\n\telse\n\t\troot[\"gaspard\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/***\n * Selectors Module\n * @namespace selectors\n */\n\n/**\n * Returns a collection of matched elements either found in the DOM based on passed argument\n *\n * @param {string} selector Accepts a string containing a CSS selector which is then used to match a set of elements\n * @param {(Document|Element)} [context=document] A DOM Element or Document\n * @return {Array} A collection of DOM Elements\n */\nexport function find (selector, context = document) {\n if (context instanceof Element === false && context instanceof Document === false) {\n throw new TypeError('You should provide a valid dom node as second argument')\n }\n let elements\n if (/^#[\\w-]*$/.test(selector)) {\n elements = document.getElementById(selector.substr(1)) || []\n } else if (/^\\.[\\w-]*$/.test(selector)) {\n elements = context.getElementsByClassName(selector.slice(1))\n } else if (/^\\w+$/.test(selector)) {\n elements = context.getElementsByTagName(selector)\n } else {\n elements = context.querySelectorAll(selector)\n }\n if (elements.length) {\n elements = [...elements]\n }\n return elements\n}\n\n/**\n * Check the element against a selector or element, and returns true if the element match the given argument.\n *\n * @param {Element} element A DOM node\n * @param {(string|Element)} selectorOrElement A string containing a selector expression or a DOM node\n * @return {boolean} Is element match with selectorOrElement\n */\nexport function is (element, selectorOrElement) {\n if (typeof selectorOrElement === 'string') {\n return (\n element.matches ||\n element.matchesSelector ||\n element.msMatchesSelector ||\n element.mozMatchesSelector ||\n element.webkitMatchesSelector ||\n element.oMatchesSelector\n ).call(element, selectorOrElement)\n } else {\n return element === selectorOrElement\n }\n}\n\n/**\n * Check to see if a DOM element is a descendant of another DOM element.\n *\n * @param {Element} element A DOM node\n * @param {Element} child A potential child DOM node\n * @return {boolean} Is element has child as a descendant\n */\nexport function contains (element, child) {\n return element !== child && element.contains(child)\n}\n\n/**\n * Get the immediately preceding sibling of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} The previous DOM node\n */\nexport function prev (element) {\n return element.previousElementSibling\n}\n\n/**\n * Get the immediately following sibling of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} The following DOM node\n */\nexport function next (element) {\n return element.nextElementSibling\n}\n\n/**\n * Get the siblings of the element.\n *\n * @param {Element} element A DOM node\n * @return {Array} Siblings DOM nodes\n */\nexport function siblings (element) {\n return [...element.parentNode.children].filter(child => child !== element)\n}\n\n/**\n * Get the parent of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} The parent DOM node\n */\nexport function parent (element) {\n return element.parentNode\n}\n","/***\n * Utils Module\n * @module utils\n */\n\n/**\n * Transform kebab case string into camel case strings array\n *\n * @param {string} kebabCaseString The kebab case string\n * @return {string} The camel case transformed string\n */\nexport function toCamelCase (kebabCaseString) {\n return kebabCaseString.split('-').reduce((memo, token) => {\n return memo + token.slice(0, 1).toUpperCase() + token.slice(1)\n })\n}\n\n/**\n * Filter incorrect class names.\n *\n * @param {string} [classNames=''] One or more space-separated classes to be filtered\n * @return {Array} Valid class names array\n */\nexport function getRealClassNamesArray (classNames = '') {\n return classNames.split(' ').filter(className => !!className)\n}\n","/***\n * Attributes Module\n * @module attributes\n */\n\nimport { toCamelCase, getRealClassNamesArray } from './utils'\n\n/**\n * Determine whether the element is assigned the given class.\n *\n * @param {Element} element A DOM node\n * @param {string} className The class name to search for\n * @return {boolean} Result\n */\nexport function hasClass (element, className) {\n if (element.classList) {\n return element.classList.contains(className)\n } else {\n return !!~element.className.indexOf(className)\n }\n}\n\n/**\n * Adds the specified class(es) to element.\n *\n * @param {Element} element A DOM node\n * @param {string} classNames One or more space-separated classes to be added to the class attribute\n */\nexport function addClass (element, classNames) {\n classNames = getRealClassNamesArray(classNames)\n if (element.classList) {\n element.classList.add(...classNames)\n } else {\n element.className += ' ' + classNames.join(' ')\n }\n}\n\n/**\n * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.\n *\n * @param {Element} element A DOM node\n * @param {string} classNames One or more space-separated classes to be removed to the class attribute\n */\nexport function removeClass (element, classNames) {\n classNames = getRealClassNamesArray(classNames)\n if (element.classList) {\n element.classList.remove(...classNames)\n } else {\n element.className = classNames.reduce((accumulator, className) => accumulator.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' '), element.className).trim()\n }\n}\n\n/**\n * Add or remove one or more classes from element, depending on either the class's presence or the value of the state argument.\n *\n * @param {Element} element A DOM node\n * @param {string} classNames One or more class names (separated by spaces) to be toggled for each element in the matched set\n * @param {boolean} state A Boolean value to determine whether the class should be added or removed\n */\nexport function toggleClass (element, classNames, state) {\n if (typeof state === 'boolean') {\n if (state) {\n addClass(element, classNames)\n } else {\n removeClass(element, classNames)\n }\n } else {\n classNames = getRealClassNamesArray(classNames)\n classNames.forEach(className => hasClass(element, className) ? removeClass(element, className) : addClass(element, className))\n }\n}\n\n/**\n * Get the value of an attribute for the element\n *\n * @param {Element} element A DOM node\n * @param {string} attribute The name of the attribute to get\n * @return {string} The value of the attribute\n */\n/**\n * Set the value of an attribute for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} attribute The name of the attribute to set\n * @param {string} [value] A value to set for the attribute. If null, the specified attribute will be removed\n */\nexport function attr (element, attribute, value) {\n if (value !== undefined) {\n if (value === null) {\n element.removeAttribute(attribute)\n } else {\n element.setAttribute(attribute, value)\n }\n } else {\n return element.getAttribute(attribute)\n }\n}\n\n/**\n * Get the computed style properties for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} ruleName A CSS property\n * @return {string} The value of the CSS property\n */\n/**\n * Set a CSS property for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} ruleName A CSS property\n * @param {string} [value] A value to set for the property\n */\nexport function css (element, ruleName, value) {\n if (value !== undefined) {\n element.style[toCamelCase(ruleName)] = value\n } else {\n return getComputedStyle(element)[ruleName]\n }\n}\n","/***\n * Content Module\n * @module content\n */\n\n/**\n * Parses a string into an array of DOM nodes.\n *\n * @param {string} htmlString HTML string to be parsed\n * @return {Element[]} DOM nodes\n */\nexport function parseHTML (htmlString) {\n const tmp = document.implementation.createHTMLDocument()\n tmp.body.innerHTML = htmlString\n return tmp.body.children\n}\n\n/**\n * Insert content, specified by the second parameter, before the element.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString HTML string to insert\n */\nexport function before (element, htmlString) {\n element.insertAdjacentHTML('beforebegin', htmlString)\n}\n\n/**\n * Insert content, specified by the second parameter, after the element.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString HTML string to insert\n */\nexport function after (element, htmlString) {\n element.insertAdjacentHTML('afterend', htmlString)\n}\n\n/**\n * Insert an element, specified by the second parameter, to the beginning of the parent element.\n *\n * @param {Element} parent Parent DOM element\n * @param {Element} element DOM element to insert\n */\nexport function prepend (parent, element) {\n parent.insertBefore(element, parent.firstChild)\n}\n\n/**\n * Insert an element, specified by the second parameter, to the end of the parent element.\n *\n * @param {Element} parent Parent DOM element\n * @param {Element} element DOM element to insert\n */\nexport function append (parent, element) {\n parent.appendChild(element)\n}\n\n/**\n * Create a deep copy of the element.\n *\n * @param {Element} element A DOM node\n * @return {Element} Cloned DOM Element\n */\nexport function clone (element) {\n return element.cloneNode(true)\n}\n\n/**\n * Remove the element from the DOM\n *\n * @param {Element} element The element to remove\n */\nexport function remove (element) {\n element.parentNode.removeChild(element)\n}\n\n/**\n * Get the combined text contents of the element, including his descendants.\n *\n * @param {Element} element A DOM node\n * @return {string}\n */\n/**\n * Set the content of the element to the specified text.\n *\n * @param {Element} element A DOM node\n * @param {string} textString The text to set as the content of the element. When Number or Boolean is supplied, it will be converted to a String representation.\n */\nexport function text (element, textString) {\n if (textString !== undefined) {\n element.textContent = String(textString)\n } else {\n return element.textContent\n }\n}\n\n/**\n * Get the HTML contents of the element.\n *\n * @param {Element} element A DOM node\n * @return {string}\n */\n/**\n * Set the HTML contents of the element.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString A string of HTML to set as the content\n */\nexport function html (element, htmlString) {\n if (htmlString !== undefined) {\n element.innerHTML = htmlString\n } else {\n return element.innerHTML\n }\n}\n\n/**\n * Replace element with the provided new content.\n *\n * @param {Element} element A DOM node\n * @param {string} htmlString The HTML string content to insert\n */\nexport function replaceWith (element, htmlString) {\n element.outerHTML = htmlString\n}\n","/***\n * Effects Module\n * @module effects\n */\n\n/**\n * Fade in or out the element.\n * @private\n *\n * @param {Element} element A DOM node\n * @param {number} [duration=400] A number determining how long the animation will run\n * @param {boolean} isFadeIn Determine fadeIn or fadeOut\n */\nfunction fade (element, duration = 400, isFadeIn) {\n element.style.opacity = isFadeIn ? 0 : 1\n\n let last = +new Date()\n function tick () {\n const timeDifference = (new Date() - last) * (isFadeIn ? 1 : -1)\n element.style.opacity = +element.style.opacity + timeDifference / duration\n last = +new Date()\n\n const targetOpacity = isFadeIn ? +element.style.opacity < 1 : +element.style.opacity > 0\n if (targetOpacity) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16)\n }\n }\n\n tick()\n}\n\n/**\n * Display the elements by fading them to opaque.\n *\n * @param {Element} element A DOM node\n * @param {number} [duration=400] A number determining how long the animation will run\n */\nexport function fadeIn (element, duration) {\n fade(element, duration, true)\n}\n\n/**\n * Hide the element by fading them to transparent.\n *\n * @param {Element} element A DOM node\n * @param {number} [duration=400] A number determining how long the animation will run\n */\nexport function fadeOut (element, duration) {\n fade(element, duration, false)\n}\n\n/**\n * Hide the element.\n *\n * @param {Element} element A DOM node\n */\nexport function hide (element) {\n element.style.display = 'none'\n}\n\n/**\n * Show the element.\n *\n * @param {Element} element A DOM node\n */\nexport function show (element) {\n element.style.display = ''\n}\n","/***\n * Positions Module\n * @module positions\n */\n\n/**\n * Get the size of the element and its position relative to the viewport.\n *\n * @param {Element} element A DOM node\n * @return {Object} Object with properties: left, top, right, bottom, x, y, width, height\n */\nexport function viewportPosition (element) {\n return element.getBoundingClientRect()\n}\n\n/**\n * Get the current coordinates of the element, relative to the document.\n *\n * @param {Element} element A DOM node\n * @return {Object} Contain the properties top and left\n */\nexport function offset (element) {\n const rect = viewportPosition(element)\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n}\n\n/**\n * Get the current coordinates of the element, relative to the offset parent.\n *\n * @param {Element} element A DOM node\n * @return {Object} Contain the properties top and left\n */\nexport function position (element) {\n return {\n left: element.offsetLeft,\n top: element.offsetTop\n }\n}\n\n/**\n * Get the current computed outer height (including padding, border, and optionally margin) for the element.\n *\n * @param {Element} element A DOM node\n * @param {boolean} withMargin A Boolean indicating whether to include the element's margin in the calculation.\n * @return {number} Height of the element, including top and bottom padding, border, and optionally margin, in pixels\n */\nexport function outerHeight (element, withMargin) {\n let height = element.offsetHeight\n if (withMargin) {\n const style = getComputedStyle(element)\n height += parseInt(style.marginTop || 0) + parseInt(style.marginBottom || 0)\n }\n return height\n}\n\n/**\n * Get the current computed outer width (including padding, border, and optionally margin) for the element.\n *\n * @param {Element} element A DOM node\n * @param {boolean} withMargin A Boolean indicating whether to include the element's margin in the calculation.\n * @return {number} Width of the element, including left and right padding, border, and optionally margin, in pixels\n */\nexport function outerWidth (element, withMargin) {\n let width = element.offsetWidth\n if (withMargin) {\n const style = getComputedStyle(element)\n width += parseInt(style.marginLeft || 0) + parseInt(style.marginRight || 0)\n }\n return width\n}\n","/***\n * Events Module\n * @module events\n */\n\n/**\n * Remove an event handler.\n *\n * @param {Element} element A DOM node\n * @param {string} eventName An event type\n * @param {Function} eventHandler A handler function previously attached for the event\n */\nexport function off (element, eventName, eventHandler) {\n element.removeEventListener(eventName, eventHandler)\n}\n\n/**\n * Attach an event handler function for the element.\n *\n * @param {Element} element A DOM node\n * @param {string} eventName An event type\n * @param {Function} eventHandler A function to execute when the event is triggered\n */\nexport function on (element, eventName, eventHandler) {\n element.addEventListener(eventName, eventHandler)\n}\n\n/**\n * Execute all handlers and behaviors attached to the element for the given event type.\n *\n * @param {Element} element A DOM node\n * @param {string} eventName An event type\n * @param {Object} [data={}] Additional parameters to pass along to the event handler.\n */\nexport function trigger (element, eventName, data = {}) {\n const isNativeEvent = !!element['on' + eventName]\n let event\n if (window.CustomEvent) {\n event = new CustomEvent(eventName, { detail: data })\n } else {\n event = document.createEvent('CustomEvent')\n event.initCustomEvent(eventName, true, !isNativeEvent, data)\n }\n element.dispatchEvent(event)\n}\n\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Function} callback A function to execute after the DOM is ready.\n */\nexport function documentReady (callback) {\n if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n callback()\n } else {\n document.addEventListener('DOMContentLoaded', callback)\n }\n}\n","/***\n * Index Module\n * @module index\n */\n\nexport { find, is, contains, prev, next, siblings, parent } from './selectors'\nexport { hasClass, addClass, removeClass, toggleClass, attr, css } from './attributes'\nexport { parseHTML, before, after, prepend, append, clone, remove, text, html, replaceWith } from './content'\nexport { fadeIn, fadeOut, hide, show } from './effects'\nexport { viewportPosition, offset, position, outerHeight, outerWidth } from './positions'\nexport { off, on, trigger, documentReady } from './events'\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/API.md b/docs/API.md index 930d7ef..e53577c 100644 --- a/docs/API.md +++ b/docs/API.md @@ -756,7 +756,7 @@ Returns a collection of matched elements either found in the DOM based on passed | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | selector | `string` | Accepts a string containing a CSS selector which is then used to match a set of elements |   | -| context=document | `HTMLDocument` `Element` | A DOM Element or Document | *Optional* | +| context=document | `Document` `Element` | A DOM Element or Document | *Optional* |