(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("vue")); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["vue-flowchart"] = factory(require("vue")); else root["vue-flowchart"] = factory(root["Vue"]); })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "fb15"); /******/ }) /************************************************************************/ /******/ ({ /***/ "00ee": /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__("b622"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), /***/ "0366": /***/ (function(module, exports, __webpack_require__) { var aFunction = __webpack_require__("1c0b"); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /***/ "057f": /***/ (function(module, exports, __webpack_require__) { var toIndexedObject = __webpack_require__("fc6a"); var nativeGetOwnPropertyNames = __webpack_require__("241c").f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return nativeGetOwnPropertyNames(it); } catch (error) { return windowNames.slice(); } }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it)); }; /***/ }), /***/ "06cf": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("83ab"); var propertyIsEnumerableModule = __webpack_require__("d1e7"); var createPropertyDescriptor = __webpack_require__("5c6c"); var toIndexedObject = __webpack_require__("fc6a"); var toPrimitive = __webpack_require__("c04e"); var has = __webpack_require__("5135"); var IE8_DOM_DEFINE = __webpack_require__("0cfb"); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; /***/ }), /***/ "0cfb": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("83ab"); var fails = __webpack_require__("d039"); var createElement = __webpack_require__("cc12"); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /***/ "159b": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("da84"); var DOMIterables = __webpack_require__("fdbc"); var forEach = __webpack_require__("17c2"); var createNonEnumerableProperty = __webpack_require__("9112"); for (var COLLECTION_NAME in DOMIterables) { var Collection = global[COLLECTION_NAME]; var CollectionPrototype = Collection && Collection.prototype; // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); } catch (error) { CollectionPrototype.forEach = forEach; } } /***/ }), /***/ "17c2": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $forEach = __webpack_require__("b727").forEach; var arrayMethodIsStrict = __webpack_require__("a640"); var arrayMethodUsesToLength = __webpack_require__("ae40"); var STRICT_METHOD = arrayMethodIsStrict('forEach'); var USES_TO_LENGTH = arrayMethodUsesToLength('forEach'); // `Array.prototype.forEach` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.foreach module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } : [].forEach; /***/ }), /***/ "1be4": /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__("d066"); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /***/ "1c0b": /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; /***/ }), /***/ "1c7e": /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__("b622"); var ITERATOR = wellKnownSymbol('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR] = function () { return this; }; // eslint-disable-next-line no-throw-literal Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { /* empty */ } module.exports = function (exec, SKIP_CLOSING) { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; var ITERATION_SUPPORT = false; try { var object = {}; object[ITERATOR] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { /* empty */ } return ITERATION_SUPPORT; }; /***/ }), /***/ "1d80": /***/ (function(module, exports) { // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /***/ "1dde": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("d039"); var wellKnownSymbol = __webpack_require__("b622"); var V8_VERSION = __webpack_require__("2d00"); var SPECIES = wellKnownSymbol('species'); module.exports = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 return V8_VERSION >= 51 || !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; /***/ }), /***/ "23cb": /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__("a691"); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /***/ "23e7": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("da84"); var getOwnPropertyDescriptor = __webpack_require__("06cf").f; var createNonEnumerableProperty = __webpack_require__("9112"); var redefine = __webpack_require__("6eeb"); var setGlobal = __webpack_require__("ce4e"); var copyConstructorProperties = __webpack_require__("e893"); var isForced = __webpack_require__("94ca"); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; /***/ }), /***/ "241c": /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__("ca84"); var enumBugKeys = __webpack_require__("7839"); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /***/ "24fb": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader // eslint-disable-next-line func-names module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return "@media ".concat(item[2], " {").concat(content, "}"); } return content; }).join(''); }; // import a list of modules into the list // eslint-disable-next-line func-names list.i = function (modules, mediaQuery) { if (typeof modules === 'string') { // eslint-disable-next-line no-param-reassign modules = [[null, modules, '']]; } for (var i = 0; i < modules.length; i++) { var item = [].concat(modules[i]); if (mediaQuery) { if (!item[2]) { item[2] = mediaQuery; } else { item[2] = "".concat(mediaQuery, " and ").concat(item[2]); } } list.push(item); } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */"); }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); return "/*# ".concat(data, " */"); } /***/ }), /***/ "25f0": /***/ (function(module, exports, __webpack_require__) { "use strict"; var redefine = __webpack_require__("6eeb"); var anObject = __webpack_require__("825a"); var fails = __webpack_require__("d039"); var flags = __webpack_require__("ad6d"); var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { redefine(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); var p = String(R.source); var rf = R.flags; var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); return '/' + p + '/' + f; }, { unsafe: true }); } /***/ }), /***/ "2d00": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("da84"); var userAgent = __webpack_require__("342f"); var process = global.process; var versions = process && process.versions; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); version = match[0] + match[1]; } else if (userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = match[1]; } } module.exports = version && +version; /***/ }), /***/ "342f": /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__("d066"); module.exports = getBuiltIn('navigator', 'userAgent') || ''; /***/ }), /***/ "35a1": /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__("f5df"); var Iterators = __webpack_require__("3f8c"); var wellKnownSymbol = __webpack_require__("b622"); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }), /***/ "37e8": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("83ab"); var definePropertyModule = __webpack_require__("9bf2"); var anObject = __webpack_require__("825a"); var objectKeys = __webpack_require__("df75"); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); return O; }; /***/ }), /***/ "3bbe": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("861d"); module.exports = function (it) { if (!isObject(it) && it !== null) { throw TypeError("Can't set " + String(it) + ' as a prototype'); } return it; }; /***/ }), /***/ "3ca3": /***/ (function(module, exports, __webpack_require__) { "use strict"; var charAt = __webpack_require__("6547").charAt; var InternalStateModule = __webpack_require__("69f3"); var defineIterator = __webpack_require__("7dd0"); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: String(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); /***/ }), /***/ "3f8c": /***/ (function(module, exports) { module.exports = {}; /***/ }), /***/ "4160": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("23e7"); var forEach = __webpack_require__("17c2"); // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach $({ target: 'Array', proto: true, forced: [].forEach != forEach }, { forEach: forEach }); /***/ }), /***/ "428f": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("da84"); module.exports = global; /***/ }), /***/ "44ad": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("d039"); var classof = __webpack_require__("c6b6"); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; /***/ }), /***/ "44d2": /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__("b622"); var create = __webpack_require__("7c73"); var definePropertyModule = __webpack_require__("9bf2"); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), /***/ "4930": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("d039"); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); /***/ }), /***/ "499e": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/listToStyles.js /** * Translates the list format produced by css-loader into something * easier to manipulate. */ function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles } // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/addStylesClient.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addStylesClient; }); /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ var hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } /* type StyleObject = { id: number; parts: Array } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ var stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) var singletonElement = null var singletonCounter = 0 var isProduction = false var noop = function () {} var options = null var ssrIdKey = 'data-vue-ssr-id' // Force single-tag solution on IE6-9, which has a hard limit on the # of \n "); return styles; } } }); // CONCATENATED MODULE: ./src/components/AppStyle.vue?vue&type=script&lang=js& /* harmony default export */ var components_AppStylevue_type_script_lang_js_ = (AppStylevue_type_script_lang_js_); // CONCATENATED MODULE: ./src/components/AppStyle.vue /* normalize component */ var AppStyle_component = normalizeComponent( components_AppStylevue_type_script_lang_js_, AppStylevue_type_template_id_cb4a0590_lang_pug_render, AppStylevue_type_template_id_cb4a0590_lang_pug_staticRenderFns, false, null, null, null ) /* harmony default export */ var AppStyle = (AppStyle_component.exports); // CONCATENATED MODULE: ./src/helpers/port-position.js var portPosition = { getPortTop: getPortTop, getPortRight: getPortRight, getPortBottom: getPortBottom, getPortLeft: getPortLeft }; function getHeight(nodeType) { var height = 0; switch (nodeType) { case 'button': height = HEIGHT_OF_BUTTON_NODE; break; default: height = HEIGHT_OF_TEXT_NODE; } return height; } function getPortTop(cx, cy, type) { var x, y; var h = getHeight(type); x = cx; y = cy - h / 2; return [x, y]; } function getPortRight(cx, cy, type) { var x, y; var w = WIDTH_OF_NODE; x = cx + w / 2; y = cy; return [x, y]; } function getPortBottom(cx, cy, type) { var x, y; var h = getHeight(type); x = cx; y = cy + h / 2; return [x, y]; } function getPortLeft(cx, cy, type) { var x, y; var w = WIDTH_OF_NODE; x = cx - w / 2; y = cy; return [x, y]; } // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FlowChart.vue?vue&type=script&lang=js& function FlowChartvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function FlowChartvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { FlowChartvue_type_script_lang_js_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { FlowChartvue_type_script_lang_js_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var FlowChartvue_type_script_lang_js_ = ({ name: 'FlowChart', components: { TextNode: TextNode, ButtonNode: ButtonNode, Node: Node, Link: Link, AppStyle: AppStyle }, props: { options: { type: Object, default: function _default() { return {}; } }, nodes: { type: Array }, links: { type: Array } }, data: function data() { return { defaultOptions: { nodeBdColor: '#6188F3', optionsItemBgColor: '#05E839', optionsItemColor: '#FFFFFF', nodePortColor: '#FFDF10', nodePortSize: 14, linksColor: '#FF1500', nodeBgColor: '#FFFFFF', iconDeleteNodeColor: '#FF7216', iconDeleteNodeBdColor: '#FF7216', disableHoverLink: false }, activeClass: [], action: { linking: false, dragging: false, scrolling: false, selected: 0 }, mouse: { x: 0, y: 0, shiftX: 0, shiftY: 0 }, scroll: { x: 0, y: 0 }, draggingLink: null, nodeActive: null, linkActive: [], selectedLink: null }; }, computed: { optionsMain: function optionsMain() { return FlowChartvue_type_script_lang_js_objectSpread({}, this.defaultOptions, {}, this.options); }, lines: function lines() { var _this = this; var linkActive = this.linkActive; var lines = this.links.map(function (link) { var start = []; var end = []; var fromNode = _this.findNodeWithId(link.from); var toNode = _this.findNodeWithId(link.to); // phân vùng // const lF = fromNode.centerX - fromNode.width / 2 // const rF = fromNode.centerX + fromNode.width / 2 // const tF = fromNode.centerY - fromNode.height / 2 // const bF = fromNode.centerY + fromNode.height / 2 var shiftX = fromNode.centerX - toNode.centerX; var shiftY = fromNode.centerY - toNode.centerY; // if (toNode.centerX + toNode.width / 2 <= lF) { // start = [...portPosition.getPortLeft(fromNode.centerX, fromNode.centerY, fromNode.width, fromNode.height)] // end = [...portPosition.getPortRight(toNode.centerX, toNode.centerY, toNode.width, toNode.height)] // } // if (toNode.centerX - toNode.width / 2 >= rF) { // start = [...portPosition.getPortRight(fromNode.centerX, fromNode.centerY, fromNode.width, fromNode.height)] // end = [...portPosition.getPortLeft(toNode.centerX, toNode.centerY, toNode.width, toNode.height)] // } // if (toNode.centerY + toNode.height / 2 <= tF) { // start = [...portPosition.getPortTop(fromNode.centerX, fromNode.centerY, fromNode.width, fromNode.height)] // end = [...portPosition.getPortBottom(toNode.centerX, toNode.centerY, toNode.width, toNode.height)] // } // if (toNode.centerY - toNode.height / 2 >= bF) { // start = [...portPosition.getPortBottom(fromNode.centerX, fromNode.centerY, fromNode.width, fromNode.height)] // end = [...portPosition.getPortTop(toNode.centerX, toNode.centerY, toNode.width, toNode.height)] // } if (shiftX < 0 && shiftY < 0) { start = _toConsumableArray(portPosition.getPortBottom(fromNode.centerX, fromNode.centerY, fromNode.type)); end = _toConsumableArray(portPosition.getPortTop(toNode.centerX, toNode.centerY, toNode.type)); } if (shiftX < 0 && shiftY > 0) { start = _toConsumableArray(portPosition.getPortRight(fromNode.centerX, fromNode.centerY, fromNode.type)); end = _toConsumableArray(portPosition.getPortLeft(toNode.centerX, toNode.centerY, toNode.type)); } if (shiftX > 0 && shiftY < 0) { start = _toConsumableArray(portPosition.getPortBottom(fromNode.centerX, fromNode.centerY, fromNode.type)); end = _toConsumableArray(portPosition.getPortTop(toNode.centerX, toNode.centerY, toNode.type)); } if (shiftX > 0 && shiftY > 0) { start = _toConsumableArray(portPosition.getPortLeft(fromNode.centerX, fromNode.centerY, fromNode.type)); end = _toConsumableArray(portPosition.getPortRight(toNode.centerX, toNode.centerY, toNode.type)); } // check link active var active = false; if (linkActive.length) { var flag = linkActive.findIndex(function (e) { return e.id === link.id; }); if (flag > -1) { active = true; } } return { start: start, end: end, id: link.id, active: active }; }); return lines; } }, watch: { links: 'setLinkActive' }, created: function created() { event_bus.$on('select-btn-node-option', this.selectOption); }, beforeDestroy: function beforeDestroy() { event_bus.$off('select-btn-node-option'); }, methods: { selectOption: function selectOption(event) { var linkSelected = this.links.find(function (e) { return e.from === event.parentNodeId && e.option === event.option; }); if (linkSelected) { this.selectedLink = linkSelected.id; } else { this.selectedLink = null; } this.$emit('optionSelected', event); }, linkSelected: function linkSelected(e, id) { this.selectedLink = id; this.$emit('linkSelected', id); }, findNodeWithId: function findNodeWithId(id) { return this.nodes.find(function (item) { return id === item.id; }); }, nodeSelected: function nodeSelected(e, id, index) { this.selectedLink = null; this.nodeActive = id; this.setLinkActive(); var nodeSelected = document.getElementById("qkfc-node-".concat(id)); var listNode = document.getElementsByClassName('qkfc-node'); // deactive node others listNode.forEach(function (e) { e.classList.remove('qkfc-node--active'); }); // active node nodeSelected.classList.add('qkfc-node--active'); this.$emit('nodeSelected', id); }, startDragNode: function startDragNode(id, _ref) { var shiftX = _ref.shiftX, shiftY = _ref.shiftY; this.action.dragging = id; this.mouse.shiftX = shiftX; this.mouse.shiftY = shiftY; }, startDragLink: function startDragLink(id, _ref2) { var sx = _ref2.sx, sy = _ref2.sy, index = _ref2.index; this.action.linking = true; this.mouse.x = sx + Math.floor(this.$el.scrollLeft) - this.$el.getBoundingClientRect().left; this.mouse.y = sy + Math.floor(this.$el.scrollTop) - this.$el.getBoundingClientRect().top; this.nodeActive = id; this.draggingLink = { from: id, option: index, sx: sx + Math.floor(this.$el.scrollLeft) - this.$el.getBoundingClientRect().left, sy: sy + Math.floor(this.$el.scrollTop) - this.$el.getBoundingClientRect().top }; }, handleMove: function handleMove(e) { if (this.action.linking) { this.mouse.x = e.clientX + Math.floor(this.$el.scrollLeft) - this.$el.getBoundingClientRect().left; this.mouse.y = e.clientY + Math.floor(this.$el.scrollTop) - this.$el.getBoundingClientRect().top; } if (this.action.dragging) { this.mouse.x = e.clientX; this.mouse.y = e.clientY; var dx = this.mouse.x - this.mouse.shiftX; var dy = this.mouse.y - this.mouse.shiftY; this.moveSelectedNode(dx, dy); } if (this.action.scrolling) { this.mouse.x = e.clientX; this.mouse.y = e.clientY; } }, handleUp: function handleUp(e) { if (this.action.dragging) { var x = this.mouse.x - this.mouse.shiftX; var y = this.mouse.y - this.mouse.shiftY; var id = this.action.dragging; this.$emit('updatePositionNode', { id: id, x: x, y: y }); } if (this.action.linking && this.draggingLink.to && this.draggingLink.to !== this.draggingLink.from) { var _this$draggingLink = this.draggingLink, from = _this$draggingLink.from, option = _this$draggingLink.option, to = _this$draggingLink.to; var link = this.links.find(function (e) { return e.from === from && e.option === option; }); if (link) { this.$emit('editLink', { to: to, id: link.id, from: from, option: option }); } else { this.$emit('addLink', { from: from, option: option, to: to }); } } this.action.linking = false; this.action.dragging = null; this.action.scrolling = false; }, handleDown: function handleDown() { this.action.scrolling = true; }, moveSelectedNode: function moveSelectedNode(dx, dy) { var _this2 = this; var index = this.nodes.findIndex(function (item) { return item.id === _this2.action.dragging; }); this.$set(this.nodes, index, Object.assign(this.nodes[index], { centerX: dx, centerY: dy })); }, setLinkActive: function setLinkActive() { var _this3 = this; if (this.nodeActive) { if (this.links.length) { this.linkActive = this.links.filter(function (e) { return e.from === _this3.nodeActive || e.to === _this3.nodeActive; }); } } }, dragTarget: function dragTarget(e) { if (this.action.linking && this.draggingLink && e.id) { this.draggingLink = Object.assign({}, this.draggingLink, { to: e.id }); } }, deleteLink: function deleteLink(id) { // this.links = this.links.filter(e => e.id !== id) this.$emit('linkDeleted', id); }, deleteNode: function deleteNode(id) { // this.nodes = this.nodes.filter(e => e.id !== id) // this.links = this.links.filter((link) => { // return link.from !== id && link.to !== id // }) this.$emit('nodeDeleted', id); } } }); // CONCATENATED MODULE: ./src/components/FlowChart.vue?vue&type=script&lang=js& /* harmony default export */ var components_FlowChartvue_type_script_lang_js_ = (FlowChartvue_type_script_lang_js_); // EXTERNAL MODULE: ./src/assets/scss/_app.scss?vue&type=style&index=0&lang=scss& var _appvue_type_style_index_0_lang_scss_ = __webpack_require__("de67"); // CONCATENATED MODULE: ./src/components/FlowChart.vue /* normalize component */ var FlowChart_component = normalizeComponent( components_FlowChartvue_type_script_lang_js_, FlowChartvue_type_template_id_e8c0cbec_lang_pug_render, staticRenderFns, false, null, null, null ) /* harmony default export */ var FlowChart = (FlowChart_component.exports); // CONCATENATED MODULE: ./src/vue-flowchart.js var VueFlowChart = FlowChart; var Plugin = { install: function install(Vue, options) { Vue.component('VueFlowChart', FlowChart); } }; /* harmony default export */ var vue_flowchart = (Plugin); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js /* concated harmony reexport VueFlowChart */__webpack_require__.d(__webpack_exports__, "VueFlowChart", function() { return VueFlowChart; }); /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (vue_flowchart); /***/ }), /***/ "fc6a": /***/ (function(module, exports, __webpack_require__) { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__("44ad"); var requireObjectCoercible = __webpack_require__("1d80"); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /***/ "fdbc": /***/ (function(module, exports) { // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods module.exports = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 }; /***/ }), /***/ "fdbf": /***/ (function(module, exports, __webpack_require__) { var NATIVE_SYMBOL = __webpack_require__("4930"); module.exports = NATIVE_SYMBOL // eslint-disable-next-line no-undef && !Symbol.sham // eslint-disable-next-line no-undef && typeof Symbol.iterator == 'symbol'; /***/ }) /******/ }); });