vue-resizable.umd.js 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("vue"));
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["vue-resizable"] = factory(require("vue"));
  8. else
  9. root["vue-resizable"] = factory(root["Vue"]);
  10. })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__203__) {
  11. return /******/ (function() { // webpackBootstrap
  12. /******/ var __webpack_modules__ = ({
  13. /***/ 322:
  14. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15. "use strict";
  16. __webpack_require__.r(__webpack_exports__);
  17. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81);
  18. /* 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__);
  19. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645);
  20. /* 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__);
  21. // Imports
  22. var ___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()));
  23. // Module
  24. ___CSS_LOADER_EXPORT___.push([module.id, ".resizable-component[data-v-3de5149f]{position:relative}.resizable-component>.resizable-r[data-v-3de5149f]{z-index:90;cursor:e-resize;top:0;height:100%}.resizable-component>.resizable-r[data-v-3de5149f],.resizable-component>.resizable-rb[data-v-3de5149f]{display:block;position:absolute;touch-action:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;width:12px;right:-6px}.resizable-component>.resizable-rb[data-v-3de5149f]{cursor:se-resize;height:12px;bottom:-6px;z-index:91}.resizable-component>.resizable-b[data-v-3de5149f]{z-index:90;cursor:s-resize;width:100%;left:0}.resizable-component>.resizable-b[data-v-3de5149f],.resizable-component>.resizable-lb[data-v-3de5149f]{display:block;position:absolute;touch-action:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;height:12px;bottom:-6px}.resizable-component>.resizable-lb[data-v-3de5149f]{cursor:sw-resize;width:12px;left:-6px;z-index:91}.resizable-component>.resizable-l[data-v-3de5149f]{z-index:90;cursor:w-resize;height:100%;top:0}.resizable-component>.resizable-l[data-v-3de5149f],.resizable-component>.resizable-lt[data-v-3de5149f]{display:block;position:absolute;touch-action:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;width:12px;left:-6px}.resizable-component>.resizable-lt[data-v-3de5149f]{cursor:nw-resize;height:12px;top:-6px;z-index:91}.resizable-component>.resizable-t[data-v-3de5149f]{z-index:90;cursor:n-resize;width:100%;left:0}.resizable-component>.resizable-rt[data-v-3de5149f],.resizable-component>.resizable-t[data-v-3de5149f]{display:block;position:absolute;touch-action:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;height:12px;top:-6px}.resizable-component>.resizable-rt[data-v-3de5149f]{cursor:ne-resize;width:12px;right:-6px;z-index:91}", ""]);
  25. // Exports
  26. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  27. /***/ }),
  28. /***/ 645:
  29. /***/ (function(module) {
  30. "use strict";
  31. /*
  32. MIT License http://www.opensource.org/licenses/mit-license.php
  33. Author Tobias Koppers @sokra
  34. */
  35. module.exports = function (cssWithMappingToString) {
  36. var list = []; // return the list of modules as css string
  37. list.toString = function toString() {
  38. return this.map(function (item) {
  39. var content = "";
  40. var needLayer = typeof item[5] !== "undefined";
  41. if (item[4]) {
  42. content += "@supports (".concat(item[4], ") {");
  43. }
  44. if (item[2]) {
  45. content += "@media ".concat(item[2], " {");
  46. }
  47. if (needLayer) {
  48. content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
  49. }
  50. content += cssWithMappingToString(item);
  51. if (needLayer) {
  52. content += "}";
  53. }
  54. if (item[2]) {
  55. content += "}";
  56. }
  57. if (item[4]) {
  58. content += "}";
  59. }
  60. return content;
  61. }).join("");
  62. }; // import a list of modules into the list
  63. list.i = function i(modules, media, dedupe, supports, layer) {
  64. if (typeof modules === "string") {
  65. modules = [[null, modules, undefined]];
  66. }
  67. var alreadyImportedModules = {};
  68. if (dedupe) {
  69. for (var k = 0; k < this.length; k++) {
  70. var id = this[k][0];
  71. if (id != null) {
  72. alreadyImportedModules[id] = true;
  73. }
  74. }
  75. }
  76. for (var _k = 0; _k < modules.length; _k++) {
  77. var item = [].concat(modules[_k]);
  78. if (dedupe && alreadyImportedModules[item[0]]) {
  79. continue;
  80. }
  81. if (typeof layer !== "undefined") {
  82. if (typeof item[5] === "undefined") {
  83. item[5] = layer;
  84. } else {
  85. item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
  86. item[5] = layer;
  87. }
  88. }
  89. if (media) {
  90. if (!item[2]) {
  91. item[2] = media;
  92. } else {
  93. item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
  94. item[2] = media;
  95. }
  96. }
  97. if (supports) {
  98. if (!item[4]) {
  99. item[4] = "".concat(supports);
  100. } else {
  101. item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
  102. item[4] = supports;
  103. }
  104. }
  105. list.push(item);
  106. }
  107. };
  108. return list;
  109. };
  110. /***/ }),
  111. /***/ 81:
  112. /***/ (function(module) {
  113. "use strict";
  114. module.exports = function (i) {
  115. return i[1];
  116. };
  117. /***/ }),
  118. /***/ 620:
  119. /***/ (function(__unused_webpack_module, exports) {
  120. "use strict";
  121. var __webpack_unused_export__;
  122. __webpack_unused_export__ = ({
  123. value: true
  124. }); // runtime helper for setting properties on components
  125. // in a tree-shakable way
  126. exports.Z = (sfc, props) => {
  127. const target = sfc.__vccOpts || sfc;
  128. for (const [key, val] of props) {
  129. target[key] = val;
  130. }
  131. return target;
  132. };
  133. /***/ }),
  134. /***/ 29:
  135. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  136. // style-loader: Adds some css to the DOM by adding a <style> tag
  137. // load the styles
  138. var content = __webpack_require__(322);
  139. if(content.__esModule) content = content.default;
  140. if(typeof content === 'string') content = [[module.id, content, '']];
  141. if(content.locals) module.exports = content.locals;
  142. // add the styles to the DOM
  143. var add = (__webpack_require__(208)/* ["default"] */ .Z)
  144. var update = add("0c86e32a", content, true, {"sourceMap":false,"shadowMode":false});
  145. /***/ }),
  146. /***/ 208:
  147. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  148. "use strict";
  149. // EXPORTS
  150. __webpack_require__.d(__webpack_exports__, {
  151. "Z": function() { return /* binding */ addStylesClient; }
  152. });
  153. ;// CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/listToStyles.js
  154. /**
  155. * Translates the list format produced by css-loader into something
  156. * easier to manipulate.
  157. */
  158. function listToStyles(parentId, list) {
  159. var styles = [];
  160. var newStyles = {};
  161. for (var i = 0; i < list.length; i++) {
  162. var item = list[i];
  163. var id = item[0];
  164. var css = item[1];
  165. var media = item[2];
  166. var sourceMap = item[3];
  167. var part = {
  168. id: parentId + ':' + i,
  169. css: css,
  170. media: media,
  171. sourceMap: sourceMap
  172. };
  173. if (!newStyles[id]) {
  174. styles.push(newStyles[id] = {
  175. id: id,
  176. parts: [part]
  177. });
  178. } else {
  179. newStyles[id].parts.push(part);
  180. }
  181. }
  182. return styles;
  183. }
  184. ;// CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/addStylesClient.js
  185. /*
  186. MIT License http://www.opensource.org/licenses/mit-license.php
  187. Author Tobias Koppers @sokra
  188. Modified by Evan You @yyx990803
  189. */
  190. var hasDocument = typeof document !== 'undefined'
  191. if (typeof DEBUG !== 'undefined' && DEBUG) {
  192. if (!hasDocument) {
  193. throw new Error(
  194. 'vue-style-loader cannot be used in a non-browser environment. ' +
  195. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  196. ) }
  197. }
  198. /*
  199. type StyleObject = {
  200. id: number;
  201. parts: Array<StyleObjectPart>
  202. }
  203. type StyleObjectPart = {
  204. css: string;
  205. media: string;
  206. sourceMap: ?string
  207. }
  208. */
  209. var stylesInDom = {/*
  210. [id: number]: {
  211. id: number,
  212. refs: number,
  213. parts: Array<(obj?: StyleObjectPart) => void>
  214. }
  215. */}
  216. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  217. var singletonElement = null
  218. var singletonCounter = 0
  219. var isProduction = false
  220. var noop = function () {}
  221. var options = null
  222. var ssrIdKey = 'data-vue-ssr-id'
  223. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  224. // tags it will allow on a page
  225. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  226. function addStylesClient (parentId, list, _isProduction, _options) {
  227. isProduction = _isProduction
  228. options = _options || {}
  229. var styles = listToStyles(parentId, list)
  230. addStylesToDom(styles)
  231. return function update (newList) {
  232. var mayRemove = []
  233. for (var i = 0; i < styles.length; i++) {
  234. var item = styles[i]
  235. var domStyle = stylesInDom[item.id]
  236. domStyle.refs--
  237. mayRemove.push(domStyle)
  238. }
  239. if (newList) {
  240. styles = listToStyles(parentId, newList)
  241. addStylesToDom(styles)
  242. } else {
  243. styles = []
  244. }
  245. for (var i = 0; i < mayRemove.length; i++) {
  246. var domStyle = mayRemove[i]
  247. if (domStyle.refs === 0) {
  248. for (var j = 0; j < domStyle.parts.length; j++) {
  249. domStyle.parts[j]()
  250. }
  251. delete stylesInDom[domStyle.id]
  252. }
  253. }
  254. }
  255. }
  256. function addStylesToDom (styles /* Array<StyleObject> */) {
  257. for (var i = 0; i < styles.length; i++) {
  258. var item = styles[i]
  259. var domStyle = stylesInDom[item.id]
  260. if (domStyle) {
  261. domStyle.refs++
  262. for (var j = 0; j < domStyle.parts.length; j++) {
  263. domStyle.parts[j](item.parts[j])
  264. }
  265. for (; j < item.parts.length; j++) {
  266. domStyle.parts.push(addStyle(item.parts[j]))
  267. }
  268. if (domStyle.parts.length > item.parts.length) {
  269. domStyle.parts.length = item.parts.length
  270. }
  271. } else {
  272. var parts = []
  273. for (var j = 0; j < item.parts.length; j++) {
  274. parts.push(addStyle(item.parts[j]))
  275. }
  276. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  277. }
  278. }
  279. }
  280. function createStyleElement () {
  281. var styleElement = document.createElement('style')
  282. styleElement.type = 'text/css'
  283. head.appendChild(styleElement)
  284. return styleElement
  285. }
  286. function addStyle (obj /* StyleObjectPart */) {
  287. var update, remove
  288. var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]')
  289. if (styleElement) {
  290. if (isProduction) {
  291. // has SSR styles and in production mode.
  292. // simply do nothing.
  293. return noop
  294. } else {
  295. // has SSR styles but in dev mode.
  296. // for some reason Chrome can't handle source map in server-rendered
  297. // style tags - source maps in <style> only works if the style tag is
  298. // created and inserted dynamically. So we remove the server rendered
  299. // styles and inject new ones.
  300. styleElement.parentNode.removeChild(styleElement)
  301. }
  302. }
  303. if (isOldIE) {
  304. // use singleton mode for IE9.
  305. var styleIndex = singletonCounter++
  306. styleElement = singletonElement || (singletonElement = createStyleElement())
  307. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  308. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  309. } else {
  310. // use multi-style-tag mode in all other cases
  311. styleElement = createStyleElement()
  312. update = applyToTag.bind(null, styleElement)
  313. remove = function () {
  314. styleElement.parentNode.removeChild(styleElement)
  315. }
  316. }
  317. update(obj)
  318. return function updateStyle (newObj /* StyleObjectPart */) {
  319. if (newObj) {
  320. if (newObj.css === obj.css &&
  321. newObj.media === obj.media &&
  322. newObj.sourceMap === obj.sourceMap) {
  323. return
  324. }
  325. update(obj = newObj)
  326. } else {
  327. remove()
  328. }
  329. }
  330. }
  331. var replaceText = (function () {
  332. var textStore = []
  333. return function (index, replacement) {
  334. textStore[index] = replacement
  335. return textStore.filter(Boolean).join('\n')
  336. }
  337. })()
  338. function applyToSingletonTag (styleElement, index, remove, obj) {
  339. var css = remove ? '' : obj.css
  340. if (styleElement.styleSheet) {
  341. styleElement.styleSheet.cssText = replaceText(index, css)
  342. } else {
  343. var cssNode = document.createTextNode(css)
  344. var childNodes = styleElement.childNodes
  345. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  346. if (childNodes.length) {
  347. styleElement.insertBefore(cssNode, childNodes[index])
  348. } else {
  349. styleElement.appendChild(cssNode)
  350. }
  351. }
  352. }
  353. function applyToTag (styleElement, obj) {
  354. var css = obj.css
  355. var media = obj.media
  356. var sourceMap = obj.sourceMap
  357. if (media) {
  358. styleElement.setAttribute('media', media)
  359. }
  360. if (options.ssrId) {
  361. styleElement.setAttribute(ssrIdKey, obj.id)
  362. }
  363. if (sourceMap) {
  364. // https://developer.chrome.com/devtools/docs/javascript-debugging
  365. // this makes source maps inside style tags work properly in Chrome
  366. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  367. // http://stackoverflow.com/a/26603875
  368. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  369. }
  370. if (styleElement.styleSheet) {
  371. styleElement.styleSheet.cssText = css
  372. } else {
  373. while (styleElement.firstChild) {
  374. styleElement.removeChild(styleElement.firstChild)
  375. }
  376. styleElement.appendChild(document.createTextNode(css))
  377. }
  378. }
  379. /***/ }),
  380. /***/ 203:
  381. /***/ (function(module) {
  382. "use strict";
  383. module.exports = __WEBPACK_EXTERNAL_MODULE__203__;
  384. /***/ })
  385. /******/ });
  386. /************************************************************************/
  387. /******/ // The module cache
  388. /******/ var __webpack_module_cache__ = {};
  389. /******/
  390. /******/ // The require function
  391. /******/ function __webpack_require__(moduleId) {
  392. /******/ // Check if module is in cache
  393. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  394. /******/ if (cachedModule !== undefined) {
  395. /******/ return cachedModule.exports;
  396. /******/ }
  397. /******/ // Create a new module (and put it into the cache)
  398. /******/ var module = __webpack_module_cache__[moduleId] = {
  399. /******/ id: moduleId,
  400. /******/ // no module.loaded needed
  401. /******/ exports: {}
  402. /******/ };
  403. /******/
  404. /******/ // Execute the module function
  405. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  406. /******/
  407. /******/ // Return the exports of the module
  408. /******/ return module.exports;
  409. /******/ }
  410. /******/
  411. /************************************************************************/
  412. /******/ /* webpack/runtime/compat get default export */
  413. /******/ !function() {
  414. /******/ // getDefaultExport function for compatibility with non-harmony modules
  415. /******/ __webpack_require__.n = function(module) {
  416. /******/ var getter = module && module.__esModule ?
  417. /******/ function() { return module['default']; } :
  418. /******/ function() { return module; };
  419. /******/ __webpack_require__.d(getter, { a: getter });
  420. /******/ return getter;
  421. /******/ };
  422. /******/ }();
  423. /******/
  424. /******/ /* webpack/runtime/define property getters */
  425. /******/ !function() {
  426. /******/ // define getter functions for harmony exports
  427. /******/ __webpack_require__.d = function(exports, definition) {
  428. /******/ for(var key in definition) {
  429. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  430. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  431. /******/ }
  432. /******/ }
  433. /******/ };
  434. /******/ }();
  435. /******/
  436. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  437. /******/ !function() {
  438. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  439. /******/ }();
  440. /******/
  441. /******/ /* webpack/runtime/make namespace object */
  442. /******/ !function() {
  443. /******/ // define __esModule on exports
  444. /******/ __webpack_require__.r = function(exports) {
  445. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  446. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  447. /******/ }
  448. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  449. /******/ };
  450. /******/ }();
  451. /******/
  452. /******/ /* webpack/runtime/publicPath */
  453. /******/ !function() {
  454. /******/ __webpack_require__.p = "";
  455. /******/ }();
  456. /******/
  457. /************************************************************************/
  458. var __webpack_exports__ = {};
  459. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  460. !function() {
  461. "use strict";
  462. // ESM COMPAT FLAG
  463. __webpack_require__.r(__webpack_exports__);
  464. // EXPORTS
  465. __webpack_require__.d(__webpack_exports__, {
  466. "default": function() { return /* binding */ entry_lib; }
  467. });
  468. ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  469. /* eslint-disable no-var */
  470. // This file is imported into lib/wc client bundles.
  471. if (typeof window !== 'undefined') {
  472. var currentScript = window.document.currentScript
  473. if (false) { var getCurrentScript; }
  474. var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
  475. if (src) {
  476. __webpack_require__.p = src[1] // eslint-disable-line
  477. }
  478. }
  479. // Indicate to webpack that this file can be concatenated
  480. /* harmony default export */ var setPublicPath = (null);
  481. // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
  482. var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(203);
  483. ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/vue-resizable.vue?vue&type=template&id=3de5149f&scoped=true
  484. function render(_ctx, _cache, $props, $setup, $data, $options) {
  485. return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
  486. ref: "parent",
  487. class: "resizable-component",
  488. style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)($options.style)
  489. }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default", {}, undefined, true), ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)(external_commonjs_vue_commonjs2_vue_root_Vue_.Fragment, null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderList)($props.active, el => {
  490. return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withDirectives)(((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
  491. key: el,
  492. class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)('resizable-' + el)
  493. }, null, 2)), [[external_commonjs_vue_commonjs2_vue_root_Vue_.vShow, !$props.maximize]]);
  494. }), 128))], 4);
  495. }
  496. ;// CONCATENATED MODULE: ./src/components/vue-resizable.vue?vue&type=template&id=3de5149f&scoped=true
  497. ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/vue-resizable.vue?vue&type=script&lang=js
  498. const ELEMENT_MASK = {
  499. "resizable-r": {
  500. bit: 0b0001,
  501. cursor: "e-resize"
  502. },
  503. "resizable-rb": {
  504. bit: 0b0011,
  505. cursor: "se-resize"
  506. },
  507. "resizable-b": {
  508. bit: 0b0010,
  509. cursor: "s-resize"
  510. },
  511. "resizable-lb": {
  512. bit: 0b0110,
  513. cursor: "sw-resize"
  514. },
  515. "resizable-l": {
  516. bit: 0b0100,
  517. cursor: "w-resize"
  518. },
  519. "resizable-lt": {
  520. bit: 0b1100,
  521. cursor: "nw-resize"
  522. },
  523. "resizable-t": {
  524. bit: 0b1000,
  525. cursor: "n-resize"
  526. },
  527. "resizable-rt": {
  528. bit: 0b1001,
  529. cursor: "ne-resize"
  530. },
  531. "drag-el": {
  532. bit: 0b1111,
  533. cursor: "pointer"
  534. }
  535. };
  536. const CALC_MASK = {
  537. l: 0b0001,
  538. t: 0b0010,
  539. w: 0b0100,
  540. h: 0b1000
  541. };
  542. /* harmony default export */ var vue_resizablevue_type_script_lang_js = ({
  543. name: "VResizable",
  544. props: {
  545. width: {
  546. default: undefined,
  547. type: [Number, String]
  548. },
  549. minWidth: {
  550. default: 0,
  551. type: Number
  552. },
  553. maxWidth: {
  554. default: undefined,
  555. type: Number
  556. },
  557. height: {
  558. default: undefined,
  559. type: [Number, String]
  560. },
  561. minHeight: {
  562. default: 0,
  563. type: Number
  564. },
  565. maxHeight: {
  566. default: undefined,
  567. type: Number
  568. },
  569. left: {
  570. default: 0,
  571. type: [Number, String]
  572. },
  573. top: {
  574. default: 0,
  575. type: [Number, String]
  576. },
  577. active: {
  578. default: () => ["r", "rb", "b", "lb", "l", "lt", "t", "rt"],
  579. validator: val => ["r", "rb", "b", "lb", "l", "lt", "t", "rt"].filter(value => val.indexOf(value) !== -1).length === val.length,
  580. type: Array
  581. },
  582. fitParent: {
  583. default: false,
  584. type: Boolean
  585. },
  586. dragSelector: {
  587. default: undefined,
  588. type: String
  589. },
  590. maximize: {
  591. default: false,
  592. type: Boolean
  593. },
  594. disableAttributes: {
  595. default: () => [],
  596. validator: val => ["l", "t", "w", "h"].filter(value => val.indexOf(value) !== -1).length === val.length,
  597. type: Array
  598. }
  599. },
  600. emits: ["mount", "destroy", "resize:start", "resize:move", "resize:end", "drag:start", "drag:move", "drag:end", "maximize"],
  601. data() {
  602. return {
  603. w: this.width,
  604. h: this.height,
  605. minW: this.minWidth,
  606. minH: this.minHeight,
  607. maxW: this.maxWidth,
  608. maxH: this.maxHeight,
  609. l: this.left,
  610. t: this.top,
  611. mouseX: 0,
  612. mouseY: 0,
  613. offsetX: 0,
  614. offsetY: 0,
  615. parent: {
  616. width: 0,
  617. height: 0
  618. },
  619. resizeState: 0,
  620. dragElements: [],
  621. dragState: false,
  622. calcMap: 0b1111
  623. };
  624. },
  625. computed: {
  626. style() {
  627. return { ...(this.calcMap & CALC_MASK.w && {
  628. width: typeof this.w === "number" ? this.w + "px" : this.w
  629. }),
  630. ...(this.calcMap & CALC_MASK.h && {
  631. height: typeof this.h === "number" ? this.h + "px" : this.h
  632. }),
  633. ...(this.calcMap & CALC_MASK.l && {
  634. left: typeof this.l === "number" ? this.l + "px" : this.l
  635. }),
  636. ...(this.calcMap & CALC_MASK.t && {
  637. top: typeof this.t === "number" ? this.t + "px" : this.t
  638. })
  639. };
  640. }
  641. },
  642. watch: {
  643. maxWidth(value) {
  644. this.maxW = value;
  645. },
  646. maxHeight(value) {
  647. this.maxH = value;
  648. },
  649. minWidth(value) {
  650. this.minW = value;
  651. },
  652. minHeight(value) {
  653. this.minH = value;
  654. },
  655. width(value) {
  656. typeof value === "number" && (this.w = value);
  657. },
  658. height(value) {
  659. typeof value === "number" && (this.h = value);
  660. },
  661. left(value) {
  662. typeof value === "number" && (this.l = value);
  663. },
  664. top(value) {
  665. typeof value === "number" && (this.t = value);
  666. },
  667. dragSelector(selector) {
  668. this.setupDragElements(selector);
  669. },
  670. maximize(value) {
  671. this.setMaximize(value);
  672. this.emitEvent("maximize", {
  673. state: value
  674. });
  675. }
  676. },
  677. mounted() {
  678. if (!this.width) {
  679. this.w = this.$el.parentElement.clientWidth;
  680. } else if (this.width !== "auto") {
  681. typeof this.width !== "number" && (this.w = this.$el.clientWidth);
  682. }
  683. if (!this.height) {
  684. this.h = this.$el.parentElement.clientHeight;
  685. } else if (this.height !== "auto") {
  686. typeof this.height !== "number" && (this.h = this.$el.clientHeight);
  687. }
  688. typeof this.left !== "number" && (this.l = this.$el.offsetLeft - this.$el.parentElement.offsetLeft);
  689. typeof this.top !== "number" && (this.t = this.$el.offsetTop - this.$el.parentElement.offsetTop);
  690. this.minW && this.w < this.minW && (this.w = this.minW);
  691. this.minH && this.h < this.minH && (this.h = this.minH);
  692. this.maxW && this.w > this.maxW && (this.w = this.maxW);
  693. this.maxH && this.h > this.maxH && (this.h = this.maxH);
  694. this.setMaximize(this.maximize);
  695. this.setupDragElements(this.dragSelector);
  696. this.disableAttributes.forEach(attr => {
  697. switch (attr) {
  698. case "l":
  699. this.calcMap &= ~CALC_MASK.l;
  700. break;
  701. case "t":
  702. this.calcMap &= ~CALC_MASK.t;
  703. break;
  704. case "w":
  705. this.calcMap &= ~CALC_MASK.w;
  706. break;
  707. case "h":
  708. this.calcMap &= ~CALC_MASK.h;
  709. }
  710. });
  711. document.documentElement.addEventListener("mousemove", this.handleMove, true);
  712. document.documentElement.addEventListener("mousedown", this.handleDown, true);
  713. document.documentElement.addEventListener("mouseup", this.handleUp, true);
  714. document.documentElement.addEventListener("touchmove", this.handleMove, true);
  715. document.documentElement.addEventListener("touchstart", this.handleDown, true);
  716. document.documentElement.addEventListener("touchend", this.handleUp, true);
  717. this.emitEvent("mount");
  718. },
  719. beforeUnmount() {
  720. document.documentElement.removeEventListener("mousemove", this.handleMove, true);
  721. document.documentElement.removeEventListener("mousedown", this.handleDown, true);
  722. document.documentElement.removeEventListener("mouseup", this.handleUp, true);
  723. document.documentElement.removeEventListener("touchmove", this.handleMove, true);
  724. document.documentElement.removeEventListener("touchstart", this.handleDown, true);
  725. document.documentElement.removeEventListener("touchend", this.handleUp, true);
  726. this.emitEvent("destroy");
  727. },
  728. methods: {
  729. setMaximize(value) {
  730. const parentEl = this.$el.parentElement;
  731. if (value) {
  732. this.prevState = {
  733. w: this.w,
  734. h: this.h,
  735. l: this.l,
  736. t: this.t
  737. };
  738. this.t = this.l = 0;
  739. this.w = parentEl.clientWidth;
  740. this.h = parentEl.clientHeight;
  741. } else {
  742. this.restoreSize();
  743. }
  744. },
  745. restoreSize() {
  746. if (this.prevState) {
  747. this.l = this.prevState.l;
  748. this.t = this.prevState.t;
  749. this.h = this.prevState.h;
  750. this.w = this.prevState.w;
  751. }
  752. },
  753. setupDragElements(selector) {
  754. const oldList = this.$el.querySelectorAll(".drag-el");
  755. oldList.forEach(el => {
  756. el.classList.remove("drag-el");
  757. });
  758. const nodeList = this.$el.querySelectorAll(selector);
  759. nodeList.forEach(el => {
  760. el.classList.add("drag-el");
  761. });
  762. this.dragElements = Array.prototype.slice.call(nodeList);
  763. },
  764. emitEvent(eventName, additionalOptions) {
  765. this.$emit(eventName, {
  766. eventName,
  767. left: this.l,
  768. top: this.t,
  769. width: this.w,
  770. height: this.h,
  771. cmp: this,
  772. ...additionalOptions
  773. });
  774. },
  775. handleMove(event) {
  776. if (this.resizeState !== 0) {
  777. if (!this.dragState) {
  778. if (isNaN(this.w)) {
  779. this.w = this.$el.clientWidth;
  780. }
  781. if (isNaN(this.h)) {
  782. this.h = this.$el.clientHeight;
  783. }
  784. }
  785. let eventY, eventX;
  786. if (event.touches && event.touches.length >= 0) {
  787. eventY = event.touches[0].clientY;
  788. eventX = event.touches[0].clientX;
  789. } else {
  790. eventY = event.clientY;
  791. eventX = event.clientX;
  792. }
  793. if (this.maximize && this.prevState) {
  794. const parentWidth = this.parent.width;
  795. const parentHeight = this.parent.height;
  796. this.restoreSize();
  797. this.prevState = undefined;
  798. this.t = eventY > parentHeight / 2 ? parentHeight - this.h : 0;
  799. this.l = eventX > parentWidth / 2 ? parentWidth - this.w : 0;
  800. this.emitEvent("maximize", {
  801. state: false
  802. });
  803. }
  804. let diffX = eventX - this.mouseX + this.offsetX,
  805. diffY = eventY - this.mouseY + this.offsetY;
  806. if (this.$el.getBoundingClientRect) {
  807. const rect = this.$el.getBoundingClientRect();
  808. const scaleX = rect.width / this.$el.offsetWidth || 1;
  809. const scaleY = rect.height / this.$el.offsetHeight || 1;
  810. diffX /= scaleX;
  811. diffY /= scaleY;
  812. }
  813. this.offsetX = this.offsetY = 0;
  814. if (this.resizeState & ELEMENT_MASK["resizable-r"].bit) {
  815. if (!this.dragState && this.w + diffX < this.minW) this.offsetX = diffX - (diffX = this.minW - this.w);else if (!this.dragState && this.maxW && this.w + diffX > this.maxW && (!this.fitParent || this.w + this.l < this.parent.width)) this.offsetX = diffX - (diffX = this.maxW - this.w);else if (this.fitParent && this.l + this.w + diffX > this.parent.width) this.offsetX = diffX - (diffX = this.parent.width - this.l - this.w);
  816. this.calcMap & CALC_MASK.w && (this.w += this.dragState ? 0 : diffX);
  817. }
  818. if (this.resizeState & ELEMENT_MASK["resizable-b"].bit) {
  819. if (!this.dragState && this.h + diffY < this.minH) this.offsetY = diffY - (diffY = this.minH - this.h);else if (!this.dragState && this.maxH && this.h + diffY > this.maxH && (!this.fitParent || this.h + this.t < this.parent.height)) this.offsetY = diffY - (diffY = this.maxH - this.h);else if (this.fitParent && this.t + this.h + diffY > this.parent.height) this.offsetY = diffY - (diffY = this.parent.height - this.t - this.h);
  820. this.calcMap & CALC_MASK.h && (this.h += this.dragState ? 0 : diffY);
  821. }
  822. if (this.resizeState & ELEMENT_MASK["resizable-l"].bit) {
  823. if (!this.dragState && this.w - diffX < this.minW) this.offsetX = diffX - (diffX = this.w - this.minW);else if (!this.dragState && this.maxW && this.w - diffX > this.maxW && this.l >= 0) this.offsetX = diffX - (diffX = this.w - this.maxW);else if (this.fitParent && this.l + diffX < 0) this.offsetX = diffX - (diffX = -this.l);
  824. this.calcMap & CALC_MASK.l && (this.l += diffX);
  825. this.calcMap & CALC_MASK.w && (this.w -= this.dragState ? 0 : diffX);
  826. }
  827. if (this.resizeState & ELEMENT_MASK["resizable-t"].bit) {
  828. if (!this.dragState && this.h - diffY < this.minH) this.offsetY = diffY - (diffY = this.h - this.minH);else if (!this.dragState && this.maxH && this.h - diffY > this.maxH && this.t >= 0) this.offsetY = diffY - (diffY = this.h - this.maxH);else if (this.fitParent && this.t + diffY < 0) this.offsetY = diffY - (diffY = -this.t);
  829. this.calcMap & CALC_MASK.t && (this.t += diffY);
  830. this.calcMap & CALC_MASK.h && (this.h -= this.dragState ? 0 : diffY);
  831. }
  832. this.mouseX = eventX;
  833. this.mouseY = eventY;
  834. const eventName = !this.dragState ? "resize:move" : "drag:move";
  835. this.emitEvent(eventName);
  836. }
  837. },
  838. handleDown(event) {
  839. if (event.target.closest && event.target.closest(".resizable-component") !== this.$refs["parent"]) return;
  840. for (let elClass in ELEMENT_MASK) {
  841. if (this.$el.contains(event.target) && (event.target.closest && event.target.closest(`.${elClass}`) || event.target.classList.contains(elClass))) {
  842. elClass === "drag-el" && (this.dragState = true);
  843. document.body.style.cursor = ELEMENT_MASK[elClass].cursor;
  844. if (event.touches && event.touches.length >= 1) {
  845. this.mouseX = event.touches[0].clientX;
  846. this.mouseY = event.touches[0].clientY;
  847. } else {
  848. event.preventDefault && event.preventDefault();
  849. this.mouseX = event.clientX;
  850. this.mouseY = event.clientY;
  851. }
  852. this.offsetX = this.offsetY = 0;
  853. this.resizeState = ELEMENT_MASK[elClass].bit;
  854. this.parent.height = this.$el.parentElement.clientHeight;
  855. this.parent.width = this.$el.parentElement.clientWidth;
  856. const eventName = !this.dragState ? "resize:start" : "drag:start";
  857. this.emitEvent(eventName);
  858. break;
  859. }
  860. }
  861. },
  862. handleUp() {
  863. if (this.resizeState !== 0) {
  864. this.resizeState = 0;
  865. document.body.style.cursor = "";
  866. const eventName = !this.dragState ? "resize:end" : "drag:end";
  867. this.emitEvent(eventName);
  868. this.dragState = false;
  869. }
  870. }
  871. }
  872. });
  873. ;// CONCATENATED MODULE: ./src/components/vue-resizable.vue?vue&type=script&lang=js
  874. // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/vue-resizable.vue?vue&type=style&index=0&id=3de5149f&scoped=true&lang=css
  875. var vue_resizablevue_type_style_index_0_id_3de5149f_scoped_true_lang_css = __webpack_require__(29);
  876. ;// CONCATENATED MODULE: ./src/components/vue-resizable.vue?vue&type=style&index=0&id=3de5149f&scoped=true&lang=css
  877. // EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
  878. var exportHelper = __webpack_require__(620);
  879. ;// CONCATENATED MODULE: ./src/components/vue-resizable.vue
  880. ;
  881. const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(vue_resizablevue_type_script_lang_js, [['render',render],['__scopeId',"data-v-3de5149f"]])
  882. /* harmony default export */ var vue_resizable = (__exports__);
  883. ;// CONCATENATED MODULE: ./src/main.js
  884. /* harmony default export */ var main = (vue_resizable);
  885. ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  886. /* harmony default export */ var entry_lib = (main);
  887. }();
  888. /******/ return __webpack_exports__;
  889. /******/ })()
  890. ;
  891. });
  892. //# sourceMappingURL=vue-resizable.umd.js.map