UNPKG

set-resizable

Version:

A small JS library to convert any HTML element into a resizable element.

216 lines (182 loc) 37.8 kB
/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["Resizable"] = factory(); else root["Resizable"] = factory(); })(this, () => { return /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./src/set-resizable.js": /*!******************************!*\ !*** ./src/set-resizable.js ***! \******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Resizable)\n/* harmony export */ });\n/* harmony import */ var _set_resizable_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./set-resizable.css */ \"./src/set-resizable.css\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _assertClassBrand(e, t, n) { if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError(\"Private element is not present on this object\"); }\n// for webpack\n\n\nvar _Resizable_brand = /*#__PURE__*/new WeakSet();\nvar Resizable = /*#__PURE__*/function () {\n function Resizable(element) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Resizable);\n _classPrivateMethodInitSpec(this, _Resizable_brand);\n // eslint-disable-next-line no-undef\n if (!(element instanceof HTMLElement)) return console.error('Element not provided');\n this.element = element;\n this.options = Object.assign({\n active: false,\n activeEvent: 'click',\n color: 'Blue',\n info: true,\n minSize: '40px',\n overflow: 'auto',\n nodes: true\n }, options);\n this.data = {\n x: 0,\n y: 0,\n w: 0,\n h: 0,\n r: 0,\n shift: false,\n selected: '',\n position: this.element.style.position,\n display: window.getComputedStyle(element, null).display !== 'inline' ? window.getComputedStyle(element, null).display : 'inline-block'\n };\n this.activeElement = document.createElement('div');\n this.activeElement.classList.add('resizable'); // add class styles\n\n this.element.addEventListener(this.options.activeEvent, this.activate.bind(this));\n if (this.options.active) {\n this.activate();\n // this.element.dispatchEvent(new Event(this.options.activeEvent));\n // this.element.dispatchEvent(new Event('mousedown'));\n // this.data.selected = false;\n }\n this.activeElement.onmousedown = function (event) {\n return _assertClassBrand(_Resizable_brand, _this, _onselect).call(_this, event);\n };\n this.activeElement.ontouchstart = function (event) {\n return _assertClassBrand(_Resizable_brand, _this, _onselect).call(_this, event);\n };\n document.addEventListener('mousemove', _assertClassBrand(_Resizable_brand, this, _onresize).bind(this));\n document.addEventListener('touchmove', _assertClassBrand(_Resizable_brand, this, _onresize).bind(this), {\n passive: false\n });\n document.addEventListener('mouseup', this.resize.bind(this));\n document.addEventListener('touchend', this.resize.bind(this));\n document.addEventListener('keydown', function (event) {\n if (event.shiftKey) {\n this.data.shift = true;\n }\n }.bind(this));\n document.addEventListener('keyup', function (event) {\n if (event.key === 'Shift') {\n this.data.shift = false;\n }\n }.bind(this));\n document.addEventListener('click', _assertClassBrand(_Resizable_brand, this, _deactivate).bind(this));\n }\n return _createClass(Resizable, [{\n key: \"activate\",\n value: function activate() {\n this.deactivate();\n document.querySelector(':root').style.setProperty('--resizable-color', this.options.color);\n document.querySelector(':root').style.setProperty('--resizable-display', this.data.display);\n document.querySelector(':root').style.setProperty('--resizable-min-size', this.options.minSize);\n var info = '';\n if (this.options.info) info = \"<span class='info'> \".concat(this.element.offsetWidth, \" &#215; \").concat(this.element.offsetHeight, \" px</span>\");\n this.element.replaceWith(this.activeElement);\n this.activeElement.innerHTML = \"\\n <table class='control \".concat(this.options.nodes ? 'nodes' : '', \"'>\\n <tr>\\n <td class=\\\"n w\\\"></td>\\n <td class=\\\"n\\\"></td>\\n <td class=\\\"n e\\\"></td>\\n </tr>\\n <tr>\\n <td class=\\\"w\\\"></td>\\n <td class=\\\"c\\\">\").concat(info, \"</td>\\n <td class=\\\"e\\\"></td>\\n </tr>\\n <tr>\\n <td class=\\\"s w\\\"></td>\\n <td class=\\\"s\\\"></td>\\n <td class=\\\"s e\\\"></td>\\n </tr>\\n </table>\\n \");\n this.activeElement.prepend(this.element);\n this.activeElement.style.width = this.element.offsetWidth + 'px';\n this.activeElement.style.height = this.element.offsetHeight + 'px';\n this.data.w = this.element.offsetWidth;\n this.data.h = this.element.offsetHeight;\n // this.data.selected = true;\n\n if (typeof this.onactivate === 'function') {\n this.onactivate(this);\n }\n }\n }, {\n key: \"deactivate\",\n value: function deactivate() {\n document.querySelectorAll('.resizable').forEach(function (item) {\n item.replaceWith(item.firstChild);\n });\n }\n }, {\n key: \"resize\",\n value: function resize(w, h) {\n // console.log(w, h);\n if (this.data.selected) {\n if (h) {\n this.data.w = w;\n this.data.h = h;\n this.data.r = this.data.w / this.data.h;\n this.activeElement.style.width = w + 'px';\n this.activeElement.style.height = h + 'px';\n }\n if (this.options.nodes) this.activeElement.querySelector('.control').classList.add('nodes');\n this.activeElement.querySelector('.control').style.top = 0 + 'px';\n this.activeElement.querySelector('.control').style.left = 0 + 'px';\n this.element.style.boxSizing = 'border-box';\n this.element.style.overflow = this.options.overflow;\n this.element.style.width = this.activeElement.offsetWidth + 'px';\n this.element.style.height = this.activeElement.offsetHeight + 'px';\n this.element.style.position = this.data.position;\n _assertClassBrand(_Resizable_brand, this, _updateInfo).call(this);\n if (this.activeElement.contains(w.target) && typeof this.onresize === 'function') {\n this.onresize({\n newWidth: this.activeElement.offsetWidth,\n newHeight: this.activeElement.offsetHeight\n });\n }\n this.data.selected = false;\n }\n }\n }]);\n}();\nfunction _deactivate(event) {\n if (!this.activeElement.contains(event.target)) {\n this.activeElement.replaceWith(this.element);\n }\n}\nfunction _onselect(event) {\n this.data.x = event.clientX || event.touches[0].clientX;\n this.data.y = event.clientY || event.touches[0].clientY;\n this.data.w = this.activeElement.offsetWidth;\n this.data.h = this.activeElement.offsetHeight;\n this.data.r = this.data.w / this.data.h;\n this.data.selected = event.target.className || event.targetTouches[0].target.className;\n if (this.data.display === 'table') this.element.style.position = 'absolute';\n}\nfunction _onresize(event) {\n event.preventDefault();\n var clientX = event.clientX || event.touches[0].clientX;\n var clientY = event.clientY || event.touches[0].clientY;\n if (this.data.selected) {\n if (this.options.nodes) this.activeElement.querySelector('.control').classList.remove('nodes');\n if (this.data.selected.indexOf('e') > -1) {\n this.activeElement.style.width = this.data.w + clientX - this.data.x + 'px';\n if (this.data.shift) this.activeElement.style.height = this.activeElement.offsetWidth / this.data.r + 'px';\n }\n if (this.data.selected.indexOf('s') > -1) {\n this.activeElement.style.height = this.data.h + clientY - this.data.y + 'px';\n if (this.data.shift) this.activeElement.style.width = this.activeElement.offsetHeight * this.data.r + 'px';\n }\n if (this.data.selected.indexOf('n') > -1) {\n this.activeElement.style.height = this.data.h - clientY + this.data.y + 'px';\n this.activeElement.querySelector('.control').style.top = clientY - this.data.y + 'px';\n if (this.data.shift) {\n this.activeElement.style.width = this.activeElement.offsetHeight * this.data.r + 'px';\n this.activeElement.querySelector('.control').style.left = (clientY - this.data.y) * this.data.r + 'px';\n }\n }\n if (this.data.selected.indexOf('w') > -1) {\n this.activeElement.style.width = this.data.w - clientX + this.data.x + 'px';\n this.activeElement.querySelector('.control').style.left = clientX - this.data.x + 'px';\n if (this.data.shift) {\n this.activeElement.style.height = this.activeElement.offsetWidth / this.data.r + 'px';\n this.activeElement.querySelector('.control').style.top = (clientX - this.data.x) / this.data.r + 'px';\n }\n }\n _assertClassBrand(_Resizable_brand, this, _updateInfo).call(this);\n\n // if (typeof this.onresize == \"function\"){\n // this.onresize({newWidth: this.activeElement.offsetWidth, newHeight: this.activeElement.offsetHeight});\n // }\n }\n}\nfunction _updateInfo() {\n if (this.options.info) {\n var info = \"<span class='info'> \".concat(this.activeElement.offsetWidth, \" &#215; \").concat(this.activeElement.offsetHeight, \" px</span>\");\n this.activeElement.querySelector('.control .c').innerHTML = info;\n }\n}\n\n\n//# sourceURL=webpack://Resizable/./src/set-resizable.js?"); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./src/set-resizable.css": /*!*********************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js!./src/set-resizable.css ***! \*********************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{\r\n --resizable-color:blue;\r\n}\r\n\r\n.resizable {\r\n display: var(--resizable-display);\r\n position: relative;\r\n min-width: var(--resizable-min-size);\r\n min-height: var(--resizable-min-size);\r\n overflow: visible;\r\n}\r\n\r\n.resizable .control {\r\n border-collapse: collapse;\r\n border: 1px solid var(--resizable-color);\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.resizable .control .c {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.resizable .control .c span.info {\r\n color: #fff;\r\n background-color: var(--resizable-color);\r\n padding: 3px;\r\n border-radius: 3px;\r\n position: absolute;\r\n bottom: 15px;\r\n right: 15px;\r\n}\r\n\r\n.resizable .control .w:hover,\r\n.resizable .control .e:hover {\r\n cursor: ew-resize;\r\n}\r\n\r\n.resizable .control .s.e:hover,\r\n.resizable .control .n.w:hover {\r\n cursor: nwse-resize;\r\n}\r\n\r\n.resizable .control .s:hover,\r\n.resizable .control .n:hover {\r\n cursor: ns-resize;\r\n}\r\n\r\n.resizable .control .n.e:hover,\r\n.resizable .control .s.w:hover {\r\n cursor: nesw-resize;\r\n}\r\n\r\n.resizable .control td {\r\n padding: 5px;\r\n text-align: center;\r\n}\r\n\r\n\r\n/* Nodes */\r\n\r\n.resizable .control.nodes td::after{\r\n content:\"\";\r\n display:inline-block;\r\n width: 10px;\r\n height: 10px;\r\n border-radius: 10px;\r\n background-color: var(--resizable-color);\r\n position: absolute;\r\n}\r\n\r\n.resizable .control.nodes td.c::after{\r\n display: none;\r\n}\r\n\r\n.resizable .control.nodes td.w::after{\r\n margin-left: -10px;\r\n}\r\n\r\n.resizable .control.nodes td.n::after{\r\n margin-top: -10px;\r\n}\r\n\r\n.resizable .control.nodes td.e::after{\r\n margin-right: -10px;\r\n}\r\n\r\n.resizable .control.nodes td.s::after{\r\n margin-bottom: -10px;\r\n}\r\n\r\n\r\n\r\n/* Debug Styles */\r\n\r\n\r\n/* .resizable .control {\r\n background-color: rgba(0,255,0,0.5); \r\n}\r\n\r\n.resizable .control td {\r\n outline: 1px solid red; \r\n}\r\n\r\n.resizable .control td:hover {\r\n background-color: blue;\r\n} \r\n\r\n.resizable .control td.mc:hover {\r\n background: none;\r\n} */`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://Resizable/./src/set-resizable.css?./node_modules/css-loader/dist/cjs.js"); /***/ }), /***/ "./node_modules/css-loader/dist/runtime/api.js": /*!*****************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/api.js ***! \*****************************************************/ /***/ ((module) => { eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};\n\n//# sourceURL=webpack://Resizable/./node_modules/css-loader/dist/runtime/api.js?"); /***/ }), /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js": /*!**************************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/noSourceMaps.js ***! \**************************************************************/ /***/ ((module) => { eval("\n\nmodule.exports = function (i) {\n return i[1];\n};\n\n//# sourceURL=webpack://Resizable/./node_modules/css-loader/dist/runtime/noSourceMaps.js?"); /***/ }), /***/ "./src/set-resizable.css": /*!*******************************!*\ !*** ./src/set-resizable.css ***! \*******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ \"./node_modules/style-loader/dist/runtime/styleDomAPI.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ \"./node_modules/style-loader/dist/runtime/insertBySelector.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ \"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ \"./node_modules/style-loader/dist/runtime/insertStyleElement.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ \"./node_modules/style-loader/dist/runtime/styleTagTransform.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_set_resizable_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./set-resizable.css */ \"./node_modules/css-loader/dist/cjs.js!./src/set-resizable.css\");\n\n \n \n \n \n \n \n \n \n \n\nvar options = {};\n\noptions.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());\noptions.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());\noptions.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, \"head\");\noptions.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());\noptions.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_set_resizable_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"], options);\n\n\n\n\n /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_set_resizable_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && _node_modules_css_loader_dist_cjs_js_set_resizable_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals ? _node_modules_css_loader_dist_cjs_js_set_resizable_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals : undefined);\n\n\n//# sourceURL=webpack://Resizable/./src/set-resizable.css?"); /***/ }), /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": /*!****************************************************************************!*\ !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! \****************************************************************************/ /***/ ((module) => { eval("\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};\n\n//# sourceURL=webpack://Resizable/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?"); /***/ }), /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js": /*!********************************************************************!*\ !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***! \********************************************************************/ /***/ ((module) => { eval("\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;\n\n//# sourceURL=webpack://Resizable/./node_modules/style-loader/dist/runtime/insertBySelector.js?"); /***/ }), /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js": /*!**********************************************************************!*\ !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***! \**********************************************************************/ /***/ ((module) => { eval("\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;\n\n//# sourceURL=webpack://Resizable/./node_modules/style-loader/dist/runtime/insertStyleElement.js?"); /***/ }), /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js": /*!**********************************************************************************!*\ !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***! \**********************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = true ? __webpack_require__.nc : 0;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;\n\n//# sourceURL=webpack://Resizable/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js?"); /***/ }), /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js": /*!***************************************************************!*\ !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***! \***************************************************************/ /***/ ((module) => { eval("\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;\n\n//# sourceURL=webpack://Resizable/./node_modules/style-loader/dist/runtime/styleDomAPI.js?"); /***/ }), /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js": /*!*********************************************************************!*\ !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***! \*********************************************************************/ /***/ ((module) => { eval("\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;\n\n//# sourceURL=webpack://Resizable/./node_modules/style-loader/dist/runtime/styleTagTransform.js?"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/nonce */ /******/ (() => { /******/ __webpack_require__.nc = undefined; /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./src/set-resizable.js"); /******/ __webpack_exports__ = __webpack_exports__["default"]; /******/ /******/ return __webpack_exports__; /******/ })() ; });