1 line
25 KiB
Plaintext
1 line
25 KiB
Plaintext
{"version":3,"sources":["foundation.util.box.min.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__foundation_core__","__WEBPACK_EXTERNAL_MODULE__foundation_core_utils__","modules","installedModules","__webpack_require__","moduleId","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","./foundation.core","./foundation.core.utils","./js/entries/plugins/foundation.util.box.js","__webpack_exports__","_foundation_core__WEBPACK_IMPORTED_MODULE_0__","_foundation_util_box__WEBPACK_IMPORTED_MODULE_1__","Box","./js/foundation.util.box.js","_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__","ImNotTouchingYou","element","parent","lrOnly","tbOnly","ignoreBottom","OverlapArea","GetDimensions","GetOffsets","anchor","position","vOffset","hOffset","isOverflow","console","log","GetExplicitOffsets","left","$eleDims","windowDims","offset","width","top","height","$anchorDims","topOver","bottomOver","leftOver","rightOver","eleDims","parDims","Math","min","sqrt","elem","length","document","Error","rect","getBoundingClientRect","parRect","parentNode","winRect","body","winY","pageYOffset","winX","pageXOffset","parentDims","alignment","topVal","leftVal","21"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,qBAAsBA,QAAQ,4BACtC,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,oBAAqB,2BAA4BJ,GAC/B,iBAAZC,QACdA,QAAQ,uBAAyBD,EAAQG,QAAQ,qBAAsBA,QAAQ,6BAE/EJ,EAA8B,wBAAIA,EAA8B,yBAAK,GAAIA,EAA8B,wBAAE,uBAAyBC,EAAQD,EAA8B,wBAAE,mBAAoBA,EAA8B,wBAAE,qBARhO,CASGO,OAAQ,SAASC,EAA8CC,GAClE,OAAgB,SAAUC,GAEhB,IAAIC,EAAmB,GAGv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AYJ,OAAOE,IAAMX,EAAUa,EAAYD,OAAS,EAAIL,EAASK,OAAS,GAO/F,MAAO,CACLD,IAAK4B,EACLjC,KAAMkC,KAQJC,GAKA,SAAUvG,EAAQD,EAASU,GAEjCT,EAAOD,QAAUU,EAAkK","file":"foundation.util.box.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"./foundation.core.utils\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.core.utils\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.util.box\"] = factory(require(\"./foundation.core\"), require(\"./foundation.core.utils\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.box\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_core_utils__) {\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, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 21);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./foundation.core\":\n/*!****************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"} ***!\n \\****************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;\n\n/***/ }),\n\n/***/ \"./foundation.core.utils\":\n/*!**********************************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core.utils\",\"commonjs\":\"./foundation.core.utils\",\"commonjs2\":\"./foundation.core.utils\"} ***!\n \\**********************************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core_utils__;\n\n/***/ }),\n\n/***/ \"./js/entries/plugins/foundation.util.box.js\":\n/*!***************************************************!*\\\n !*** ./js/entries/plugins/foundation.util.box.js ***!\n \\***************************************************/\n/*! exports provided: Foundation, Box */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ \"./foundation.core\");\n/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Foundation\", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__[\"Foundation\"]; });\n\n/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.box */ \"./js/foundation.util.box.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Box\", function() { return _foundation_util_box__WEBPACK_IMPORTED_MODULE_1__[\"Box\"]; });\n\n\n\n_foundation_core__WEBPACK_IMPORTED_MODULE_0__[\"Foundation\"].Box = _foundation_util_box__WEBPACK_IMPORTED_MODULE_1__[\"Box\"];\n\n\n/***/ }),\n\n/***/ \"./js/foundation.util.box.js\":\n/*!***********************************!*\\\n !*** ./js/foundation.util.box.js ***!\n \\***********************************/\n/*! exports provided: Box */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Box\", function() { return Box; });\n/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core.utils */ \"./foundation.core.utils\");\n/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__);\n\n\n\nvar Box = {\n ImNotTouchingYou: ImNotTouchingYou,\n OverlapArea: OverlapArea,\n GetDimensions: GetDimensions,\n GetOffsets: GetOffsets,\n GetExplicitOffsets: GetExplicitOffsets\n /**\n * Compares the dimensions of an element to a container and determines collision events with container.\n * @function\n * @param {jQuery} element - jQuery object to test for collisions.\n * @param {jQuery} parent - jQuery object to use as bounding container.\n * @param {Boolean} lrOnly - set to true to check left and right values only.\n * @param {Boolean} tbOnly - set to true to check top and bottom values only.\n * @default if no parent object passed, detects collisions with `window`.\n * @returns {Boolean} - true if collision free, false if a collision in any direction.\n */\n\n};\n\nfunction ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {\n return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;\n}\n\n;\n\nfunction OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {\n var eleDims = GetDimensions(element),\n topOver,\n bottomOver,\n leftOver,\n rightOver;\n\n if (parent) {\n var parDims = GetDimensions(parent);\n bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - parDims.offset.top;\n leftOver = eleDims.offset.left - parDims.offset.left;\n rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width);\n } else {\n bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - eleDims.windowDims.offset.top;\n leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;\n rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);\n }\n\n bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);\n topOver = Math.min(topOver, 0);\n leftOver = Math.min(leftOver, 0);\n rightOver = Math.min(rightOver, 0);\n\n if (lrOnly) {\n return leftOver + rightOver;\n }\n\n if (tbOnly) {\n return topOver + bottomOver;\n } // use sum of squares b/c we care about overlap area.\n\n\n return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver);\n}\n/**\n * Uses native methods to return an object of dimension values.\n * @function\n * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.\n * @returns {Object} - nested object of integer pixel values\n * TODO - if element is window, return only those values.\n */\n\n\nfunction GetDimensions(elem) {\n elem = elem.length ? elem[0] : elem;\n\n if (elem === window || elem === document) {\n throw new Error(\"I'm sorry, Dave. I'm afraid I can't do that.\");\n }\n\n var rect = elem.getBoundingClientRect(),\n parRect = elem.parentNode.getBoundingClientRect(),\n winRect = document.body.getBoundingClientRect(),\n winY = window.pageYOffset,\n winX = window.pageXOffset;\n return {\n width: rect.width,\n height: rect.height,\n offset: {\n top: rect.top + winY,\n left: rect.left + winX\n },\n parentDims: {\n width: parRect.width,\n height: parRect.height,\n offset: {\n top: parRect.top + winY,\n left: parRect.left + winX\n }\n },\n windowDims: {\n width: winRect.width,\n height: winRect.height,\n offset: {\n top: winY,\n left: winX\n }\n }\n };\n}\n/**\n * Returns an object of top and left integer pixel values for dynamically rendered elements,\n * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where\n * you don't know alignment, but generally from\n * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.\n * @function\n * @param {jQuery} element - jQuery object for the element being positioned.\n * @param {jQuery} anchor - jQuery object for the element's anchor point.\n * @param {String} position - a string relating to the desired position of the element, relative to it's anchor\n * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.\n * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.\n * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.\n * TODO alter/rewrite to work with `em` values as well/instead of pixels\n */\n\n\nfunction GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) {\n console.log(\"NOTE: GetOffsets is deprecated in favor of GetExplicitOffsets and will be removed in 6.5\");\n\n switch (position) {\n case 'top':\n return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__[\"rtl\"])() ? GetExplicitOffsets(element, anchor, 'top', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'top', 'right', vOffset, hOffset, isOverflow);\n\n case 'bottom':\n return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__[\"rtl\"])() ? GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow);\n\n case 'center top':\n return GetExplicitOffsets(element, anchor, 'top', 'center', vOffset, hOffset, isOverflow);\n\n case 'center bottom':\n return GetExplicitOffsets(element, anchor, 'bottom', 'center', vOffset, hOffset, isOverflow);\n\n case 'center left':\n return GetExplicitOffsets(element, anchor, 'left', 'center', vOffset, hOffset, isOverflow);\n\n case 'center right':\n return GetExplicitOffsets(element, anchor, 'right', 'center', vOffset, hOffset, isOverflow);\n\n case 'left bottom':\n return GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow);\n\n case 'right bottom':\n return GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow);\n // Backwards compatibility... this along with the reveal and reveal full\n // classes are the only ones that didn't reference anchor\n\n case 'center':\n return {\n left: $eleDims.windowDims.offset.left + $eleDims.windowDims.width / 2 - $eleDims.width / 2 + hOffset,\n top: $eleDims.windowDims.offset.top + $eleDims.windowDims.height / 2 - ($eleDims.height / 2 + vOffset)\n };\n\n case 'reveal':\n return {\n left: ($eleDims.windowDims.width - $eleDims.width) / 2 + hOffset,\n top: $eleDims.windowDims.offset.top + vOffset\n };\n\n case 'reveal full':\n return {\n left: $eleDims.windowDims.offset.left,\n top: $eleDims.windowDims.offset.top\n };\n break;\n\n default:\n return {\n left: Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__[\"rtl\"])() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset : $anchorDims.offset.left + hOffset,\n top: $anchorDims.offset.top + $anchorDims.height + vOffset\n };\n }\n}\n\nfunction GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {\n var $eleDims = GetDimensions(element),\n $anchorDims = anchor ? GetDimensions(anchor) : null;\n var topVal, leftVal; // set position related attribute\n\n switch (position) {\n case 'top':\n topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);\n break;\n\n case 'bottom':\n topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;\n break;\n\n case 'left':\n leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);\n break;\n\n case 'right':\n leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;\n break;\n } // set alignment related attribute\n\n\n switch (position) {\n case 'top':\n case 'bottom':\n switch (alignment) {\n case 'left':\n leftVal = $anchorDims.offset.left + hOffset;\n break;\n\n case 'right':\n leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;\n break;\n\n case 'center':\n leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset;\n break;\n }\n\n break;\n\n case 'right':\n case 'left':\n switch (alignment) {\n case 'bottom':\n topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;\n break;\n\n case 'top':\n topVal = $anchorDims.offset.top + vOffset;\n break;\n\n case 'center':\n topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2;\n break;\n }\n\n break;\n }\n\n return {\n top: topVal,\n left: leftVal\n };\n}\n\n\n\n/***/ }),\n\n/***/ 21:\n/*!*********************************************************!*\\\n !*** multi ./js/entries/plugins/foundation.util.box.js ***!\n \\*********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(/*! /Users/ncoden/Documents/Documents/Projects/Programmation/Web/2016/Foundation/foundation-sites/js/entries/plugins/foundation.util.box.js */\"./js/entries/plugins/foundation.util.box.js\");\n\n\n/***/ })\n\n/******/ });\n});\n//# sourceMappingURL=foundation.util.box.js.map"]} |