1 line
95 KiB
Plaintext
1 line
95 KiB
Plaintext
![]() |
{"version":3,"file":"vue-easy-dnd.min.js","sources":["../src/vue-easy-dnd.js"],"sourcesContent":["/* eslint-disable */\r\n/*eslint no-unused-vars: \"off\" */\r\n/* Miqra Engineering: (c) 2020 added modifications to work as es6 module and preserve vue tag names during minification\r\n*/\r\nimport './reflect-metadata';\r\nimport { Vue, Component, Prop } from './vue-property-decorator';\r\n\r\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\n/**\r\n * This is the class of the global object that holds the state of the drag and drop during its progress. It emits events\r\n * reporting its state evolution during the progress of the drag and drop. Its data is reactive and listeners can be\r\n * attachted to it using the method on.\r\n */\r\nvar DnD = function DnD() {\r\n this.inProgress = false;\r\n this.type = null;\r\n this.data = null;\r\n this.source = null;\r\n this.top = null;\r\n this.position = null;\r\n this.eventBus = new Vue();\r\n this.sourceListeners = null;\r\n this.success = null;\r\n};\r\nDnD.prototype.startDrag = function startDrag (source, event, x, y, type, data) {\r\n this.type = type;\r\n this.data = data;\r\n this.source = source;\r\n this.position = {\r\n x: x,\r\n y: y\r\n };\r\n this.top = null;\r\n this.sourceListeners = source.$listeners;\r\n this.inProgress = true;\r\n this.emit(event, \"dragstart\");\r\n this.emit(event, \"dragtopchanged\", { previousTop: null });\r\n};\r\nDnD.prototype.stopDrag = function stopDrag (event) {\r\n this.success = this.top !== null && this.top['compatibleMode'] && this.top['dropAllowed'];\r\n if (this.top !== null) {\r\n this.emit(event, \"drop\");\r\n }\r\n this.emit(event, \"dragend\");\r\n this.inProgress = false;\r\n this.data = null;\r\n this.source = null;\r\n this.position = null;\r\n this.success = null;\r\n};\r\nDnD.prototype.mouseMove = function mouseMove (event, comp) {\r\n if (this.inProgress) {\r\n var prevent = false;\r\n var previousTop = this.top;\r\n if (comp === null) {\r\n // The mouse move event reached the top of the document without hitting a drop component.\r\n this.top = null;\r\n prevent = true;\r\n }\r\n else if (comp['isDropMask']) {\r\n // The mouse move event bubbled until it reached a drop mask.\r\n this.top = null;\r\n prevent = true;\r\n }\r\n else if (comp['candidate'](this.ty
|