vue-resizable.common.js 34 KB

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