From 22189e0cf31724999cba03bf34082d2633325014 Mon Sep 17 00:00:00 2001 From: Luca Perret Date: Mon, 11 Dec 2017 20:00:18 +0100 Subject: [PATCH] refactor(Collection): Move into it's own repo To provide a pure module, Gaspard now export pure functions. BREAKING CHANGE: Gaspard.Collection is not present anymore here. --- dist/gaspard.umd.js | 2 +- dist/gaspard.umd.js.map | 2 +- docs/API.md | 536 ---------------------------------- examples/index.js | 16 +- package-lock.json | 269 +++++++++-------- package.json | 10 +- src/collection.js | 259 ---------------- src/index.js | 3 - src/selectors.js | 1 + test/specs/collection.spec.js | 191 ------------ test/specs/index.spec.js | 1 - test/specs/selectors.spec.js | 7 +- 12 files changed, 162 insertions(+), 1135 deletions(-) delete mode 100644 src/collection.js delete mode 100644 test/specs/collection.spec.js diff --git a/dist/gaspard.umd.js b/dist/gaspard.umd.js index 3eecc9a..4223645 100644 --- a/dist/gaspard.umd.js +++ b/dist/gaspard.umd.js @@ -1,3 +1,3 @@ /*! gaspard | (c) 2017 Luca Perret | MIT | https://github.com/lucaperret/gaspard */ -!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("gaspard",[],t):"object"==typeof exports?exports["common-gaspard"]=t():n.Gaspard=t()}(this,function(){return function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=0)}([function(n,t,e){"use strict";function r(n){return n.split("-").reduce(function(n,t){return n+t.slice(0,1).toUpperCase()+t.slice(1)})}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(" ").filter(function(n){return!!n})}function u(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t0)&&(window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16))}var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,r=arguments[2];n.style.opacity=r?0:1;var o=+new Date;t()}function E(n,t){w(n,t,!0)}function L(n,t){w(n,t,!1)}function A(n){n.style.display="none"}function x(n){n.style.display=""}function M(n,t,e){n.removeEventListener(t,e)}function T(n,t,e){n.addEventListener(t,e)}function S(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!!n["on"+t],o=void 0;window.CustomEvent?o=new CustomEvent(t,{detail:e}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,!0,!r,e)),n.dispatchEvent(o)}function j(n){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?n():document.addEventListener("DOMContentLoaded",n)}function H(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t1&&void 0!==arguments[1]?arguments[1]:document;if(t instanceof Element==!1&&t instanceof HTMLDocument==!1)throw new TypeError("You should provide a valid dom node as second argument");var e=void 0;return e=/^#[\w-]*$/.test(n)?document.getElementById(n.substr(1))||[]:/^\.[\w-]*$/.test(n)?t.getElementsByClassName(n.slice(1)):/^\w+$/.test(n)?t.getElementsByTagName(n):t.querySelectorAll(n),e.length&&(e=[].concat(H(e))),e}function O(n,t){return"string"==typeof t?(n.matches||n.matchesSelector||n.msMatchesSelector||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector).call(n,t):n===t}function I(n,t){return n!==t&&n.contains(t)}function B(n){return n.previousElementSibling}function D(n){return n.nextElementSibling}function P(n){return[].concat(H(n.parentNode.children)).filter(function(t){return t!==n})}function R(n){return n.parentNode}function W(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function $(n){return n.getBoundingClientRect()}function _(n){var t=$(n);return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}}function q(n){return{left:n.offsetLeft,top:n.offsetTop}}function F(n,t){var e=n.offsetHeight;if(t){var r=getComputedStyle(n);e+=parseInt(r.marginTop||0)+parseInt(r.marginBottom||0)}return e}function z(n,t){var e=n.offsetWidth;if(t){var r=getComputedStyle(n);e+=parseInt(r.marginLeft||0)+parseInt(r.marginRight||0)}return e}Object.defineProperty(t,"__esModule",{value:!0});var G=function(){function n(n,t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:[];W(this,n);var e=void 0;e=Array.isArray(t)?t:"string"==typeof t?N(t):[t],this.elements=[].concat(e)}return G(n,[{key:"each",value:function(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;r1&&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/^#[\w-]*$/.test(t)?e=document.getElementById(t.substr(1))||[]:/^\.[\w-]*$/.test(t)?(console.log(t.slice(1)),e=n.getElementsByClassName(t.slice(1))):e=/^\w+$/.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t),e.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(t){return t.split("-").reduce(function(t,n){return t+n.slice(0,1).toUpperCase()+n.slice(1)})}function l(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(" ").filter(function(t){return!!t})}function p(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n0)&&(window.requestAnimationFrame&&requestAnimationFrame(n)||setTimeout(n,16))}var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,r=arguments[2];t.style.opacity=r?0:1;var o=+new Date;n()}function N(t,n){j(t,n,!0)}function O(t,n){j(t,n,!1)}function B(t){t.style.display="none"}function D(t){t.style.display=""}function I(t){return t.getBoundingClientRect()}function P(t){var n=I(t);return{top:n.top+document.body.scrollTop,left:n.left+document.body.scrollLeft}}function R(t){return{left:t.offsetLeft,top:t.offsetTop}}function $(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 q(t,n,e){t.removeEventListener(n,e)}function W(t,n,e){t.addEventListener(n,e)}function F(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"),o.initCustomEvent(n,!0,!r,e)),t.dispatchEvent(o)}function k(t){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?t():document.addEventListener("DOMContentLoaded",t)}Object.defineProperty(n,"__esModule",{value:!0}),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 m}),e.d(n,"addClass",function(){return v}),e.d(n,"removeClass",function(){return y}),e.d(n,"toggleClass",function(){return g}),e.d(n,"attr",function(){return h}),e.d(n,"css",function(){return b}),e.d(n,"parseHTML",function(){return L}),e.d(n,"before",function(){return C}),e.d(n,"after",function(){return E}),e.d(n,"prepend",function(){return w}),e.d(n,"append",function(){return x}),e.d(n,"clone",function(){return A}),e.d(n,"remove",function(){return M}),e.d(n,"text",function(){return T}),e.d(n,"html",function(){return S}),e.d(n,"replaceWith",function(){return H}),e.d(n,"fadeIn",function(){return N}),e.d(n,"fadeOut",function(){return O}),e.d(n,"hide",function(){return B}),e.d(n,"show",function(){return D}),e.d(n,"viewportPosition",function(){return I}),e.d(n,"offset",function(){return P}),e.d(n,"position",function(){return R}),e.d(n,"outerHeight",function(){return $}),e.d(n,"outerWidth",function(){return _}),e.d(n,"off",function(){return q}),e.d(n,"on",function(){return W}),e.d(n,"trigger",function(){return F}),e.d(n,"documentReady",function(){return k})}])}); //# 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 80d54ad..3087626 100644 --- a/dist/gaspard.umd.js.map +++ b/dist/gaspard.umd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///gaspard.umd.js","webpack:///webpack/bootstrap a8366060bb7727ef1ed4","webpack:///./src/utils.js","webpack:///./src/attributes.js","webpack:///./src/content.js","webpack:///./src/effects.js","webpack:///./src/events.js","webpack:///./src/selectors.js","webpack:///./src/positions.js","webpack:///./src/collection.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","toCamelCase","kebabCaseString","split","reduce","memo","token","slice","toUpperCase","getRealClassNamesArray","arguments","length","undefined","filter","className","_toConsumableArray","arr","Array","isArray","arr2","from","hasClass","element","classList","contains","indexOf","attributes_addClass","classNames","_element$classList","add","apply","join","attributes_removeClass","_element$classList2","remove","accumulator","replace","RegExp","trim","attributes_toggleClass","state","forEach","attributes_attr","attribute","value","getAttribute","removeAttribute","setAttribute","attributes_css","ruleName","getComputedStyle","style","parseHTML","htmlString","tmp","document","implementation","createHTMLDocument","body","innerHTML","children","content_before","insertAdjacentHTML","content_after","content_prepend","parent","insertBefore","firstChild","content_append","appendChild","clone","cloneNode","content_remove","parentNode","removeChild","content_text","textString","textContent","String","content_html","content_replaceWith","outerHTML","fade","tick","timeDifference","Date","last","isFadeIn","opacity","duration","window","requestAnimationFrame","setTimeout","effects_fadeIn","effects_fadeOut","effects_hide","display","effects_show","events_off","eventName","eventHandler","removeEventListener","events_on","addEventListener","events_trigger","data","isNativeEvent","event","CustomEvent","detail","createEvent","initCustomEvent","dispatchEvent","documentReady","callback","attachEvent","readyState","selectors__toConsumableArray","selectors_find","selector","context","Element","HTMLDocument","TypeError","elements","test","getElementById","substr","getElementsByClassName","getElementsByTagName","querySelectorAll","is","selectorOrElement","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","child","prev","previousElementSibling","next","nextElementSibling","siblings","concat","selectors_parent","_classCallCheck","instance","Constructor","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","_createClass","defineProperties","target","props","descriptor","writable","key","protoProps","staticProps","collection_Collection","Collection","contextElements","method","_len","params","_key","each","map","push","collection"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,aAAAH,GACA,gBAAAC,SACAA,QAAA,kBAAAD,IAEAD,EAAA,QAAAC,KACCK,KAAA,WACD,MCCgB,UAAUC,GCP1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KA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ule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"gaspard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"common-gaspard\"] = factory();\n\telse\n\t\troot[\"Gaspard\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*! gaspard | (c) 2017 Luca Perret | MIT | https://github.com/lucaperret/gaspard */\n(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[\"common-gaspard\"] = factory();\n\telse\n\t\troot[\"Gaspard\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \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// 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/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n\n// CONCATENATED MODULE: ./src/utils.js\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 */\nfunction toCamelCase(kebabCaseString) {\n return kebabCaseString.split('-').reduce(function (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 */\nfunction getRealClassNamesArray() {\n var classNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n return classNames.split(' ').filter(function (className) {\n return !!className;\n });\n}\n// CONCATENATED MODULE: ./src/attributes.js\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/***\n * Attributes Module\n * @module attributes\n */\n\n\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 */\nfunction 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 */\nfunction attributes_addClass(element, classNames) {\n classNames = getRealClassNamesArray(classNames);\n if (element.classList) {\n var _element$classList;\n\n (_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(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 */\nfunction attributes_removeClass(element, classNames) {\n classNames = getRealClassNamesArray(classNames);\n if (element.classList) {\n var _element$classList2;\n\n (_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(classNames));\n } else {\n element.className = classNames.reduce(function (accumulator, className) {\n return accumulator.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n }, 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 */\nfunction attributes_toggleClass(element, classNames, state) {\n if (typeof state === 'boolean') {\n if (state) {\n attributes_addClass(element, classNames);\n } else {\n attributes_removeClass(element, classNames);\n }\n } else {\n classNames = getRealClassNamesArray(classNames);\n classNames.forEach(function (className) {\n return hasClass(element, className) ? attributes_removeClass(element, className) : attributes_addClass(element, className);\n });\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 */\nfunction attributes_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 */\nfunction attributes_css(element, ruleName, value) {\n if (value !== undefined) {\n element.style[toCamelCase(ruleName)] = value;\n } else {\n return getComputedStyle(element)[ruleName];\n }\n}\n// CONCATENATED MODULE: ./src/content.js\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 */\nfunction parseHTML(htmlString) {\n var 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 */\nfunction content_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 */\nfunction content_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 */\nfunction content_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 */\nfunction content_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 */\nfunction 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 */\nfunction content_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 */\nfunction content_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 */\nfunction content_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 */\nfunction content_replaceWith(element, htmlString) {\n element.outerHTML = htmlString;\n}\n// CONCATENATED MODULE: ./src/effects.js\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) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;\n var isFadeIn = arguments[2];\n\n element.style.opacity = isFadeIn ? 0 : 1;\n\n var last = +new Date();\n function tick() {\n var timeDifference = (new Date() - last) * (isFadeIn ? 1 : -1);\n element.style.opacity = +element.style.opacity + timeDifference / duration;\n last = +new Date();\n\n var 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 */\nfunction effects_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 */\nfunction effects_fadeOut(element, duration) {\n fade(element, duration, false);\n}\n\n/**\n * Hide the element.\n *\n * @param {Element} element A DOM node\n */\nfunction effects_hide(element) {\n element.style.display = 'none';\n}\n\n/**\n * Show the element.\n *\n * @param {Element} element A DOM node\n */\nfunction effects_show(element) {\n element.style.display = '';\n}\n// CONCATENATED MODULE: ./src/events.js\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 */\nfunction events_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 */\nfunction events_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 */\nfunction events_trigger(element, eventName) {\n var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var isNativeEvent = !!element['on' + eventName];\n var event = void 0;\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 */\nfunction documentReady(callback) {\n if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n callback();\n } else {\n document.addEventListener('DOMContentLoaded', callback);\n }\n}\n// CONCATENATED MODULE: ./src/selectors.js\nfunction selectors__toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\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 */\nfunction selectors_find(selector) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;\n\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 var elements = void 0;\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 = [].concat(selectors__toConsumableArray(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 */\nfunction is(element, selectorOrElement) {\n if (typeof selectorOrElement === 'string') {\n return (element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.webkitMatchesSelector || element.oMatchesSelector).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 */\nfunction 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 */\nfunction 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 */\nfunction 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 */\nfunction siblings(element) {\n return [].concat(selectors__toConsumableArray(element.parentNode.children)).filter(function (child) {\n return child !== element;\n });\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 */\nfunction selectors_parent(element) {\n return element.parentNode;\n}\n// CONCATENATED MODULE: ./src/collection.js\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/***\n * Collection Module\n * @module collection\n */\n\n\n\n\n\n\n\n/**\n * Use Collection class to perform actions on Elements\n * @example\n * import { Collection } from 'gaspard'\n * const collection = new Collection('div.highlight')\n * collection\n * .css('background-color', 'green')\n * .find('p:first-child') // returns a new gaspard collection\n * .addClass('introduction')\n * .fadeIn(400)\n * .elements // Array of matched elements\n * .forEach(element => {\n * console.log('div.highlight first paragraph', element)\n * })\n *\n * @param {(Element[]|Element|string)} [elements=[]] DOM Elements, Element, or string to query the DOM\n * @return {Collection} Collection containing elements\n */\n\nvar collection_Collection = function () {\n function Collection() {\n var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n _classCallCheck(this, Collection);\n\n var contextElements = void 0;\n if (Array.isArray(elements)) {\n contextElements = elements;\n } else if (typeof elements === 'string') {\n contextElements = selectors_find(elements);\n } else {\n contextElements = [elements];\n }\n this.elements = [].concat(contextElements);\n }\n /**\n * Apply a method on each elements and returns the collection to chain methods\n * @param {Function} method Accept a method to run on each elements\n * @param {any} params A list of argument to call the method with\n * @return {Collection} Collection containing elements\n */\n\n\n _createClass(Collection, [{\n key: 'each',\n value: function each(method) {\n for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n this.elements.forEach(function (element) {\n return method.apply(undefined, [element].concat(params));\n });\n return this;\n }\n /**\n * Add classes to each elements\n * @see {@link attributes/addClass}\n * @param {string} classNames\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'addClass',\n value: function addClass(classNames) {\n return this.each(attributes_addClass, classNames);\n }\n /**\n * Toggle classes to each elements\n * @see {@link attributes/toggleClass}\n * @param {string} classNames\n * @param {boolean} state\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'toggleClass',\n value: function toggleClass(classNames, state) {\n return this.each(attributes_toggleClass, classNames, state);\n }\n /**\n * Remove classes to each elements\n * @see {@link attributes/removeClass}\n * @param {string} classNames\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'removeClass',\n value: function removeClass(classNames) {\n return this.each(attributes_removeClass, classNames);\n }\n /**\n * Set attribute to each elements\n * @see {@link attributes/attr}\n * @param {string} attribute\n * @param {any} value\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'attr',\n value: function attr(attribute, value) {\n return this.each(attributes_attr, attribute, value);\n }\n /**\n * Set CSS value to each elements\n * @see {@link attributes/css}\n * @param {string} ruleName\n * @param {string} value\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'css',\n value: function css(ruleName, value) {\n return this.each(attributes_css, ruleName, value);\n }\n /**\n * Insert content before each elements\n * @see {@link content/before}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'before',\n value: function before(htmlString) {\n return this.each(content_before, htmlString);\n }\n /**\n * Insert content after each elements\n * @see {@link content/after}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'after',\n value: function after(htmlString) {\n return this.each(content_after, htmlString);\n }\n /**\n * Prepend element to each elements\n * @see {@link content/prepend}\n * @param {Element} element\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'prepend',\n value: function prepend(element) {\n return this.each(content_prepend, element);\n }\n /**\n * Append element to each elements\n * @see {@link content/append}\n * @param {Element} element\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'append',\n value: function append(element) {\n return this.each(content_append, element);\n }\n /**\n * Remove each elements\n * @see {@link content/remove}\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'remove',\n value: function remove() {\n return this.each(content_remove);\n }\n /**\n * Set text to each elements\n * @see {@link content/text}\n * @param {string} textString\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'text',\n value: function text(textString) {\n return this.each(content_text, textString);\n }\n /**\n * Set html to each elements\n * @see {@link content/html}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'html',\n value: function html(htmlString) {\n return this.each(content_html, htmlString);\n }\n /**\n * Replace each elements\n * @see {@link content/replaceWith}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'replaceWith',\n value: function replaceWith(htmlString) {\n return this.each(content_replaceWith, htmlString);\n }\n /**\n * Fade in each elements\n * @see {@link effects/fadeIn}\n * @param {number} duration\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'fadeIn',\n value: function fadeIn(duration) {\n return this.each(effects_fadeIn, duration);\n }\n /**\n * Fade out each elements\n * @see {@link effects/fadeOut}\n * @param {number} duration\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'fadeOut',\n value: function fadeOut(duration) {\n return this.each(effects_fadeOut, duration);\n }\n /**\n * Hide each elements\n * @see {@link effects/hide}\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'hide',\n value: function hide() {\n return this.each(effects_hide);\n }\n /**\n * Show each elements\n * @see {@link effects/show}\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'show',\n value: function show() {\n return this.each(effects_show);\n }\n /**\n * Attach an event handler function for each elements\n * @see {@link events/on}\n * @param {string} eventName\n * @param {Function} eventHandler\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'on',\n value: function on(eventName, eventHandler) {\n return this.each(events_on, eventName, eventHandler);\n }\n /**\n * Remove an event handler function for each elements\n * @see {@link events/off}\n * @param {string} eventName\n * @param {Function} eventHandler\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'off',\n value: function off(eventName, eventHandler) {\n return this.each(events_off, eventName, eventHandler);\n }\n /**\n * Execute all handlers to each elements\n * @see {@link events/trigger}\n * @param {string} eventName\n * @param {Object} data\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'trigger',\n value: function trigger(eventName, data) {\n return this.each(events_trigger, eventName, data);\n }\n /**\n * Returns a collection of matched elements either found in the DOM based on passed argument\n * @see {@link selectors/find}\n * @param {(string|Element)} selectorOrElement Accepts a string containing a CSS selector which is then used to match a set of elements, or an Element\n * @return {Collection} Collection containing elements\n */\n\n }, {\n key: 'find',\n value: function find(selectorOrElement) {\n if (selectorOrElement instanceof Element === true) {\n return new Collection(selectorOrElement);\n } else {\n return this.elements.map(function (element) {\n return selectors_find(selectorOrElement, element);\n }).filter(function (element) {\n return element.length || element instanceof Element === true;\n }).reduce(function (accumulator, element) {\n return accumulator.concat(element);\n }, []).reduce(function (accumulator, element) {\n if (~accumulator.elements.indexOf(element)) {\n return accumulator;\n } else {\n accumulator.elements.push(element);\n return accumulator;\n }\n }, new Collection());\n }\n }\n }]);\n\n return Collection;\n}();\n\n/* harmony default export */ var collection = (collection_Collection);\n// CONCATENATED MODULE: ./src/positions.js\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 */\nfunction 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 */\nfunction offset(element) {\n var 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 */\nfunction 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 */\nfunction positions_outerHeight(element, withMargin) {\n var height = element.offsetHeight;\n if (withMargin) {\n var 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 */\nfunction positions_outerWidth(element, withMargin) {\n var width = element.offsetWidth;\n if (withMargin) {\n var style = getComputedStyle(element);\n width += parseInt(style.marginLeft || 0) + parseInt(style.marginRight || 0);\n }\n return width;\n}\n// CONCATENATED MODULE: ./src/index.js\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"find\", function() { return selectors_find; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"is\", function() { return is; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"contains\", function() { return contains; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"prev\", function() { return prev; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"next\", function() { return next; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"siblings\", function() { return siblings; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"parent\", function() { return selectors_parent; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"hasClass\", function() { return hasClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"addClass\", function() { return attributes_addClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"removeClass\", function() { return attributes_removeClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"toggleClass\", function() { return attributes_toggleClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"attr\", function() { return attributes_attr; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"css\", function() { return attributes_css; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"parseHTML\", function() { return parseHTML; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"before\", function() { return content_before; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"after\", function() { return content_after; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"prepend\", function() { return content_prepend; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"append\", function() { return content_append; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"remove\", function() { return content_remove; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"text\", function() { return content_text; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"html\", function() { return content_html; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"replaceWith\", function() { return content_replaceWith; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"fadeIn\", function() { return effects_fadeIn; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"fadeOut\", function() { return effects_fadeOut; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"hide\", function() { return effects_hide; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"show\", function() { return effects_show; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"viewportPosition\", function() { return viewportPosition; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"offset\", function() { return offset; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"position\", function() { return position; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"outerHeight\", function() { return positions_outerHeight; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"outerWidth\", function() { return positions_outerWidth; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"off\", function() { return events_off; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"on\", function() { return events_on; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"trigger\", function() { return events_trigger; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"documentReady\", function() { return documentReady; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Collection\", function() { return collection; });\n/***\n * Index Module\n * @module index\n */\n\n\n\n\n\n\n\n\n\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// gaspard.umd.js"," \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// 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 \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a8366060bb7727ef1ed4","/***\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\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/attributes.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/content.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/effects.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/events.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/selectors.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/positions.js","/***\n * Collection Module\n * @module collection\n */\n\nimport { addClass, removeClass, toggleClass, attr, css } from './attributes'\nimport { before, after, prepend, append, remove, text, html, replaceWith } from './content'\nimport { fadeIn, fadeOut, hide, show } from './effects'\nimport { on, off, trigger } from './events'\nimport { find } from './selectors'\n\n/**\n * Use Collection class to perform actions on Elements\n * @example\n * import { Collection } from 'gaspard'\n * const collection = new Collection('div.highlight')\n * collection\n * .css('background-color', 'green')\n * .find('p:first-child') // returns a new gaspard collection\n * .addClass('introduction')\n * .fadeIn(400)\n * .elements // Array of matched elements\n * .forEach(element => {\n * console.log('div.highlight first paragraph', element)\n * })\n *\n * @param {(Element[]|Element|string)} [elements=[]] DOM Elements, Element, or string to query the DOM\n * @return {Collection} Collection containing elements\n */\nexport default class Collection {\n constructor (elements = []) {\n let contextElements\n if (Array.isArray(elements)) {\n contextElements = elements\n } else if (typeof elements === 'string') {\n contextElements = find(elements)\n } else {\n contextElements = [elements]\n }\n this.elements = [].concat(contextElements)\n }\n /**\n * Apply a method on each elements and returns the collection to chain methods\n * @param {Function} method Accept a method to run on each elements\n * @param {any} params A list of argument to call the method with\n * @return {Collection} Collection containing elements\n */\n each (method, ...params) {\n this.elements.forEach(element => method(element, ...params))\n return this\n }\n /**\n * Add classes to each elements\n * @see {@link attributes/addClass}\n * @param {string} classNames\n * @return {Collection} Collection containing elements\n */\n addClass (classNames) {\n return this.each(addClass, classNames)\n }\n /**\n * Toggle classes to each elements\n * @see {@link attributes/toggleClass}\n * @param {string} classNames\n * @param {boolean} state\n * @return {Collection} Collection containing elements\n */\n toggleClass (classNames, state) {\n return this.each(toggleClass, classNames, state)\n }\n /**\n * Remove classes to each elements\n * @see {@link attributes/removeClass}\n * @param {string} classNames\n * @return {Collection} Collection containing elements\n */\n removeClass (classNames) {\n return this.each(removeClass, classNames)\n }\n /**\n * Set attribute to each elements\n * @see {@link attributes/attr}\n * @param {string} attribute\n * @param {any} value\n * @return {Collection} Collection containing elements\n */\n attr (attribute, value) {\n return this.each(attr, attribute, value)\n }\n /**\n * Set CSS value to each elements\n * @see {@link attributes/css}\n * @param {string} ruleName\n * @param {string} value\n * @return {Collection} Collection containing elements\n */\n css (ruleName, value) {\n return this.each(css, ruleName, value)\n }\n /**\n * Insert content before each elements\n * @see {@link content/before}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n before (htmlString) {\n return this.each(before, htmlString)\n }\n /**\n * Insert content after each elements\n * @see {@link content/after}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n after (htmlString) {\n return this.each(after, htmlString)\n }\n /**\n * Prepend element to each elements\n * @see {@link content/prepend}\n * @param {Element} element\n * @return {Collection} Collection containing elements\n */\n prepend (element) {\n return this.each(prepend, element)\n }\n /**\n * Append element to each elements\n * @see {@link content/append}\n * @param {Element} element\n * @return {Collection} Collection containing elements\n */\n append (element) {\n return this.each(append, element)\n }\n /**\n * Remove each elements\n * @see {@link content/remove}\n * @return {Collection} Collection containing elements\n */\n remove () {\n return this.each(remove)\n }\n /**\n * Set text to each elements\n * @see {@link content/text}\n * @param {string} textString\n * @return {Collection} Collection containing elements\n */\n text (textString) {\n return this.each(text, textString)\n }\n /**\n * Set html to each elements\n * @see {@link content/html}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n html (htmlString) {\n return this.each(html, htmlString)\n }\n /**\n * Replace each elements\n * @see {@link content/replaceWith}\n * @param {string} htmlString\n * @return {Collection} Collection containing elements\n */\n replaceWith (htmlString) {\n return this.each(replaceWith, htmlString)\n }\n /**\n * Fade in each elements\n * @see {@link effects/fadeIn}\n * @param {number} duration\n * @return {Collection} Collection containing elements\n */\n fadeIn (duration) {\n return this.each(fadeIn, duration)\n }\n /**\n * Fade out each elements\n * @see {@link effects/fadeOut}\n * @param {number} duration\n * @return {Collection} Collection containing elements\n */\n fadeOut (duration) {\n return this.each(fadeOut, duration)\n }\n /**\n * Hide each elements\n * @see {@link effects/hide}\n * @return {Collection} Collection containing elements\n */\n hide () {\n return this.each(hide)\n }\n /**\n * Show each elements\n * @see {@link effects/show}\n * @return {Collection} Collection containing elements\n */\n show () {\n return this.each(show)\n }\n /**\n * Attach an event handler function for each elements\n * @see {@link events/on}\n * @param {string} eventName\n * @param {Function} eventHandler\n * @return {Collection} Collection containing elements\n */\n on (eventName, eventHandler) {\n return this.each(on, eventName, eventHandler)\n }\n /**\n * Remove an event handler function for each elements\n * @see {@link events/off}\n * @param {string} eventName\n * @param {Function} eventHandler\n * @return {Collection} Collection containing elements\n */\n off (eventName, eventHandler) {\n return this.each(off, eventName, eventHandler)\n }\n /**\n * Execute all handlers to each elements\n * @see {@link events/trigger}\n * @param {string} eventName\n * @param {Object} data\n * @return {Collection} Collection containing elements\n */\n trigger (eventName, data) {\n return this.each(trigger, eventName, data)\n }\n /**\n * Returns a collection of matched elements either found in the DOM based on passed argument\n * @see {@link selectors/find}\n * @param {(string|Element)} selectorOrElement Accepts a string containing a CSS selector which is then used to match a set of elements, or an Element\n * @return {Collection} Collection containing elements\n */\n find (selectorOrElement) {\n if (selectorOrElement instanceof Element === true) {\n return new Collection(selectorOrElement)\n } else {\n return this.elements\n .map(element => find(selectorOrElement, element))\n .filter(element => element.length || element instanceof Element === true)\n .reduce((accumulator, element) => accumulator.concat(element), [])\n .reduce((accumulator, element) => {\n if (~accumulator.elements.indexOf(element)) {\n return accumulator\n } else {\n accumulator.elements.push(element)\n return accumulator\n }\n }, new Collection())\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/collection.js","/***\n * Index Module\n * @module index\n */\n\nimport Collection from './collection'\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'\nexport { Collection }\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///gaspard.umd.js","webpack:///webpack/bootstrap 5b472862529b34b8b900","webpack:///./src/selectors.js","webpack:///./src/utils.js","webpack:///./src/attributes.js","webpack:///./src/content.js","webpack:///./src/effects.js","webpack:///./src/positions.js","webpack:///./src/events.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","_toConsumableArray","arr","Array","isArray","arr2","length","from","find","selector","context","arguments","undefined","document","Element","HTMLDocument","TypeError","elements","test","getElementById","substr","console","log","slice","getElementsByClassName","getElementsByTagName","querySelectorAll","is","element","selectorOrElement","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","contains","child","prev","previousElementSibling","next","nextElementSibling","siblings","concat","parentNode","children","filter","selectors_parent","toCamelCase","kebabCaseString","split","reduce","memo","token","toUpperCase","getRealClassNamesArray","className","attributes__toConsumableArray","hasClass","classList","indexOf","addClass","classNames","_element$classList","add","apply","join","removeClass","_element$classList2","remove","accumulator","replace","RegExp","trim","toggleClass","state","forEach","attr","attribute","value","getAttribute","removeAttribute","setAttribute","css","ruleName","getComputedStyle","style","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","tick","timeDifference","Date","last","isFadeIn","opacity","duration","window","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"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,aAAAH,GACA,gBAAAC,SACAA,QAAA,kBAAAD,IAEAD,EAAA,QAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCCgB,UAAUC,GCP1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAM,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDpB,EAAAuB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iB,EAAqB,aAAc,WAAa,MAAOmJ,KAC7E5K,EAAoBQ,EAAEiB,EAAqB,MAAO,WAAa,MAAOwJ,KACtEjL,EAAoBQ,EAAEiB,EAAqB,KAAM,WAAa,MAAO4J,KACrErL,EAAoBQ,EAAEiB,EAAqB,UAAW,WAAa,MAAO8J,KS7sBzGvL,EAAAQ,EAAAiB,EAAA,iCAAAuK","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[\"common-gaspard\"] = factory();\n\telse\n\t\troot[\"Gaspard\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*! gaspard | (c) 2017 Luca Perret | MIT | https://github.com/lucaperret/gaspard */\n(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[\"common-gaspard\"] = factory();\n\telse\n\t\troot[\"Gaspard\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \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// 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/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n\n// CONCATENATED MODULE: ./src/selectors.js\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\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 */\nfunction find(selector) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;\n\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 var elements = void 0;\n if (/^#[\\w-]*$/.test(selector)) {\n elements = document.getElementById(selector.substr(1)) || [];\n } else if (/^\\.[\\w-]*$/.test(selector)) {\n console.log(selector.slice(1));\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 = [].concat(_toConsumableArray(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 */\nfunction is(element, selectorOrElement) {\n if (typeof selectorOrElement === 'string') {\n return (element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.webkitMatchesSelector || element.oMatchesSelector).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 */\nfunction 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 */\nfunction 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 */\nfunction 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 */\nfunction siblings(element) {\n return [].concat(_toConsumableArray(element.parentNode.children)).filter(function (child) {\n return child !== element;\n });\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 */\nfunction selectors_parent(element) {\n return element.parentNode;\n}\n// CONCATENATED MODULE: ./src/utils.js\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 */\nfunction toCamelCase(kebabCaseString) {\n return kebabCaseString.split('-').reduce(function (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 */\nfunction getRealClassNamesArray() {\n var classNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n return classNames.split(' ').filter(function (className) {\n return !!className;\n });\n}\n// CONCATENATED MODULE: ./src/attributes.js\nfunction attributes__toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/***\n * Attributes Module\n * @module attributes\n */\n\n\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 */\nfunction 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 */\nfunction addClass(element, classNames) {\n classNames = getRealClassNamesArray(classNames);\n if (element.classList) {\n var _element$classList;\n\n (_element$classList = element.classList).add.apply(_element$classList, attributes__toConsumableArray(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 */\nfunction removeClass(element, classNames) {\n classNames = getRealClassNamesArray(classNames);\n if (element.classList) {\n var _element$classList2;\n\n (_element$classList2 = element.classList).remove.apply(_element$classList2, attributes__toConsumableArray(classNames));\n } else {\n element.className = classNames.reduce(function (accumulator, className) {\n return accumulator.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n }, 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 */\nfunction 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(function (className) {\n return hasClass(element, className) ? removeClass(element, className) : addClass(element, className);\n });\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 */\nfunction 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 */\nfunction css(element, ruleName, value) {\n if (value !== undefined) {\n element.style[toCamelCase(ruleName)] = value;\n } else {\n return getComputedStyle(element)[ruleName];\n }\n}\n// CONCATENATED MODULE: ./src/content.js\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 */\nfunction parseHTML(htmlString) {\n var 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 */\nfunction 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 */\nfunction 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 */\nfunction 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 */\nfunction 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 */\nfunction 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 */\nfunction 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 */\nfunction content_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 */\nfunction 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 */\nfunction replaceWith(element, htmlString) {\n element.outerHTML = htmlString;\n}\n// CONCATENATED MODULE: ./src/effects.js\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) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;\n var isFadeIn = arguments[2];\n\n element.style.opacity = isFadeIn ? 0 : 1;\n\n var last = +new Date();\n function tick() {\n var timeDifference = (new Date() - last) * (isFadeIn ? 1 : -1);\n element.style.opacity = +element.style.opacity + timeDifference / duration;\n last = +new Date();\n\n var 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 */\nfunction 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 */\nfunction fadeOut(element, duration) {\n fade(element, duration, false);\n}\n\n/**\n * Hide the element.\n *\n * @param {Element} element A DOM node\n */\nfunction hide(element) {\n element.style.display = 'none';\n}\n\n/**\n * Show the element.\n *\n * @param {Element} element A DOM node\n */\nfunction show(element) {\n element.style.display = '';\n}\n// CONCATENATED MODULE: ./src/positions.js\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 */\nfunction 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 */\nfunction offset(element) {\n var 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 */\nfunction 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 */\nfunction positions_outerHeight(element, withMargin) {\n var height = element.offsetHeight;\n if (withMargin) {\n var 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 */\nfunction positions_outerWidth(element, withMargin) {\n var width = element.offsetWidth;\n if (withMargin) {\n var style = getComputedStyle(element);\n width += parseInt(style.marginLeft || 0) + parseInt(style.marginRight || 0);\n }\n return width;\n}\n// CONCATENATED MODULE: ./src/events.js\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 */\nfunction 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 */\nfunction 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 */\nfunction trigger(element, eventName) {\n var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var isNativeEvent = !!element['on' + eventName];\n var event = void 0;\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 */\nfunction documentReady(callback) {\n if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n callback();\n } else {\n document.addEventListener('DOMContentLoaded', callback);\n }\n}\n// CONCATENATED MODULE: ./src/index.js\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"find\", function() { return find; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"is\", function() { return is; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"contains\", function() { return contains; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"prev\", function() { return prev; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"next\", function() { return next; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"siblings\", function() { return siblings; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"parent\", function() { return selectors_parent; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"hasClass\", function() { return hasClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"addClass\", function() { return addClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"removeClass\", function() { return removeClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"toggleClass\", function() { return toggleClass; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"attr\", function() { return attr; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"css\", function() { return css; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"parseHTML\", function() { return parseHTML; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"before\", function() { return before; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"after\", function() { return after; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"prepend\", function() { return prepend; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"append\", function() { return append; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"text\", function() { return content_text; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"html\", function() { return html; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"replaceWith\", function() { return replaceWith; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"fadeIn\", function() { return fadeIn; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"fadeOut\", function() { return fadeOut; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"hide\", function() { return hide; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"show\", function() { return show; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"viewportPosition\", function() { return viewportPosition; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"offset\", function() { return offset; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"position\", function() { return position; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"outerHeight\", function() { return positions_outerHeight; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"outerWidth\", function() { return positions_outerWidth; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"off\", function() { return off; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"on\", function() { return on; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"trigger\", function() { return trigger; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"documentReady\", function() { return documentReady; });\n/***\n * Index Module\n * @module index\n */\n\n\n\n\n\n\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// gaspard.umd.js"," \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// 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 \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 5b472862529b34b8b900","/***\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 console.log(selector.slice(1))\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\n\n// WEBPACK FOOTER //\n// ./src/selectors.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/attributes.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/content.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/effects.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/positions.js","/***\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\n\n// WEBPACK FOOTER //\n// ./src/events.js","/***\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\n\n\n// WEBPACK FOOTER //\n// ./src/index.js"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/API.md b/docs/API.md index b9ae2df..930d7ef 100644 --- a/docs/API.md +++ b/docs/API.md @@ -154,542 +154,6 @@ Set a CSS property for the element. -### src/collection.js - - -#### new Collection([elements=]) - -Use Collection class to perform actions on Elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| elements= | `Array.` `Element` `string` | DOM Elements, Element, or string to query the DOM | *Optional* | - - - - -##### Examples - -```javascript -import { Collection } from 'gaspard' -const collection = new Collection('div.highlight') -collection - .css('background-color', 'green') - .find('p:first-child') // returns a new gaspard collection - .addClass('introduction') - .fadeIn(400) - .elements // Array of matched elements - .forEach(element => { - console.log('div.highlight first paragraph', element) - }) -``` - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.each(method, params) - -Apply a method on each elements and returns the collection to chain methods - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| method | `Function` | Accept a method to run on each elements |   | -| params | `any` | A list of argument to call the method with |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.addClass(classNames) - -Add classes to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| classNames | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.toggleClass(classNames, state) - -Toggle classes to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| classNames | `string` | |   | -| state | `boolean` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.removeClass(classNames) - -Remove classes to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| classNames | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.attr(attribute, value) - -Set attribute to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| attribute | `string` | |   | -| value | `any` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.css(ruleName, value) - -Set CSS value to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| ruleName | `string` | |   | -| value | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.before(htmlString) - -Insert content before each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| htmlString | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.after(htmlString) - -Insert content after each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| htmlString | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.prepend(element) - -Prepend element to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| element | `Element` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.append(element) - -Append element to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| element | `Element` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.remove() - -Remove each elements - - - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.text(textString) - -Set text to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| textString | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.html(htmlString) - -Set html to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| htmlString | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.replaceWith(htmlString) - -Replace each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| htmlString | `string` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.fadeIn(duration) - -Fade in each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| duration | `number` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.fadeOut(duration) - -Fade out each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| duration | `number` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.hide() - -Hide each elements - - - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.show() - -Show each elements - - - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.on(eventName, eventHandler) - -Attach an event handler function for each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| eventName | `string` | |   | -| eventHandler | `Function` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.off(eventName, eventHandler) - -Remove an event handler function for each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| eventName | `string` | |   | -| eventHandler | `Function` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.trigger(eventName, data) - -Execute all handlers to each elements - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| eventName | `string` | |   | -| data | `Object` | |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - -#### Collection.find(selectorOrElement) - -Returns a collection of matched elements either found in the DOM based on passed argument - - - - -##### Parameters - -| Name | Type | Description | | -| ---- | ---- | ----------- | -------- | -| selectorOrElement | `string` `Element` | Accepts a string containing a CSS selector which is then used to match a set of elements, or an Element |   | - - - - -##### Returns - - -- `Collection` Collection containing elements - - - - ### src/content.js diff --git a/examples/index.js b/examples/index.js index d920d3b..1f32841 100644 --- a/examples/index.js +++ b/examples/index.js @@ -1,8 +1,8 @@ -import { Collection } from '../src' -const collection = new Collection('#app') -collection - .css('background-color', 'green') - .find('p:first-child') - .addClass('introduction') - .fadeIn() -console.log(collection) +import { find, css, addClass, fadeIn } from '../' + +const app = find('#app') +css(app, 'background-color', 'green') + +const paragraph = find('p:first-child', app)[0] +addClass(paragraph, 'introduction') +fadeIn(paragraph) diff --git a/package-lock.json b/package-lock.json index 782d2a8..3903e42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,7 +98,7 @@ "@babel/types": "7.0.0-beta.31", "babylon": "7.0.0-beta.31", "debug": "3.1.0", - "globals": "10.3.0", + "globals": "10.4.0", "invariant": "2.2.2", "lodash": "4.17.2" }, @@ -119,9 +119,9 @@ } }, "globals": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-10.3.0.tgz", - "integrity": "sha512-1g6qO5vMbiPHbRTDtR9JVjRkAhkgH4nSANYGyx1eOfqgxcMnYMMD+7MjmjfzXjwFpVUE/7/NzF+jQxYE7P4r7A==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-10.4.0.tgz", + "integrity": "sha512-uNUtxIZpGyuaq+5BqGGQHsL4wUlJAXRqOm6g3Y48/CWNGTLONgBibI0lh6lGxjR2HljFYUfszb+mk4WkgMntsA==", "dev": true } } @@ -254,9 +254,9 @@ } }, "ajv": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.3.0.tgz", - "integrity": "sha1-RBT/dKUIecII7l/cgm4ywwNUnto=", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", "dev": true, "requires": { "co": "4.6.0", @@ -444,7 +444,7 @@ "dev": true, "requires": { "define-properties": "1.1.2", - "es-abstract": "1.9.0" + "es-abstract": "1.10.0" } }, "array-union": { @@ -584,9 +584,9 @@ } }, "babel-eslint": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.0.2.tgz", - "integrity": "sha512-yyl5U088oE+419+BNLJDKVWkUokuPLQeQt9ZTy9uM9kAzbtQgyYL3JkG425B8jxXA7MwTxnDAtRLMKJNH36qjA==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.0.3.tgz", + "integrity": "sha512-7D4iUpylEiKJPGbeSAlNddGcmA41PadgZ6UAb6JVyh003h3d0EbZusYFBR/+nBgqtaVJM2J2zUVa3N0hrpMH6g==", "dev": true, "requires": { "@babel/code-frame": "7.0.0-beta.31", @@ -1634,9 +1634,9 @@ "dev": true }, "binary-extensions": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", - "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, "bl": { @@ -1727,7 +1727,7 @@ "deep-equal": "1.0.1", "dns-equal": "1.0.0", "dns-txt": "2.0.2", - "multicast-dns": "6.1.1", + "multicast-dns": "6.2.1", "multicast-dns-service-types": "1.1.0" } }, @@ -1935,12 +1935,12 @@ } }, "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "0.2.9" + "pako": "1.0.6" } }, "browserslist": { @@ -2110,6 +2110,12 @@ "supports-color": "2.0.0" } }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -2310,13 +2316,13 @@ "integrity": "sha1-xZpcmdt2dn6YdlAOJx72OzSTvWY=", "dev": true, "requires": { - "mime-db": "1.31.0" + "mime-db": "1.32.0" }, "dependencies": { "mime-db": { - "version": "1.31.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.31.0.tgz", - "integrity": "sha512-oB3w9lx50CMd6nfonoV5rBRUbJtjMifUHaFb5MfzjC8ksAIfVjT0BsX46SjjqBz7n9JGTrTX3paIeLSK+rS5fQ==", + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.32.0.tgz", + "integrity": "sha512-+ZWo/xZN40Tt6S+HyakUxnSOgff+JEdaneLWIm0Z6LmpCn5DMcZntLyUY5c/rTDog28LhXLKOUZKoTxTCAdBVw==", "dev": true } } @@ -2389,9 +2395,9 @@ } }, "connect-history-api-fallback": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.4.0.tgz", - "integrity": "sha1-PbJPlz9LkjsOgvYZzg3wJBHKYj0=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz", + "integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=", "dev": true }, "console-browserify": { @@ -2776,7 +2782,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.35" + "es5-ext": "0.10.37" } }, "dargs": { @@ -2995,13 +3001,12 @@ } }, "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", + "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "2.0.2" } }, "dom-converter": { @@ -3303,9 +3308,9 @@ } }, "es-abstract": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.9.0.tgz", - "integrity": "sha512-kk3IJoKo7A3pWJc0OV8yZ/VEX2oSUytfekrJiqoxBlKJMFAJVJVpGdHClCCTdv+Fn2zHfpDHHIelMFhZVfef3Q==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.10.0.tgz", + "integrity": "sha512-/uh/DhdqIOSkAWifU+8nG78vlQxdLckUdI/sPgy0VhuXi2qJ7T8czBmqIYtLQVpCIFYafChnsRsB5pyb1JdmCQ==", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -3327,9 +3332,9 @@ } }, "es5-ext": { - "version": "0.10.35", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.35.tgz", - "integrity": "sha1-GO6FjOajxFx9eekcFfzKnsVoSU8=", + "version": "0.10.37", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.37.tgz", + "integrity": "sha1-DudB0Ui4AGm6J9AgOTdWryV978M=", "dev": true, "requires": { "es6-iterator": "2.0.3", @@ -3343,7 +3348,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-symbol": "3.1.1" } }, @@ -3354,7 +3359,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", @@ -3383,7 +3388,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" @@ -3396,7 +3401,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35" + "es5-ext": "0.10.37" } }, "es6-weak-map": { @@ -3406,7 +3411,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } @@ -3467,33 +3472,33 @@ } }, "eslint": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.10.0.tgz", - "integrity": "sha512-MMVl8P/dYUFZEvolL8PYt7qc5LNdS2lwheq9BYa5Y07FblhcZqFyaUqlS8TW5QITGex21tV4Lk0a3fK8lsJIkA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.13.0.tgz", + "integrity": "sha512-1l2aVrEz9yiWsEQdL3XZEzTovHQJFZaTeIhOOilKQRiYNn1dVALoYOtn06iPoxhEwFukBPX4Ff8WoGD4r/7D2A==", "dev": true, "requires": { - "ajv": "5.3.0", + "ajv": "5.5.1", "babel-code-frame": "6.22.0", "chalk": "2.3.0", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", "debug": "3.1.0", - "doctrine": "2.0.0", + "doctrine": "2.0.2", "eslint-scope": "3.7.1", - "espree": "3.5.1", + "espree": "3.5.2", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", + "globals": "11.1.0", "ignore": "3.3.7", "imurmurhash": "0.1.4", "inquirer": "3.3.0", "is-resolvable": "1.0.0", "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -3568,13 +3573,13 @@ "dev": true }, "external-editor": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.5.tgz", - "integrity": "sha512-Msjo64WT5W+NhOpQXh0nOHm+n0RfU1QUwDnKYvJ8dEJ8zlwLrqXNTv5mSUTJpepf41PDJGyhueTw2vNZW+Fr/w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "dev": true, "requires": { + "chardet": "0.4.2", "iconv-lite": "0.4.19", - "jschardet": "1.6.0", "tmp": "0.0.33" } }, @@ -3601,6 +3606,12 @@ "path-is-absolute": "1.0.1" } }, + "globals": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.1.0.tgz", + "integrity": "sha512-uEuWt9mqTlPDwSqi+sHjD4nWU/1N+q0fiWI9T1mZpD2UENqX20CFD5T/ziLZvztPaBKl7ZylUi1q6Qfm7E2CiQ==", + "dev": true + }, "inquirer": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", @@ -3611,7 +3622,7 @@ "chalk": "2.3.0", "cli-cursor": "2.1.0", "cli-width": "2.1.0", - "external-editor": "2.0.5", + "external-editor": "2.1.0", "figures": "2.0.0", "lodash": "4.17.4", "mute-stream": "0.0.7", @@ -3861,9 +3872,9 @@ } }, "eslint-plugin-jest": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.2.0.tgz", - "integrity": "sha512-pe7JWoZiXWHfVCBArxX5o3laRZp24tkBSeIHImJJyX2mDIqzlrXkUGkfbC6tPKER3WbcQ3YxKDMgp8uqt8fjfw==", + "version": "21.4.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.4.2.tgz", + "integrity": "sha512-NYtPWpL4PcRUKJH3D+amjpGOnh6k0eTlNgIsGNfqSSuNSrWgobefpB9H5P4uEEQ+ONxglQU0fWC3XHfGFHoGCA==", "dev": true }, "eslint-plugin-node": { @@ -3909,9 +3920,9 @@ } }, "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { "acorn": "5.2.1", @@ -3976,7 +3987,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35" + "es5-ext": "0.10.37" } }, "eventemitter3": { @@ -6121,9 +6132,9 @@ } }, "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, "iconv-lite": { @@ -6290,7 +6301,7 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.10.0" + "binary-extensions": "1.11.0" } }, "is-buffer": { @@ -6428,13 +6439,13 @@ "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", "dev": true, "requires": { - "is-path-inside": "1.0.0" + "is-path-inside": "1.0.1" } }, "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" @@ -7695,12 +7706,6 @@ "dev": true, "optional": true }, - "jschardet": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.6.0.tgz", - "integrity": "sha512-xYuhvQ7I9PDJIGBWev9xm0+SMSed3ZDBAmvVjbFR1ZRLAF+vlXcQu6cRI9uAlj81rzikElRVteehwV7DuX2ZmQ==", - "dev": true - }, "jsdoctypeparser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-1.2.0.tgz", @@ -7778,6 +7783,12 @@ "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -8147,9 +8158,9 @@ "dev": true }, "loglevel": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.5.1.tgz", - "integrity": "sha1-GJB4yUq5BT7iFaCs2/JCROoPZQI=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.0.tgz", + "integrity": "sha1-rgyqVhERSYxboTcj1vtjHSQAOTQ=", "dev": true }, "longest": { @@ -8440,9 +8451,9 @@ "dev": true }, "multicast-dns": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.1.1.tgz", - "integrity": "sha1-bn3oalcIcqsXBYrepxYLvsqBTd4=", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.1.tgz", + "integrity": "sha512-uV3/ckdsffHx9IrGQrx613mturMdMqQ06WTq+C09NsStJ9iNG6RcUWgPKs1Rfjy+idZT6tfQoXEusGNnEZhT3w==", "dev": true, "requires": { "dns-packet": "1.2.2", @@ -8523,21 +8534,21 @@ "dev": true }, "node-libs-browser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz", - "integrity": "sha1-o6WeyXAkmFtG6Vg3lkb5bEthZkY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", "dev": true, "requires": { "assert": "1.4.1", - "browserify-zlib": "0.1.4", + "browserify-zlib": "0.2.0", "buffer": "4.9.1", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.12.0", "domain-browser": "1.1.7", "events": "1.1.1", - "https-browserify": "0.0.1", - "os-browserify": "0.2.1", + "https-browserify": "1.0.0", + "os-browserify": "0.3.0", "path-browserify": "0.0.0", "process": "0.11.10", "punycode": "1.4.1", @@ -8545,20 +8556,12 @@ "readable-stream": "2.3.3", "stream-browserify": "2.0.1", "stream-http": "2.7.2", - "string_decoder": "0.10.31", + "string_decoder": "1.0.3", "timers-browserify": "2.0.4", "tty-browserify": "0.0.0", "url": "0.11.0", "util": "0.10.3", "vm-browserify": "0.0.4" - }, - "dependencies": { - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } } }, "node-notifier": { @@ -8838,9 +8841,9 @@ } }, "os-browserify": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", - "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, "os-homedir": { @@ -8961,9 +8964,9 @@ } }, "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", "dev": true }, "param-case": { @@ -10654,7 +10657,7 @@ "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "5.3.0", + "ajv": "5.5.1", "ajv-keywords": "2.1.1", "chalk": "2.3.0", "lodash": "4.17.4", @@ -11038,7 +11041,7 @@ "requires": { "source-map": "0.5.6", "uglify-js": "2.8.29", - "webpack-sources": "1.0.2" + "webpack-sources": "1.1.0" }, "dependencies": { "cliui": { @@ -11319,14 +11322,14 @@ "dev": true }, "webpack": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.8.1.tgz", - "integrity": "sha512-5ZXLWWsMqHKFr5y0N3Eo5IIisxeEeRAajNq4mELb/WELOR7srdbQk2N5XiyNy2A/AgvlR3AmeBCZJW8lHrolbw==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.10.0.tgz", + "integrity": "sha512-fxxKXoicjdXNUMY7LIdY89tkJJJ0m1Oo8PQutZ5rLgWbV5QVKI15Cn7+/IHnRTd3vfKfiwBx6SBqlorAuNA8LA==", "dev": true, "requires": { "acorn": "5.2.1", "acorn-dynamic-import": "2.0.2", - "ajv": "5.3.0", + "ajv": "5.5.1", "ajv-keywords": "2.1.1", "async": "2.5.0", "enhanced-resolve": "3.4.1", @@ -11338,13 +11341,13 @@ "loader-utils": "1.1.0", "memory-fs": "0.4.1", "mkdirp": "0.5.1", - "node-libs-browser": "2.0.0", + "node-libs-browser": "2.1.0", "source-map": "0.5.6", "supports-color": "4.5.0", "tapable": "0.2.8", "uglifyjs-webpack-plugin": "0.4.6", "watchpack": "1.4.0", - "webpack-sources": "1.0.2", + "webpack-sources": "1.1.0", "yargs": "8.0.2" }, "dependencies": { @@ -11366,22 +11369,30 @@ } }, "webpack-dev-middleware": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.0.tgz", - "integrity": "sha1-007++y7dp+HTtdvgcolRMhllFwk=", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz", + "integrity": "sha512-FCrqPy1yy/sN6U/SaEZcHKRXGlqU0DUaEBL45jkUYoB8foVb6wCnbIJ1HKIx+qUFTW+3JpVcCJCxZ8VATL4e+A==", "dev": true, "requires": { "memory-fs": "0.4.1", - "mime": "1.4.1", + "mime": "1.6.0", "path-is-absolute": "1.0.1", "range-parser": "1.2.0", "time-stamp": "2.0.0" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + } } }, "webpack-dev-server": { - "version": "2.9.4", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.9.4.tgz", - "integrity": "sha512-thrqC0EQEoSjXeYgP6pUXcUCZ+LNrKsDPn+mItLnn5VyyNZOJKd06hUP5vqkYwL8nWWXsii0loSF9NHNccT6ow==", + "version": "2.9.7", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.9.7.tgz", + "integrity": "sha512-Pu7uoQFgQj5RE5wmlfkpYSzihMKxulwEuO2xCsaMnAnyRSApwoVi3B8WCm9XbigyWTHaIMzYGkB90Vr6leAeTQ==", "dev": true, "requires": { "ansi-html": "0.0.7", @@ -11389,7 +11400,7 @@ "bonjour": "3.5.0", "chokidar": "1.7.0", "compression": "1.7.1", - "connect-history-api-fallback": "1.4.0", + "connect-history-api-fallback": "1.5.0", "debug": "3.1.0", "del": "3.0.0", "express": "4.16.2", @@ -11399,7 +11410,7 @@ "internal-ip": "1.2.0", "ip": "1.1.5", "killable": "1.0.0", - "loglevel": "1.5.1", + "loglevel": "1.6.0", "opn": "5.1.0", "portfinder": "1.0.13", "selfsigned": "1.10.1", @@ -11409,7 +11420,7 @@ "spdy": "3.4.7", "strip-ansi": "3.0.1", "supports-color": "4.5.0", - "webpack-dev-middleware": "1.12.0", + "webpack-dev-middleware": "1.12.2", "yargs": "6.6.0" }, "dependencies": { @@ -11526,9 +11537,9 @@ } }, "webpack-sources": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.2.tgz", - "integrity": "sha512-Y7UddMCv6dGjy81nBv6nuQeFFIt5aalHm7uyDsAsW86nZwfOVPGRr3XMjEQLaT+WKo8rlzhC9qtbJvYKLtAwaw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", "dev": true, "requires": { "source-list-map": "2.0.0", @@ -11550,13 +11561,13 @@ "dev": true, "requires": { "http-parser-js": "0.4.9", - "websocket-extensions": "0.1.2" + "websocket-extensions": "0.1.3" } }, "websocket-extensions": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.2.tgz", - "integrity": "sha1-Dhh4HeYpoYMIzhSBZQ9n/6JpOl0=", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", "dev": true }, "whatwg-encoding": { diff --git a/package.json b/package.json index 21af060..37ffcdc 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "repository": "lucaperret/gaspard", "dependencies": {}, "devDependencies": { - "babel-eslint": "^8.0.2", + "babel-eslint": "^8.0.3", "babel-jest": "^21.2.0", "babel-loader": "^7.1.2", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", @@ -44,12 +44,12 @@ "coveralls": "^3.0.0", "cz-conventional-changelog": "^2.1.0", "doxdox": "^2.0.3", - "eslint": "^4.10.0", + "eslint": "^4.13.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.9.0", "eslint-plugin-import": "^2.8.0", - "eslint-plugin-jest": "^21.2.0", + "eslint-plugin-jest": "^21.4.2", "eslint-plugin-node": "^5.2.1", "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", @@ -57,8 +57,8 @@ "html-webpack-plugin": "^2.30.1", "jest": "^21.2.1", "semantic-release": "8.2.0", - "webpack": "^3.8.1", - "webpack-dev-server": "^2.9.4" + "webpack": "^3.10.0", + "webpack-dev-server": "^2.9.7" }, "engines": { "node": ">= 4.0.0", diff --git a/src/collection.js b/src/collection.js deleted file mode 100644 index 5b5e950..0000000 --- a/src/collection.js +++ /dev/null @@ -1,259 +0,0 @@ -/*** - * Collection Module - * @module collection - */ - -import { addClass, removeClass, toggleClass, attr, css } from './attributes' -import { before, after, prepend, append, remove, text, html, replaceWith } from './content' -import { fadeIn, fadeOut, hide, show } from './effects' -import { on, off, trigger } from './events' -import { find } from './selectors' - -/** - * Use Collection class to perform actions on Elements - * @example - * import { Collection } from 'gaspard' - * const collection = new Collection('div.highlight') - * collection - * .css('background-color', 'green') - * .find('p:first-child') // returns a new gaspard collection - * .addClass('introduction') - * .fadeIn(400) - * .elements // Array of matched elements - * .forEach(element => { - * console.log('div.highlight first paragraph', element) - * }) - * - * @param {(Element[]|Element|string)} [elements=[]] DOM Elements, Element, or string to query the DOM - * @return {Collection} Collection containing elements - */ -export default class Collection { - constructor (elements = []) { - let contextElements - if (Array.isArray(elements)) { - contextElements = elements - } else if (typeof elements === 'string') { - contextElements = find(elements) - } else { - contextElements = [elements] - } - this.elements = [].concat(contextElements) - } - /** - * Apply a method on each elements and returns the collection to chain methods - * @param {Function} method Accept a method to run on each elements - * @param {any} params A list of argument to call the method with - * @return {Collection} Collection containing elements - */ - each (method, ...params) { - this.elements.forEach(element => method(element, ...params)) - return this - } - /** - * Add classes to each elements - * @see {@link attributes/addClass} - * @param {string} classNames - * @return {Collection} Collection containing elements - */ - addClass (classNames) { - return this.each(addClass, classNames) - } - /** - * Toggle classes to each elements - * @see {@link attributes/toggleClass} - * @param {string} classNames - * @param {boolean} state - * @return {Collection} Collection containing elements - */ - toggleClass (classNames, state) { - return this.each(toggleClass, classNames, state) - } - /** - * Remove classes to each elements - * @see {@link attributes/removeClass} - * @param {string} classNames - * @return {Collection} Collection containing elements - */ - removeClass (classNames) { - return this.each(removeClass, classNames) - } - /** - * Set attribute to each elements - * @see {@link attributes/attr} - * @param {string} attribute - * @param {any} value - * @return {Collection} Collection containing elements - */ - attr (attribute, value) { - return this.each(attr, attribute, value) - } - /** - * Set CSS value to each elements - * @see {@link attributes/css} - * @param {string} ruleName - * @param {string} value - * @return {Collection} Collection containing elements - */ - css (ruleName, value) { - return this.each(css, ruleName, value) - } - /** - * Insert content before each elements - * @see {@link content/before} - * @param {string} htmlString - * @return {Collection} Collection containing elements - */ - before (htmlString) { - return this.each(before, htmlString) - } - /** - * Insert content after each elements - * @see {@link content/after} - * @param {string} htmlString - * @return {Collection} Collection containing elements - */ - after (htmlString) { - return this.each(after, htmlString) - } - /** - * Prepend element to each elements - * @see {@link content/prepend} - * @param {Element} element - * @return {Collection} Collection containing elements - */ - prepend (element) { - return this.each(prepend, element) - } - /** - * Append element to each elements - * @see {@link content/append} - * @param {Element} element - * @return {Collection} Collection containing elements - */ - append (element) { - return this.each(append, element) - } - /** - * Remove each elements - * @see {@link content/remove} - * @return {Collection} Collection containing elements - */ - remove () { - return this.each(remove) - } - /** - * Set text to each elements - * @see {@link content/text} - * @param {string} textString - * @return {Collection} Collection containing elements - */ - text (textString) { - return this.each(text, textString) - } - /** - * Set html to each elements - * @see {@link content/html} - * @param {string} htmlString - * @return {Collection} Collection containing elements - */ - html (htmlString) { - return this.each(html, htmlString) - } - /** - * Replace each elements - * @see {@link content/replaceWith} - * @param {string} htmlString - * @return {Collection} Collection containing elements - */ - replaceWith (htmlString) { - return this.each(replaceWith, htmlString) - } - /** - * Fade in each elements - * @see {@link effects/fadeIn} - * @param {number} duration - * @return {Collection} Collection containing elements - */ - fadeIn (duration) { - return this.each(fadeIn, duration) - } - /** - * Fade out each elements - * @see {@link effects/fadeOut} - * @param {number} duration - * @return {Collection} Collection containing elements - */ - fadeOut (duration) { - return this.each(fadeOut, duration) - } - /** - * Hide each elements - * @see {@link effects/hide} - * @return {Collection} Collection containing elements - */ - hide () { - return this.each(hide) - } - /** - * Show each elements - * @see {@link effects/show} - * @return {Collection} Collection containing elements - */ - show () { - return this.each(show) - } - /** - * Attach an event handler function for each elements - * @see {@link events/on} - * @param {string} eventName - * @param {Function} eventHandler - * @return {Collection} Collection containing elements - */ - on (eventName, eventHandler) { - return this.each(on, eventName, eventHandler) - } - /** - * Remove an event handler function for each elements - * @see {@link events/off} - * @param {string} eventName - * @param {Function} eventHandler - * @return {Collection} Collection containing elements - */ - off (eventName, eventHandler) { - return this.each(off, eventName, eventHandler) - } - /** - * Execute all handlers to each elements - * @see {@link events/trigger} - * @param {string} eventName - * @param {Object} data - * @return {Collection} Collection containing elements - */ - trigger (eventName, data) { - return this.each(trigger, eventName, data) - } - /** - * Returns a collection of matched elements either found in the DOM based on passed argument - * @see {@link selectors/find} - * @param {(string|Element)} selectorOrElement Accepts a string containing a CSS selector which is then used to match a set of elements, or an Element - * @return {Collection} Collection containing elements - */ - find (selectorOrElement) { - if (selectorOrElement instanceof Element === true) { - return new Collection(selectorOrElement) - } else { - return this.elements - .map(element => find(selectorOrElement, element)) - .filter(element => element.length || element instanceof Element === true) - .reduce((accumulator, element) => accumulator.concat(element), []) - .reduce((accumulator, element) => { - if (~accumulator.elements.indexOf(element)) { - return accumulator - } else { - accumulator.elements.push(element) - return accumulator - } - }, new Collection()) - } - } -} diff --git a/src/index.js b/src/index.js index c8a0856..8085907 100644 --- a/src/index.js +++ b/src/index.js @@ -3,12 +3,9 @@ * @module index */ -import Collection from './collection' - export { find, is, contains, prev, next, siblings, parent } from './selectors' export { hasClass, addClass, removeClass, toggleClass, attr, css } from './attributes' export { parseHTML, before, after, prepend, append, clone, remove, text, html, replaceWith } from './content' export { fadeIn, fadeOut, hide, show } from './effects' export { viewportPosition, offset, position, outerHeight, outerWidth } from './positions' export { off, on, trigger, documentReady } from './events' -export { Collection } diff --git a/src/selectors.js b/src/selectors.js index 5c5c6d4..80c8924 100644 --- a/src/selectors.js +++ b/src/selectors.js @@ -18,6 +18,7 @@ export function find (selector, context = document) { if (/^#[\w-]*$/.test(selector)) { elements = document.getElementById(selector.substr(1)) || [] } else if (/^\.[\w-]*$/.test(selector)) { + console.log(selector.slice(1)) elements = context.getElementsByClassName(selector.slice(1)) } else if (/^\w+$/.test(selector)) { elements = context.getElementsByTagName(selector) diff --git a/test/specs/collection.spec.js b/test/specs/collection.spec.js deleted file mode 100644 index e45dadc..0000000 --- a/test/specs/collection.spec.js +++ /dev/null @@ -1,191 +0,0 @@ -import Collection from 'src/collection' - -const attributes = require('src/attributes') -const content = require('src/content') -const effects = require('src/effects') -const events = require('src/events') -const selectors = require('src/selectors') -/** - * @jest-environment jsdom - */ -describe('Collection', () => { - let elements = [] - let collection - const commonClass = 'commonClass' - beforeEach(() => { - [ - ['span'], - ['div'] - ].forEach(([tag, className]) => { - const element = document.createElement(tag) - element.className += commonClass - document.body.appendChild(element) - elements.push(element) - }) - collection = new Collection(elements) - }) - afterEach(() => { - elements = [] - collection = null - document.body.innerHTML = '' - }) - describe('Initialisation', () => { - test('Array of elements', () => { - expect(collection).toBeInstanceOf(Collection) - expect(collection.elements).toBeInstanceOf(Array) - expect(collection.elements.length).toBe(elements.length) - }) - test('An element', () => { - const collection = new Collection(elements[0]) - expect(collection.elements.length).toBe(1) - }) - test('Class name', () => { - const collection = new Collection('.' + commonClass) - expect(collection.elements.length).toBe(elements.length) - }) - }) - test('Execute method', () => { - const method = jest.fn() - const myParam2 = 2 - collection.each(method, 'myParam1', myParam2) - expect(method).toHaveBeenCalledTimes(2) - expect(method).toHaveBeenLastCalledWith(elements[1], 'myParam1', myParam2) - }) - describe('Find', () => { - const find = jest.spyOn(selectors, 'find') - test('Existing', () => { - collection.elements[0].appendChild(document.createElement('p')) - const newCollection = collection.find('.commonClass p') - expect(find).toHaveBeenLastCalledWith('.commonClass p', elements[1]) - expect(newCollection).toBeInstanceOf(Collection) - expect(newCollection.elements.length).toBe(1) - }) - test('Existing element', () => { - const paragraph = document.createElement('p') - const newCollection = collection.find(paragraph) - expect(newCollection).toBeInstanceOf(Collection) - expect(newCollection.elements.length).toBe(1) - }) - test('Unexisting', () => { - const newCollection = collection.find('#testId') - expect(newCollection.elements.length).toBe(0) - }) - test('Already exist child', () => { - collection.elements[0].appendChild(document.createElement('p')) - const newCollection = new Collection([elements[0], elements[0].children[0].parentNode]) - expect(newCollection.find('p').elements.length).toBe(1) - }) - }) - test('Add class', () => { - const addClass = jest.spyOn(attributes, 'addClass') - collection.addClass('myClass') - expect(addClass).toHaveBeenLastCalledWith(elements[1], 'myClass') - }) - test('Remove class', () => { - const removeClass = jest.spyOn(attributes, 'removeClass') - collection.each(element => { - element.className += 'customClass' - }) - collection.removeClass('myClass') - expect(removeClass).toHaveBeenLastCalledWith(elements[1], 'myClass') - }) - test('Toggle class', () => { - const toggleClass = jest.spyOn(attributes, 'toggleClass') - collection.toggleClass('myClass2') - expect(toggleClass).toHaveBeenLastCalledWith(elements[1], 'myClass2', undefined) - collection.toggleClass('myClass2', true) - expect(toggleClass).toHaveBeenLastCalledWith(elements[1], 'myClass2', true) - }) - test('Attribute', () => { - const attr = jest.spyOn(attributes, 'attr') - collection.attr('myAttr') - expect(attr).toHaveBeenLastCalledWith(elements[1], 'myAttr', undefined) - collection.attr('myAttr', true) - expect(attr).toHaveBeenLastCalledWith(elements[1], 'myAttr', true) - }) - test('CSS', () => { - const css = jest.spyOn(attributes, 'css') - collection.css('color', 'red') - expect(css).toHaveBeenLastCalledWith(elements[1], 'color', 'red') - }) - test('Before', () => { - const before = jest.spyOn(content, 'before') - collection.before('') - expect(before).toHaveBeenLastCalledWith(elements[1], '') - }) - test('After', () => { - const after = jest.spyOn(content, 'after') - collection.after('') - expect(after).toHaveBeenLastCalledWith(elements[1], '') - }) - test('Prepend', () => { - const prepend = jest.spyOn(content, 'prepend') - const img = document.createElement('img') - collection.prepend(img) - expect(prepend).toHaveBeenLastCalledWith(elements[1], img) - }) - test('Append', () => { - const append = jest.spyOn(content, 'append') - const img = document.createElement('img') - collection.append(img) - expect(append).toHaveBeenLastCalledWith(elements[1], img) - }) - test('Remove', () => { - const remove = jest.spyOn(content, 'remove') - collection.remove() - expect(remove).toHaveBeenLastCalledWith(elements[1]) - }) - test('Text', () => { - const text = jest.spyOn(content, 'text') - collection.text('textTest') - expect(text).toHaveBeenLastCalledWith(elements[1], 'textTest') - }) - test('Html', () => { - const html = jest.spyOn(content, 'html') - collection.html('htmlTest') - expect(html).toHaveBeenLastCalledWith(elements[1], 'htmlTest') - }) - test('Replace with', () => { - const replaceWith = jest.spyOn(content, 'replaceWith') - collection.replaceWith('') - expect(replaceWith).toHaveBeenLastCalledWith(elements[1], '') - }) - test('Fade in', () => { - const fadeIn = jest.spyOn(effects, 'fadeIn') - collection.fadeIn(200) - expect(fadeIn).toHaveBeenLastCalledWith(elements[1], 200) - }) - test('Fade out', () => { - const fadeOut = jest.spyOn(effects, 'fadeOut') - collection.fadeOut(200) - expect(fadeOut).toHaveBeenLastCalledWith(elements[1], 200) - }) - test('Show', () => { - const show = jest.spyOn(effects, 'show') - collection.show() - expect(show).toHaveBeenLastCalledWith(elements[1]) - }) - test('Hide', () => { - const hide = jest.spyOn(effects, 'hide') - collection.hide() - expect(hide).toHaveBeenLastCalledWith(elements[1]) - }) - test('On', () => { - const on = jest.spyOn(events, 'on') - const handler = jest.fn() - collection.on('click', handler) - expect(on).toHaveBeenLastCalledWith(elements[1], 'click', handler) - }) - test('Off', () => { - const off = jest.spyOn(events, 'off') - const handler = jest.fn() - collection.off('click', handler) - expect(off).toHaveBeenLastCalledWith(elements[1], 'click', handler) - }) - test('Trigger', () => { - const trigger = jest.spyOn(events, 'trigger') - const data = {} - collection.trigger('click', data) - expect(trigger).toHaveBeenLastCalledWith(elements[1], 'click', data) - }) -}) diff --git a/test/specs/index.spec.js b/test/specs/index.spec.js index 0438576..6422cf0 100644 --- a/test/specs/index.spec.js +++ b/test/specs/index.spec.js @@ -3,7 +3,6 @@ import * as Gaspard from 'src' describe('Entry', () => { test('Contain exposed methods', () => { expect(Gaspard).toEqual(expect.objectContaining({ - Collection: expect.any(Function), find: expect.any(Function), is: expect.any(Function), contains: expect.any(Function), diff --git a/test/specs/selectors.spec.js b/test/specs/selectors.spec.js index e8ef141..3d777f7 100644 --- a/test/specs/selectors.spec.js +++ b/test/specs/selectors.spec.js @@ -7,6 +7,7 @@ describe('Selectors', () => { beforeEach(() => { element = document.createElement('div') document.body.appendChild(element) + document.body.appendChild(element) }) afterEach(() => { document.body.innerHTML = '' @@ -21,10 +22,14 @@ describe('Selectors', () => { test('By Id', () => { element.id = 'toFind' expect(selectors.find('#toFind')).toBe(element) + expect(selectors.find('#notToFind')).toEqual([]) }) test('By class name', () => { + const span = document.createElement('span') + span.classList.add('toFind') + document.body.appendChild(span) element.classList.add('toFind') - expect(selectors.find('.toFind')).toContain(element) + expect(selectors.find('.toFind').length).toEqual(2) }) test('By tag name', () => { const img = document.createElement('img')