UNPKG

97.2 kBSource Map (JSON)View Raw
1{"version":3,"file":"angular-draggable-droppable.umd.min.js","sources":["../../../node_modules/@mattlewis92/dom-autoscroller/dist/bundle.es.js","node_modules/tslib/tslib.es6.js","ng:/angular-draggable-droppable/lib/draggable-helper.provider.ts","ng:/angular-draggable-droppable/lib/draggable-scroll-container.directive.ts","ng:/angular-draggable-droppable/lib/util.ts","ng:/angular-draggable-droppable/lib/draggable.directive.ts","ng:/angular-draggable-droppable/lib/droppable.directive.ts","ng:/angular-draggable-droppable/lib/drag-and-drop.module.ts"],"sourcesContent":["function getDef(f, d) {\n if (typeof f === 'undefined') {\n return typeof d === 'undefined' ? f : d;\n }\n\n return f;\n}\nfunction boolean(func, def) {\n\n func = getDef(func, def);\n\n if (typeof func === 'function') {\n return function f() {\n var arguments$1 = arguments;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments$1[_key];\n }\n\n return !!func.apply(this, args);\n };\n }\n\n return !!func ? function () {\n return true;\n } : function () {\n return false;\n };\n}\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n/**\n * Returns `true` if provided input is Element.\n * @name isElement\n * @param {*} [input]\n * @returns {boolean}\n */\nvar isElement$1 = function (input) {\n return input != null && (typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && input.nodeType === 1 && _typeof(input.style) === 'object' && _typeof(input.ownerDocument) === 'object';\n};\n\nfunction indexOfElement(elements, element){\n element = resolveElement(element, true);\n if(!isElement$1(element)) { return -1; }\n for(var i=0; i<elements.length; i++){\n if(elements[i] === element){\n return i;\n }\n }\n return -1;\n}\n\nfunction hasElement(elements, element){\n return -1 !== indexOfElement(elements, element);\n}\n\nfunction pushElements(elements, toAdd){\n\n for(var i=0; i<toAdd.length; i++){\n if(!hasElement(elements, toAdd[i]))\n { elements.push(toAdd[i]); }\n }\n\n return toAdd;\n}\n\nfunction addElements(elements){\n var arguments$1 = arguments;\n\n var toAdd = [], len = arguments.length - 1;\n while ( len-- > 0 ) { toAdd[ len ] = arguments$1[ len + 1 ]; }\n\n toAdd = toAdd.map(resolveElement);\n return pushElements(elements, toAdd);\n}\n\nfunction removeElements(elements){\n var arguments$1 = arguments;\n\n var toRemove = [], len = arguments.length - 1;\n while ( len-- > 0 ) { toRemove[ len ] = arguments$1[ len + 1 ]; }\n\n return toRemove.map(resolveElement).reduce(function (last, e){\n\n var index = indexOfElement(elements, e);\n\n if(index !== -1)\n { return last.concat(elements.splice(index, 1)); }\n return last;\n }, []);\n}\n\nfunction resolveElement(element, noThrow){\n if(typeof element === 'string'){\n try{\n return document.querySelector(element);\n }catch(e){\n throw e;\n }\n\n }\n\n if(!isElement$1(element) && !noThrow){\n throw new TypeError((element + \" is not a DOM element.\"));\n }\n return element;\n}\n\nfunction createPointCB(object, options) {\n\n // A persistent object (as opposed to returned object) is used to save memory\n // This is good to prevent layout thrashing, or for games, and such\n\n // NOTE\n // This uses IE fixes which should be OK to remove some day. :)\n // Some speed will be gained by removal of these.\n\n // pointCB should be saved in a variable on return\n // This allows the usage of element.removeEventListener\n\n options = options || {};\n\n var allowUpdate = boolean(options.allowUpdate, true);\n\n /*if(typeof options.allowUpdate === 'function'){\n allowUpdate = options.allowUpdate;\n }else{\n allowUpdate = function(){return true;};\n }*/\n\n return function pointCB(event) {\n\n event = event || window.event; // IE-ism\n object.target = event.target || event.srcElement || event.originalTarget;\n object.element = this;\n object.type = event.type;\n\n if (!allowUpdate(event)) {\n return;\n }\n\n // Support touch\n // http://www.creativebloq.com/javascript/make-your-site-work-touch-devices-51411644\n\n if (event.targetTouches) {\n object.x = event.targetTouches[0].clientX;\n object.y = event.targetTouches[0].clientY;\n object.pageX = event.targetTouches[0].pageX;\n object.pageY = event.targetTouches[0].pageY;\n object.screenX = event.targetTouches[0].screenX;\n object.screenY = event.targetTouches[0].screenY;\n } else {\n\n // If pageX/Y aren't available and clientX/Y are,\n // calculate pageX/Y - logic taken from jQuery.\n // (This is to support old IE)\n // NOTE Hopefully this can be removed soon.\n\n if (event.pageX === null && event.clientX !== null) {\n var eventDoc = event.target && event.target.ownerDocument || document;\n var doc = eventDoc.documentElement;\n var body = eventDoc.body;\n\n object.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n object.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n } else {\n object.pageX = event.pageX;\n object.pageY = event.pageY;\n }\n\n // pageX, and pageY change with page scroll\n // so we're not going to use those for x, and y.\n // NOTE Most browsers also alias clientX/Y with x/y\n // so that's something to consider down the road.\n\n object.x = event.clientX;\n object.y = event.clientY;\n\n object.screenX = event.screenX;\n object.screenY = event.screenY;\n }\n\n object.clientX = object.x;\n object.clientY = object.y;\n };\n\n //NOTE Remember accessibility, Aria roles, and labels.\n}\n\nfunction createWindowRect() {\n var props = {\n top: { value: 0, enumerable: true },\n left: { value: 0, enumerable: true },\n right: { value: window.innerWidth, enumerable: true },\n bottom: { value: window.innerHeight, enumerable: true },\n width: { value: window.innerWidth, enumerable: true },\n height: { value: window.innerHeight, enumerable: true },\n x: { value: 0, enumerable: true },\n y: { value: 0, enumerable: true }\n };\n\n if (Object.create) {\n return Object.create({}, props);\n } else {\n var rect = {};\n Object.defineProperties(rect, props);\n return rect;\n }\n}\n\nfunction getClientRect(el) {\n if (el === window) {\n return createWindowRect();\n } else {\n try {\n var rect = el.getBoundingClientRect();\n if (rect.x === undefined) {\n rect.x = rect.left;\n rect.y = rect.top;\n }\n return rect;\n } catch (e) {\n throw new TypeError(\"Can't call getBoundingClientRect on \" + el);\n }\n }\n}\n\nfunction pointInside(point, el) {\n var rect = getClientRect(el);\n return point.y > rect.top && point.y < rect.bottom && point.x > rect.left && point.x < rect.right;\n}\n\nvar objectCreate = void 0;\nif (typeof Object.create != 'function') {\n objectCreate = function (undefined$1) {\n var Temp = function Temp() {};\n return function (prototype, propertiesObject) {\n if (prototype !== Object(prototype) && prototype !== null) {\n throw TypeError('Argument must be an object, or null');\n }\n Temp.prototype = prototype || {};\n var result = new Temp();\n Temp.prototype = null;\n if (propertiesObject !== undefined$1) {\n Object.defineProperties(result, propertiesObject);\n }\n\n // to imitate the case of Object.create(null)\n if (prototype === null) {\n result.__proto__ = null;\n }\n return result;\n };\n }();\n} else {\n objectCreate = Object.create;\n}\n\nvar objectCreate$1 = objectCreate;\n\nvar mouseEventProps = ['altKey', 'button', 'buttons', 'clientX', 'clientY', 'ctrlKey', 'metaKey', 'movementX', 'movementY', 'offsetX', 'offsetY', 'pageX', 'pageY', 'region', 'relatedTarget', 'screenX', 'screenY', 'shiftKey', 'which', 'x', 'y'];\n\nfunction createDispatcher(element) {\n\n var defaultSettings = {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0,\n ctrlKey: false,\n shiftKey: false,\n altKey: false,\n metaKey: false,\n button: 0,\n buttons: 1,\n relatedTarget: null,\n region: null\n };\n\n if (element !== undefined) {\n element.addEventListener('mousemove', onMove);\n }\n\n function onMove(e) {\n for (var i = 0; i < mouseEventProps.length; i++) {\n defaultSettings[mouseEventProps[i]] = e[mouseEventProps[i]];\n }\n }\n\n var dispatch = function () {\n if (MouseEvent) {\n return function m1(element, initMove, data) {\n var evt = new MouseEvent('mousemove', createMoveInit(defaultSettings, initMove));\n\n //evt.dispatched = 'mousemove';\n setSpecial(evt, data);\n\n return element.dispatchEvent(evt);\n };\n } else if (typeof document.createEvent === 'function') {\n return function m2(element, initMove, data) {\n var settings = createMoveInit(defaultSettings, initMove);\n var evt = document.createEvent('MouseEvents');\n\n evt.initMouseEvent(\"mousemove\", true, //can bubble\n true, //cancelable\n window, //view\n 0, //detail\n settings.screenX, //0, //screenX\n settings.screenY, //0, //screenY\n settings.clientX, //80, //clientX\n settings.clientY, //20, //clientY\n settings.ctrlKey, //false, //ctrlKey\n settings.altKey, //false, //altKey\n settings.shiftKey, //false, //shiftKey\n settings.metaKey, //false, //metaKey\n settings.button, //0, //button\n settings.relatedTarget //null //relatedTarget\n );\n\n //evt.dispatched = 'mousemove';\n setSpecial(evt, data);\n\n return element.dispatchEvent(evt);\n };\n } else if (typeof document.createEventObject === 'function') {\n return function m3(element, initMove, data) {\n var evt = document.createEventObject();\n var settings = createMoveInit(defaultSettings, initMove);\n for (var name in settings) {\n evt[name] = settings[name];\n }\n\n //evt.dispatched = 'mousemove';\n setSpecial(evt, data);\n\n return element.dispatchEvent(evt);\n };\n }\n }();\n\n function destroy() {\n if (element) { element.removeEventListener('mousemove', onMove, false); }\n defaultSettings = null;\n }\n\n return {\n destroy: destroy,\n dispatch: dispatch\n };\n}\n\nfunction createMoveInit(defaultSettings, initMove) {\n initMove = initMove || {};\n var settings = objectCreate$1(defaultSettings);\n for (var i = 0; i < mouseEventProps.length; i++) {\n if (initMove[mouseEventProps[i]] !== undefined) { settings[mouseEventProps[i]] = initMove[mouseEventProps[i]]; }\n }\n\n return settings;\n}\n\nfunction setSpecial(e, data) {\n console.log('data ', data);\n e.data = data || {};\n e.dispatched = 'mousemove';\n}\n\nvar prefix = [ 'webkit', 'moz', 'ms', 'o' ];\n\nvar requestFrame = (function () {\n\n if (typeof window === \"undefined\") {\n return function () {};\n }\n\n for ( var i = 0, limit = prefix.length ; i < limit && ! window.requestAnimationFrame ; ++i ) {\n window.requestAnimationFrame = window[ prefix[ i ] + 'RequestAnimationFrame' ];\n }\n\n if ( ! window.requestAnimationFrame ) {\n var lastTime = 0;\n\n window.requestAnimationFrame = function (callback) {\n var now = new Date().getTime();\n var ttc = Math.max( 0, 16 - now - lastTime );\n var timer = window.setTimeout( function () { return callback( now + ttc ); }, ttc );\n\n lastTime = now + ttc;\n\n return timer;\n };\n }\n\n return window.requestAnimationFrame.bind( window );\n})();\n\nvar cancelFrame = (function () {\n\n if (typeof window === \"undefined\") {\n return function () {};\n }\n\n for ( var i = 0, limit = prefix.length ; i < limit && ! window.cancelAnimationFrame ; ++i ) {\n window.cancelAnimationFrame = window[ prefix[ i ] + 'CancelAnimationFrame' ] || window[ prefix[ i ] + 'CancelRequestAnimationFrame' ];\n }\n\n if ( ! window.cancelAnimationFrame ) {\n window.cancelAnimationFrame = function (timer) {\n window.clearTimeout( timer );\n };\n }\n\n return window.cancelAnimationFrame.bind( window );\n})();\n\nfunction AutoScroller(elements, options){\n if ( options === void 0 ) options = {};\n\n var self = this;\n var maxSpeed = 4, scrolling = false;\n\n if (typeof options.margin !== 'object') {\n var margin = options.margin || -1;\n\n this.margin = {\n left: margin,\n right: margin,\n top: margin,\n bottom: margin\n };\n } else {\n this.margin = options.margin;\n }\n\n //this.scrolling = false;\n this.scrollWhenOutside = options.scrollWhenOutside || false;\n\n var point = {},\n pointCB = createPointCB(point),\n dispatcher = createDispatcher(),\n down = false;\n\n window.addEventListener('mousemove', pointCB, false);\n window.addEventListener('touchmove', pointCB, false);\n\n if(!isNaN(options.maxSpeed)){\n maxSpeed = options.maxSpeed;\n }\n\n if (typeof maxSpeed !== 'object') {\n maxSpeed = {\n left: maxSpeed,\n right: maxSpeed,\n top: maxSpeed,\n bottom: maxSpeed\n };\n }\n\n this.autoScroll = boolean(options.autoScroll);\n this.syncMove = boolean(options.syncMove, false);\n\n this.destroy = function(forceCleanAnimation) {\n window.removeEventListener('mousemove', pointCB, false);\n window.removeEventListener('touchmove', pointCB, false);\n window.removeEventListener('mousedown', onDown, false);\n window.removeEventListener('touchstart', onDown, false);\n window.removeEventListener('mouseup', onUp, false);\n window.removeEventListener('touchend', onUp, false);\n window.removeEventListener('pointerup', onUp, false);\n window.removeEventListener('mouseleave', onMouseOut, false);\n\n window.removeEventListener('mousemove', onMove, false);\n window.removeEventListener('touchmove', onMove, false);\n\n window.removeEventListener('scroll', setScroll, true);\n elements = [];\n if(forceCleanAnimation){\n cleanAnimation();\n }\n };\n\n this.add = function(){\n var element = [], len = arguments.length;\n while ( len-- ) element[ len ] = arguments[ len ];\n\n addElements.apply(void 0, [ elements ].concat( element ));\n return this;\n };\n\n this.remove = function(){\n var element = [], len = arguments.length;\n while ( len-- ) element[ len ] = arguments[ len ];\n\n return removeElements.apply(void 0, [ elements ].concat( element ));\n };\n\n var hasWindow = null, windowAnimationFrame;\n\n if(Object.prototype.toString.call(elements) !== '[object Array]'){\n elements = [elements];\n }\n\n (function(temp){\n elements = [];\n temp.forEach(function(element){\n if(element === window){\n hasWindow = window;\n }else {\n self.add(element);\n }\n });\n }(elements));\n\n Object.defineProperties(this, {\n down: {\n get: function(){ return down; }\n },\n maxSpeed: {\n get: function(){ return maxSpeed; }\n },\n point: {\n get: function(){ return point; }\n },\n scrolling: {\n get: function(){ return scrolling; }\n }\n });\n\n var current = null, animationFrame;\n\n window.addEventListener('mousedown', onDown, false);\n window.addEventListener('touchstart', onDown, false);\n window.addEventListener('mouseup', onUp, false);\n window.addEventListener('touchend', onUp, false);\n\n /*\n IE does not trigger mouseup event when scrolling.\n It is a known issue that Microsoft won't fix.\n https://connect.microsoft.com/IE/feedback/details/783058/scrollbar-trigger-mousedown-but-not-mouseup\n IE supports pointer events instead\n */\n window.addEventListener('pointerup', onUp, false);\n\n window.addEventListener('mousemove', onMove, false);\n window.addEventListener('touchmove', onMove, false);\n\n window.addEventListener('mouseleave', onMouseOut, false);\n\n window.addEventListener('scroll', setScroll, true);\n\n function setScroll(e){\n\n for(var i=0; i<elements.length; i++){\n if(elements[i] === e.target){\n scrolling = true;\n break;\n }\n }\n\n if(scrolling){\n requestFrame(function (){ return scrolling = false; });\n }\n }\n\n function onDown(){\n down = true;\n }\n\n function onUp(){\n down = false;\n cleanAnimation();\n }\n function cleanAnimation(){\n cancelFrame(animationFrame);\n cancelFrame(windowAnimationFrame);\n }\n function onMouseOut(){\n down = false;\n }\n\n function getTarget(target){\n if(!target){\n return null;\n }\n\n if(current === target){\n return target;\n }\n\n if(hasElement(elements, target)){\n return target;\n }\n\n while(target = target.parentNode){\n if(hasElement(elements, target)){\n return target;\n }\n }\n\n return null;\n }\n\n function getElementUnderPoint(){\n var underPoint = null;\n\n for(var i=0; i<elements.length; i++){\n if(inside(point, elements[i])){\n underPoint = elements[i];\n }\n }\n\n return underPoint;\n }\n\n\n function onMove(event){\n\n if(!self.autoScroll()) { return; }\n\n if(event['dispatched']){ return; }\n\n var target = event.target, body = document.body;\n\n if(current && !inside(point, current)){\n if(!self.scrollWhenOutside){\n current = null;\n }\n }\n\n if(target && target.parentNode === body){\n //The special condition to improve speed.\n target = getElementUnderPoint();\n }else {\n target = getTarget(target);\n\n if(!target){\n target = getElementUnderPoint();\n }\n }\n\n\n if(target && target !== current){\n current = target;\n }\n\n if(hasWindow){\n cancelFrame(windowAnimationFrame);\n windowAnimationFrame = requestFrame(scrollWindow);\n }\n\n\n if(!current){\n return;\n }\n\n cancelFrame(animationFrame);\n animationFrame = requestFrame(scrollTick);\n }\n\n function scrollWindow(){\n autoScroll(hasWindow);\n\n cancelFrame(windowAnimationFrame);\n windowAnimationFrame = requestFrame(scrollWindow);\n }\n\n function scrollTick(){\n\n if(!current){\n return;\n }\n\n autoScroll(current);\n\n cancelFrame(animationFrame);\n animationFrame = requestFrame(scrollTick);\n\n }\n\n\n function autoScroll(el){\n var rect = getClientRect(el), scrollx, scrolly;\n\n if(point.x < rect.left + self.margin.left){\n scrollx = Math.floor(\n Math.max(-1, (point.x - rect.left) / self.margin.left - 1) * self.maxSpeed.left\n );\n }else if(point.x > rect.right - self.margin.right){\n scrollx = Math.ceil(\n Math.min(1, (point.x - rect.right) / self.margin.right + 1) * self.maxSpeed.right\n );\n }else {\n scrollx = 0;\n }\n\n if(point.y < rect.top + self.margin.top){\n scrolly = Math.floor(\n Math.max(-1, (point.y - rect.top) / self.margin.top - 1) * self.maxSpeed.top\n );\n }else if(point.y > rect.bottom - self.margin.bottom){\n scrolly = Math.ceil(\n Math.min(1, (point.y - rect.bottom) / self.margin.bottom + 1) * self.maxSpeed.bottom\n );\n }else {\n scrolly = 0;\n }\n\n if(self.syncMove()){\n /*\n Notes about mousemove event dispatch.\n screen(X/Y) should need to be updated.\n Some other properties might need to be set.\n Keep the syncMove option default false until all inconsistencies are taken care of.\n */\n dispatcher.dispatch(el, {\n pageX: point.pageX + scrollx,\n pageY: point.pageY + scrolly,\n clientX: point.x + scrollx,\n clientY: point.y + scrolly\n });\n }\n\n setTimeout(function (){\n\n if(scrolly){\n scrollY(el, scrolly);\n }\n\n if(scrollx){\n scrollX(el, scrollx);\n }\n\n });\n }\n\n function scrollY(el, amount){\n if(el === window){\n window.scrollTo(el.pageXOffset, el.pageYOffset + amount);\n }else {\n el.scrollTop += amount;\n }\n }\n\n function scrollX(el, amount){\n if(el === window){\n window.scrollTo(el.pageXOffset + amount, el.pageYOffset);\n }else {\n el.scrollLeft += amount;\n }\n }\n\n}\n\nfunction AutoScrollerFactory(element, options){\n return new AutoScroller(element, options);\n}\n\nfunction inside(point, el, rect){\n if(!rect){\n return pointInside(point, el);\n }else {\n return (point.y > rect.top && point.y < rect.bottom &&\n point.x > rect.left && point.x < rect.right);\n }\n}\n\n/*\ngit remote add origin https://github.com/hollowdoor/dom_autoscroller.git\ngit push -u origin master\n*/\n\nexport default AutoScrollerFactory;\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/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __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\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { Subject } from 'rxjs';\nimport { Injectable } from '@angular/core';\n\nexport interface CurrentDragData {\n clientX: number;\n clientY: number;\n dropData: any;\n target: EventTarget;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DraggableHelper {\n currentDrag = new Subject<Subject<CurrentDragData>>();\n}\n","import {\n Directive,\n ElementRef,\n Input,\n NgZone,\n OnInit,\n Renderer2,\n} from '@angular/core';\n\n/**\n * If the window isn't scrollable, then place this on the scrollable container that draggable elements are inside. e.g.\n * ```html\n <div style=\"overflow: scroll\" mwlDraggableScrollContainer>\n <div mwlDraggable>Drag me!</div>\n </div>\n ```\n */\n@Directive({\n selector: '[mwlDraggableScrollContainer]',\n})\nexport class DraggableScrollContainerDirective {\n /**\n * Trigger the DragStart after a long touch in scrollable container when true\n * @deprecated will be removed in v5 (use [touchStartLongPress]=\"{delay: 300, delta: 30}\" on the mwlDraggable element instead)\n */\n @Input() activeLongPressDrag: boolean = false;\n\n /**\n * Configuration of a long touch\n * Duration in ms of a long touch before activating DragStart\n * Delta of the\n * @deprecated will be removed in v5 (use [touchStartLongPress]=\"{delay: 300, delta: 30}\" on the mwlDraggable element instead)\n */\n @Input() longPressConfig = { duration: 300, delta: 30 };\n\n /**\n * @hidden\n */\n constructor(public elementRef: ElementRef<HTMLElement>) {}\n}\n","import { ElementRef, Renderer2 } from '@angular/core';\n\nexport function addClass(\n renderer: Renderer2,\n element: ElementRef<HTMLElement>,\n classToAdd: string\n) {\n if (classToAdd) {\n classToAdd\n .split(' ')\n .forEach((className) =>\n renderer.addClass(element.nativeElement, className)\n );\n }\n}\n\nexport function removeClass(\n renderer: Renderer2,\n element: ElementRef<HTMLElement>,\n classToRemove: string\n) {\n if (classToRemove) {\n classToRemove\n .split(' ')\n .forEach((className) =>\n renderer.removeClass(element.nativeElement, className)\n );\n }\n}\n","import {\n Directive,\n OnInit,\n ElementRef,\n Renderer2,\n Output,\n EventEmitter,\n Input,\n OnDestroy,\n OnChanges,\n NgZone,\n SimpleChanges,\n Inject,\n TemplateRef,\n ViewContainerRef,\n Optional,\n} from '@angular/core';\nimport {\n Subject,\n Observable,\n merge,\n ReplaySubject,\n combineLatest,\n fromEvent,\n} from 'rxjs';\nimport {\n map,\n mergeMap,\n takeUntil,\n take,\n takeLast,\n pairwise,\n share,\n filter,\n count,\n startWith,\n} from 'rxjs/operators';\nimport { CurrentDragData, DraggableHelper } from './draggable-helper.provider';\nimport { DOCUMENT } from '@angular/common';\nimport autoScroll from '@mattlewis92/dom-autoscroller';\nimport { DraggableScrollContainerDirective } from './draggable-scroll-container.directive';\nimport { addClass, removeClass } from './util';\n\nexport interface Coordinates {\n x: number;\n y: number;\n}\n\nexport interface DragAxis {\n x: boolean;\n y: boolean;\n}\n\nexport interface SnapGrid {\n x?: number;\n y?: number;\n}\n\nexport interface DragPointerDownEvent extends Coordinates {}\n\nexport interface DragStartEvent {\n cancelDrag$: ReplaySubject<void>;\n}\n\nexport interface DragMoveEvent extends Coordinates {}\n\nexport interface DragEndEvent extends Coordinates {\n dragCancelled: boolean;\n}\n\nexport interface ValidateDragParams extends Coordinates {\n transform: {\n x: number;\n y: number;\n };\n}\n\nexport type ValidateDrag = (params: ValidateDragParams) => boolean;\n\nexport interface PointerEvent {\n clientX: number;\n clientY: number;\n event: MouseEvent | TouchEvent;\n}\n\nexport interface TimeLongPress {\n timerBegin: number;\n timerEnd: number;\n}\n\nexport interface GhostElementCreatedEvent {\n clientX: number;\n clientY: number;\n element: HTMLElement;\n}\n\n@Directive({\n selector: '[mwlDraggable]',\n})\nexport class DraggableDirective implements OnInit, OnChanges, OnDestroy {\n /**\n * an object of data you can pass to the drop event\n */\n @Input() dropData: any;\n\n /**\n * The axis along which the element is draggable\n */\n @Input() dragAxis: DragAxis = { x: true, y: true };\n\n /**\n * Snap all drags to an x / y grid\n */\n @Input() dragSnapGrid: SnapGrid = {};\n\n /**\n * Show a ghost element that shows the drag when dragging\n */\n @Input() ghostDragEnabled: boolean = true;\n\n /**\n * Show the original element when ghostDragEnabled is true\n */\n @Input() showOriginalElementWhileDragging: boolean = false;\n\n /**\n * Allow custom behaviour to control when the element is dragged\n */\n @Input() validateDrag: ValidateDrag;\n\n /**\n * The cursor to use when hovering over a draggable element\n */\n @Input() dragCursor: string = '';\n\n /**\n * The css class to apply when the element is being dragged\n */\n @Input() dragActiveClass: string;\n\n /**\n * The element the ghost element will be appended to. Default is next to the dragged element\n */\n @Input() ghostElementAppendTo: HTMLElement;\n\n /**\n * An ng-template to be inserted into the parent element of the ghost element. It will overwrite any child nodes.\n */\n @Input() ghostElementTemplate: TemplateRef<any>;\n\n /**\n * Amount of milliseconds to wait on touch devices before starting to drag the element (so that you can scroll the page by touching a draggable element)\n */\n @Input() touchStartLongPress: { delay: number; delta: number };\n\n /*\n * Options used to control the behaviour of auto scrolling: https://www.npmjs.com/package/dom-autoscroller\n */\n @Input() autoScroll: {\n margin:\n | number\n | { top?: number; left?: number; right?: number; bottom?: number };\n maxSpeed?:\n | number\n | { top?: number; left?: number; right?: number; bottom?: number };\n scrollWhenOutside?: boolean;\n } = {\n margin: 20,\n };\n\n /**\n * Called when the element can be dragged along one axis and has the mouse or pointer device pressed on it\n */\n @Output() dragPointerDown = new EventEmitter<DragPointerDownEvent>();\n\n /**\n * Called when the element has started to be dragged.\n * Only called after at least one mouse or touch move event.\n * If you call $event.cancelDrag$.emit() it will cancel the current drag\n */\n @Output() dragStart = new EventEmitter<DragStartEvent>();\n\n /**\n * Called after the ghost element has been created\n */\n @Output() ghostElementCreated = new EventEmitter<GhostElementCreatedEvent>();\n\n /**\n * Called when the element is being dragged\n */\n @Output() dragging = new EventEmitter<DragMoveEvent>();\n\n /**\n * Called after the element is dragged\n */\n @Output() dragEnd = new EventEmitter<DragEndEvent>();\n\n /**\n * @hidden\n */\n pointerDown$ = new Subject<PointerEvent>();\n\n /**\n * @hidden\n */\n pointerMove$ = new Subject<PointerEvent>();\n\n /**\n * @hidden\n */\n pointerUp$ = new Subject<PointerEvent>();\n\n private eventListenerSubscriptions: {\n mousemove?: () => void;\n mousedown?: () => void;\n mouseup?: () => void;\n mouseenter?: () => void;\n mouseleave?: () => void;\n touchstart?: () => void;\n touchmove?: () => void;\n touchend?: () => void;\n touchcancel?: () => void;\n } = {};\n\n private ghostElement: HTMLElement | null;\n\n private destroy$ = new Subject();\n\n private timeLongPress: TimeLongPress = { timerBegin: 0, timerEnd: 0 };\n\n private scroller: { destroy: () => void };\n\n /**\n * @hidden\n */\n constructor(\n private element: ElementRef<HTMLElement>,\n private renderer: Renderer2,\n private draggableHelper: DraggableHelper,\n private zone: NgZone,\n private vcr: ViewContainerRef,\n @Optional() private scrollContainer: DraggableScrollContainerDirective,\n @Inject(DOCUMENT) private document: any\n ) {}\n\n ngOnInit(): void {\n this.checkEventListeners();\n\n const pointerDragged$: Observable<any> = this.pointerDown$.pipe(\n filter(() => this.canDrag()),\n mergeMap((pointerDownEvent: PointerEvent) => {\n // fix for https://github.com/mattlewis92/angular-draggable-droppable/issues/61\n // stop mouse events propagating up the chain\n if (pointerDownEvent.event.stopPropagation && !this.scrollContainer) {\n pointerDownEvent.event.stopPropagation();\n }\n\n // hack to prevent text getting selected in safari while dragging\n const globalDragStyle: HTMLStyleElement = this.renderer.createElement(\n 'style'\n );\n this.renderer.setAttribute(globalDragStyle, 'type', 'text/css');\n this.renderer.appendChild(\n globalDragStyle,\n this.renderer.createText(`\n body * {\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n }\n `)\n );\n requestAnimationFrame(() => {\n this.document.head.appendChild(globalDragStyle);\n });\n\n const startScrollPosition = this.getScrollPosition();\n\n const scrollContainerScroll$ = new Observable((observer) => {\n const scrollContainer = this.scrollContainer\n ? this.scrollContainer.elementRef.nativeElement\n : 'window';\n return this.renderer.listen(scrollContainer, 'scroll', (e) =>\n observer.next(e)\n );\n }).pipe(\n startWith(startScrollPosition),\n map(() => this.getScrollPosition())\n );\n\n const currentDrag$ = new Subject<CurrentDragData>();\n const cancelDrag$ = new ReplaySubject<void>();\n\n this.zone.run(() => {\n this.dragPointerDown.next({ x: 0, y: 0 });\n });\n\n const dragComplete$ = merge(\n this.pointerUp$,\n this.pointerDown$,\n cancelDrag$,\n this.destroy$\n ).pipe(share());\n\n const pointerMove = combineLatest([\n this.pointerMove$,\n scrollContainerScroll$,\n ]).pipe(\n map(([pointerMoveEvent, scroll]) => {\n return {\n currentDrag$,\n transformX: pointerMoveEvent.clientX - pointerDownEvent.clientX,\n transformY: pointerMoveEvent.clientY - pointerDownEvent.clientY,\n clientX: pointerMoveEvent.clientX,\n clientY: pointerMoveEvent.clientY,\n scrollLeft: scroll.left,\n scrollTop: scroll.top,\n target: pointerMoveEvent.event.target,\n };\n }),\n map((moveData) => {\n if (this.dragSnapGrid.x) {\n moveData.transformX =\n Math.round(moveData.transformX / this.dragSnapGrid.x) *\n this.dragSnapGrid.x;\n }\n\n if (this.dragSnapGrid.y) {\n moveData.transformY =\n Math.round(moveData.transformY / this.dragSnapGrid.y) *\n this.dragSnapGrid.y;\n }\n\n return moveData;\n }),\n map((moveData) => {\n if (!this.dragAxis.x) {\n moveData.transformX = 0;\n }\n\n if (!this.dragAxis.y) {\n moveData.transformY = 0;\n }\n\n return moveData;\n }),\n map((moveData) => {\n const scrollX = moveData.scrollLeft - startScrollPosition.left;\n const scrollY = moveData.scrollTop - startScrollPosition.top;\n return {\n ...moveData,\n x: moveData.transformX + scrollX,\n y: moveData.transformY + scrollY,\n };\n }),\n filter(\n ({ x, y, transformX, transformY }) =>\n !this.validateDrag ||\n this.validateDrag({\n x,\n y,\n transform: { x: transformX, y: transformY },\n })\n ),\n takeUntil(dragComplete$),\n share()\n );\n\n const dragStarted$ = pointerMove.pipe(take(1), share());\n const dragEnded$ = pointerMove.pipe(takeLast(1), share());\n\n dragStarted$.subscribe(({ clientX, clientY, x, y }) => {\n this.zone.run(() => {\n this.dragStart.next({ cancelDrag$ });\n });\n\n this.scroller = autoScroll(\n [\n this.scrollContainer\n ? this.scrollContainer.elementRef.nativeElement\n : this.document.defaultView,\n ],\n {\n ...this.autoScroll,\n autoScroll() {\n return true;\n },\n }\n );\n addClass(this.renderer, this.element, this.dragActiveClass);\n\n if (this.ghostDragEnabled) {\n const rect = this.element.nativeElement.getBoundingClientRect();\n const clone = this.element.nativeElement.cloneNode(\n true\n ) as HTMLElement;\n if (!this.showOriginalElementWhileDragging) {\n this.renderer.setStyle(\n this.element.nativeElement,\n 'visibility',\n 'hidden'\n );\n }\n\n if (this.ghostElementAppendTo) {\n this.ghostElementAppendTo.appendChild(clone);\n } else {\n this.element.nativeElement.parentNode!.insertBefore(\n clone,\n this.element.nativeElement.nextSibling\n );\n }\n\n this.ghostElement = clone;\n\n this.document.body.style.cursor = this.dragCursor;\n\n this.setElementStyles(clone, {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.left}px`,\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n cursor: this.dragCursor,\n margin: '0',\n willChange: 'transform',\n pointerEvents: 'none',\n });\n\n if (this.ghostElementTemplate) {\n const viewRef = this.vcr.createEmbeddedView(\n this.ghostElementTemplate\n );\n clone.innerHTML = '';\n viewRef.rootNodes\n .filter((node) => node instanceof Node)\n .forEach((node) => {\n clone.appendChild(node);\n });\n dragEnded$.subscribe(() => {\n this.vcr.remove(this.vcr.indexOf(viewRef));\n });\n }\n\n this.zone.run(() => {\n this.ghostElementCreated.emit({\n clientX: clientX - x,\n clientY: clientY - y,\n element: clone,\n });\n });\n\n dragEnded$.subscribe(() => {\n clone.parentElement!.removeChild(clone);\n this.ghostElement = null;\n this.renderer.setStyle(\n this.element.nativeElement,\n 'visibility',\n ''\n );\n });\n }\n\n this.draggableHelper.currentDrag.next(currentDrag$);\n });\n\n dragEnded$\n .pipe(\n mergeMap((dragEndData) => {\n const dragEndData$ = cancelDrag$.pipe(\n count(),\n take(1),\n map((calledCount) => ({\n ...dragEndData,\n dragCancelled: calledCount > 0,\n }))\n );\n cancelDrag$.complete();\n return dragEndData$;\n })\n )\n .subscribe(({ x, y, dragCancelled }) => {\n this.scroller.destroy();\n this.zone.run(() => {\n this.dragEnd.next({ x, y, dragCancelled });\n });\n removeClass(this.renderer, this.element, this.dragActiveClass);\n currentDrag$.complete();\n });\n\n merge(dragComplete$, dragEnded$)\n .pipe(take(1))\n .subscribe(() => {\n requestAnimationFrame(() => {\n this.document.head.removeChild(globalDragStyle);\n });\n });\n\n return pointerMove;\n }),\n share()\n );\n\n merge(\n pointerDragged$.pipe(\n take(1),\n map((value) => [, value])\n ),\n pointerDragged$.pipe(pairwise())\n )\n .pipe(\n filter(([previous, next]) => {\n if (!previous) {\n return true;\n }\n return previous.x !== next.x || previous.y !== next.y;\n }),\n map(([previous, next]) => next)\n )\n .subscribe(\n ({\n x,\n y,\n currentDrag$,\n clientX,\n clientY,\n transformX,\n transformY,\n target,\n }) => {\n this.zone.run(() => {\n this.dragging.next({ x, y });\n });\n requestAnimationFrame(() => {\n if (this.ghostElement) {\n const transform = `translate3d(${transformX}px, ${transformY}px, 0px)`;\n this.setElementStyles(this.ghostElement, {\n transform,\n '-webkit-transform': transform,\n '-ms-transform': transform,\n '-moz-transform': transform,\n '-o-transform': transform,\n });\n }\n });\n currentDrag$.next({\n clientX,\n clientY,\n dropData: this.dropData,\n target,\n });\n }\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.dragAxis) {\n this.checkEventListeners();\n }\n }\n\n ngOnDestroy(): void {\n this.unsubscribeEventListeners();\n this.pointerDown$.complete();\n this.pointerMove$.complete();\n this.pointerUp$.complete();\n this.destroy$.next();\n }\n\n private checkEventListeners(): void {\n const canDrag: boolean = this.canDrag();\n const hasEventListeners: boolean =\n Object.keys(this.eventListenerSubscriptions).length > 0;\n\n if (canDrag && !hasEventListeners) {\n this.zone.runOutsideAngular(() => {\n this.eventListenerSubscriptions.mousedown = this.renderer.listen(\n this.element.nativeElement,\n 'mousedown',\n (event: MouseEvent) => {\n this.onMouseDown(event);\n }\n );\n\n this.eventListenerSubscriptions.mouseup = this.renderer.listen(\n 'document',\n 'mouseup',\n (event: MouseEvent) => {\n this.onMouseUp(event);\n }\n );\n\n this.eventListenerSubscriptions.touchstart = this.renderer.listen(\n this.element.nativeElement,\n 'touchstart',\n (event: TouchEvent) => {\n this.onTouchStart(event);\n }\n );\n\n this.eventListenerSubscriptions.touchend = this.renderer.listen(\n 'document',\n 'touchend',\n (event: TouchEvent) => {\n this.onTouchEnd(event);\n }\n );\n\n this.eventListenerSubscriptions.touchcancel = this.renderer.listen(\n 'document',\n 'touchcancel',\n (event: TouchEvent) => {\n this.onTouchEnd(event);\n }\n );\n\n this.eventListenerSubscriptions.mouseenter = this.renderer.listen(\n this.element.nativeElement,\n 'mouseenter',\n () => {\n this.onMouseEnter();\n }\n );\n\n this.eventListenerSubscriptions.mouseleave = this.renderer.listen(\n this.element.nativeElement,\n 'mouseleave',\n () => {\n this.onMouseLeave();\n }\n );\n });\n } else if (!canDrag && hasEventListeners) {\n this.unsubscribeEventListeners();\n }\n }\n\n private onMouseDown(event: MouseEvent): void {\n if (event.button === 0) {\n if (!this.eventListenerSubscriptions.mousemove) {\n this.eventListenerSubscriptions.mousemove = this.renderer.listen(\n 'document',\n 'mousemove',\n (mouseMoveEvent: MouseEvent) => {\n this.pointerMove$.next({\n event: mouseMoveEvent,\n clientX: mouseMoveEvent.clientX,\n clientY: mouseMoveEvent.clientY,\n });\n }\n );\n }\n this.pointerDown$.next({\n event,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n }\n }\n\n private onMouseUp(event: MouseEvent): void {\n if (event.button === 0) {\n if (this.eventListenerSubscriptions.mousemove) {\n this.eventListenerSubscriptions.mousemove();\n delete this.eventListenerSubscriptions.mousemove;\n }\n this.pointerUp$.next({\n event,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n }\n }\n\n private onTouchStart(event: TouchEvent): void {\n let startScrollPosition: any;\n let isDragActivated: boolean;\n let hasContainerScrollbar: boolean;\n if (\n (this.scrollContainer && this.scrollContainer.activeLongPressDrag) ||\n this.touchStartLongPress\n ) {\n this.timeLongPress.timerBegin = Date.now();\n isDragActivated = false;\n hasContainerScrollbar = this.hasScrollbar();\n startScrollPosition = this.getScrollPosition();\n }\n\n if (!this.eventListenerSubscriptions.touchmove) {\n const contextMenuListener = fromEvent<Event>(\n this.document,\n 'contextmenu'\n ).subscribe((e) => {\n e.preventDefault();\n });\n\n const touchMoveListener = fromEvent<TouchEvent>(\n this.document,\n 'touchmove',\n {\n passive: false,\n }\n ).subscribe((touchMoveEvent) => {\n if (\n ((this.scrollContainer && this.scrollContainer.activeLongPressDrag) ||\n this.touchStartLongPress) &&\n !isDragActivated &&\n hasContainerScrollbar\n ) {\n isDragActivated = this.shouldBeginDrag(\n event,\n touchMoveEvent,\n startScrollPosition\n );\n }\n if (\n ((!this.scrollContainer ||\n !this.scrollContainer.activeLongPressDrag) &&\n !this.touchStartLongPress) ||\n !hasContainerScrollbar ||\n isDragActivated\n ) {\n touchMoveEvent.preventDefault();\n this.pointerMove$.next({\n event: touchMoveEvent,\n clientX: touchMoveEvent.targetTouches[0].clientX,\n clientY: touchMoveEvent.targetTouches[0].clientY,\n });\n }\n });\n\n this.eventListenerSubscriptions.touchmove = () => {\n contextMenuListener.unsubscribe();\n touchMoveListener.unsubscribe();\n };\n }\n this.pointerDown$.next({\n event,\n clientX: event.touches[0].clientX,\n clientY: event.touches[0].clientY,\n });\n }\n\n private onTouchEnd(event: TouchEvent): void {\n if (this.eventListenerSubscriptions.touchmove) {\n this.eventListenerSubscriptions.touchmove();\n delete this.eventListenerSubscriptions.touchmove;\n\n if (\n (this.scrollContainer && this.scrollContainer.activeLongPressDrag) ||\n this.touchStartLongPress\n ) {\n this.enableScroll();\n }\n }\n this.pointerUp$.next({\n event,\n clientX: event.changedTouches[0].clientX,\n clientY: event.changedTouches[0].clientY,\n });\n }\n\n private onMouseEnter(): void {\n this.setCursor(this.dragCursor);\n }\n\n private onMouseLeave(): void {\n this.setCursor('');\n }\n\n private canDrag(): boolean {\n return this.dragAxis.x || this.dragAxis.y;\n }\n\n private setCursor(value: string): void {\n if (!this.eventListenerSubscriptions.mousemove) {\n this.renderer.setStyle(this.element.nativeElement, 'cursor', value);\n }\n }\n\n private unsubscribeEventListeners(): void {\n Object.keys(this.eventListenerSubscriptions).forEach((type) => {\n (this as any).eventListenerSubscriptions[type]();\n delete (this as any).eventListenerSubscriptions[type];\n });\n }\n\n private setElementStyles(\n element: HTMLElement,\n styles: { [key: string]: string }\n ) {\n Object.keys(styles).forEach((key) => {\n this.renderer.setStyle(element, key, styles[key]);\n });\n }\n\n private getScrollElement() {\n if (this.scrollContainer) {\n return this.scrollContainer.elementRef.nativeElement;\n } else {\n return this.document.body;\n }\n }\n\n private getScrollPosition() {\n if (this.scrollContainer) {\n return {\n top: this.scrollContainer.elementRef.nativeElement.scrollTop,\n left: this.scrollContainer.elementRef.nativeElement.scrollLeft,\n };\n } else {\n return {\n top: window.pageYOffset || this.document.documentElement.scrollTop,\n left: window.pageXOffset || this.document.documentElement.scrollLeft,\n };\n }\n }\n\n private shouldBeginDrag(\n event: TouchEvent,\n touchMoveEvent: TouchEvent,\n startScrollPosition: { top: number; left: number }\n ): boolean {\n const moveScrollPosition = this.getScrollPosition();\n const deltaScroll = {\n top: Math.abs(moveScrollPosition.top - startScrollPosition.top),\n left: Math.abs(moveScrollPosition.left - startScrollPosition.left),\n };\n const deltaX =\n Math.abs(\n touchMoveEvent.targetTouches[0].clientX - event.touches[0].clientX\n ) - deltaScroll.left;\n const deltaY =\n Math.abs(\n touchMoveEvent.targetTouches[0].clientY - event.touches[0].clientY\n ) - deltaScroll.top;\n const deltaTotal = deltaX + deltaY;\n const longPressConfig = this.touchStartLongPress\n ? this.touchStartLongPress\n : /* istanbul ignore next */\n {\n delta: this.scrollContainer.longPressConfig.delta,\n delay: this.scrollContainer.longPressConfig.duration,\n };\n if (\n deltaTotal > longPressConfig.delta ||\n deltaScroll.top > 0 ||\n deltaScroll.left > 0\n ) {\n this.timeLongPress.timerBegin = Date.now();\n }\n this.timeLongPress.timerEnd = Date.now();\n const duration =\n this.timeLongPress.timerEnd - this.timeLongPress.timerBegin;\n if (duration >= longPressConfig.delay) {\n this.disableScroll();\n return true;\n }\n return false;\n }\n\n private enableScroll() {\n if (this.scrollContainer) {\n this.renderer.setStyle(\n this.scrollContainer.elementRef.nativeElement,\n 'overflow',\n ''\n );\n }\n this.renderer.setStyle(this.document.body, 'overflow', '');\n }\n\n private disableScroll() {\n /* istanbul ignore next */\n if (this.scrollContainer) {\n this.renderer.setStyle(\n this.scrollContainer.elementRef.nativeElement,\n 'overflow',\n 'hidden'\n );\n }\n this.renderer.setStyle(this.document.body, 'overflow', 'hidden');\n }\n\n private hasScrollbar(): boolean {\n const scrollContainer = this.getScrollElement();\n const containerHasHorizontalScroll =\n scrollContainer.scrollWidth > scrollContainer.clientWidth;\n const containerHasVerticalScroll =\n scrollContainer.scrollHeight > scrollContainer.clientHeight;\n return containerHasHorizontalScroll || containerHasVerticalScroll;\n }\n}\n","import {\n Directive,\n OnInit,\n ElementRef,\n OnDestroy,\n Output,\n EventEmitter,\n NgZone,\n Input,\n Renderer2,\n Optional,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { distinctUntilChanged, pairwise, filter, map } from 'rxjs/operators';\nimport { DraggableHelper } from './draggable-helper.provider';\nimport { DraggableScrollContainerDirective } from './draggable-scroll-container.directive';\nimport { addClass, removeClass } from './util';\n\nfunction isCoordinateWithinRectangle(\n clientX: number,\n clientY: number,\n rect: ClientRect\n): boolean {\n return (\n clientX >= rect.left &&\n clientX <= rect.right &&\n clientY >= rect.top &&\n clientY <= rect.bottom\n );\n}\n\nexport interface DropEvent<T = any> {\n dropData: T;\n}\n\nexport interface ValidateDropParams {\n /**\n * ClientX value of the mouse location where the drop occurred\n */\n clientX: number;\n /**\n * ClientY value of the mouse location where the drop occurred\n */\n clientY: number;\n /**\n * The target of the event where the drop occurred\n */\n target: EventTarget;\n}\n\nexport type ValidateDrop = (params: ValidateDropParams) => boolean;\n\n@Directive({\n selector: '[mwlDroppable]',\n})\nexport class DroppableDirective implements OnInit, OnDestroy {\n /**\n * Added to the element when an element is dragged over it\n */\n @Input() dragOverClass: string;\n\n /**\n * Added to the element any time a draggable element is being dragged\n */\n @Input() dragActiveClass: string;\n\n /**\n * Allow custom behaviour to control when the element is dropped\n */\n @Input() validateDrop: ValidateDrop;\n\n /**\n * Called when a draggable element starts overlapping the element\n */\n @Output() dragEnter = new EventEmitter<DropEvent>();\n\n /**\n * Called when a draggable element stops overlapping the element\n */\n @Output() dragLeave = new EventEmitter<DropEvent>();\n\n /**\n * Called when a draggable element is moved over the element\n */\n @Output() dragOver = new EventEmitter<DropEvent>();\n\n /**\n * Called when a draggable element is dropped on this element\n */\n @Output() drop = new EventEmitter<DropEvent>(); // tslint:disable-line no-output-named-after-standard-event\n\n currentDragSubscription: Subscription;\n\n constructor(\n private element: ElementRef<HTMLElement>,\n private draggableHelper: DraggableHelper,\n private zone: NgZone,\n private renderer: Renderer2,\n @Optional() private scrollContainer: DraggableScrollContainerDirective\n ) {}\n\n ngOnInit() {\n this.currentDragSubscription = this.draggableHelper.currentDrag.subscribe(\n (drag$) => {\n addClass(this.renderer, this.element, this.dragActiveClass);\n const droppableElement: {\n rect?: ClientRect;\n updateCache: boolean;\n scrollContainerRect?: ClientRect;\n } = {\n updateCache: true,\n };\n\n const deregisterScrollListener = this.renderer.listen(\n this.scrollContainer\n ? this.scrollContainer.elementRef.nativeElement\n : 'window',\n 'scroll',\n () => {\n droppableElement.updateCache = true;\n }\n );\n\n let currentDragDropData: any;\n const overlaps$ = drag$.pipe(\n map(({ clientX, clientY, dropData, target }) => {\n currentDragDropData = dropData;\n if (droppableElement.updateCache) {\n droppableElement.rect = this.element.nativeElement.getBoundingClientRect();\n if (this.scrollContainer) {\n droppableElement.scrollContainerRect = this.scrollContainer.elementRef.nativeElement.getBoundingClientRect();\n }\n droppableElement.updateCache = false;\n }\n const isWithinElement = isCoordinateWithinRectangle(\n clientX,\n clientY,\n droppableElement.rect as ClientRect\n );\n\n const isDropAllowed =\n !this.validateDrop ||\n this.validateDrop({ clientX, clientY, target });\n\n if (droppableElement.scrollContainerRect) {\n return (\n isWithinElement &&\n isDropAllowed &&\n isCoordinateWithinRectangle(\n clientX,\n clientY,\n droppableElement.scrollContainerRect as ClientRect\n )\n );\n } else {\n return isWithinElement && isDropAllowed;\n }\n })\n );\n\n const overlapsChanged$ = overlaps$.pipe(distinctUntilChanged());\n\n let dragOverActive: boolean; // TODO - see if there's a way of doing this via rxjs\n\n overlapsChanged$\n .pipe(filter((overlapsNow) => overlapsNow))\n .subscribe(() => {\n dragOverActive = true;\n addClass(this.renderer, this.element, this.dragOverClass);\n this.zone.run(() => {\n this.dragEnter.next({\n dropData: currentDragDropData,\n });\n });\n });\n\n overlaps$.pipe(filter((overlapsNow) => overlapsNow)).subscribe(() => {\n this.zone.run(() => {\n this.dragOver.next({\n dropData: currentDragDropData,\n });\n });\n });\n\n overlapsChanged$\n .pipe(\n pairwise(),\n filter(([didOverlap, overlapsNow]) => didOverlap && !overlapsNow)\n )\n .subscribe(() => {\n dragOverActive = false;\n removeClass(this.renderer, this.element, this.dragOverClass);\n this.zone.run(() => {\n this.dragLeave.next({\n dropData: currentDragDropData,\n });\n });\n });\n\n drag$.subscribe({\n complete: () => {\n deregisterScrollListener();\n removeClass(this.renderer, this.element, this.dragActiveClass);\n if (dragOverActive) {\n removeClass(this.renderer, this.element, this.dragOverClass);\n this.zone.run(() => {\n this.drop.next({\n dropData: currentDragDropData,\n });\n });\n }\n },\n });\n }\n );\n }\n\n ngOnDestroy() {\n if (this.currentDragSubscription) {\n this.currentDragSubscription.unsubscribe();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DraggableDirective } from './draggable.directive';\nimport { DroppableDirective } from './droppable.directive';\nimport { DraggableScrollContainerDirective } from './draggable-scroll-container.directive';\n\n@NgModule({\n declarations: [\n DraggableDirective,\n DroppableDirective,\n DraggableScrollContainerDirective,\n ],\n exports: [\n DraggableDirective,\n DroppableDirective,\n DraggableScrollContainerDirective,\n ],\n})\nexport class DragAndDropModule {}\n"],"names":["boolean","func","def","f","d","arguments$1","arguments","_len","length","args","Array","_key","apply","this","_typeof","Symbol","iterator","obj","constructor","isElement$1","input","nodeType","style","ownerDocument","indexOfElement","elements","element","resolveElement","i","hasElement","pushElements","toAdd","push","addElements","len","map","removeElements","toRemove","reduce","last","e","index","concat","splice","noThrow","document","querySelector","TypeError","getClientRect","el","window","props","top","value","enumerable","left","right","innerWidth","bottom","innerHeight","width","height","x","y","Object","create","rect","defineProperties","createWindowRect","getBoundingClientRect","undefined","Temp","objectCreate","prototype","propertiesObject","result","__proto__","objectCreate$1","mouseEventProps","createMoveInit","defaultSettings","initMove","settings","setSpecial","data","console","log","dispatched","prefix","requestFrame","limit","requestAnimationFrame","lastTime","callback","now","Date","getTime","ttc","Math","max","timer","setTimeout","bind","cancelFrame","cancelAnimationFrame","clearTimeout","AutoScroller","options","self","maxSpeed","scrolling","margin","scrollWhenOutside","point","pointCB","object","allowUpdate","event","target","srcElement","originalTarget","type","targetTouches","clientX","clientY","pageX","pageY","screenX","screenY","eventDoc","doc","documentElement","body","scrollLeft","clientLeft","scrollTop","clientTop","createPointCB","dispatcher","ctrlKey","shiftKey","altKey","metaKey","button","buttons","relatedTarget","region","onMove","addEventListener","destroy","removeEventListener","dispatch","MouseEvent","evt","dispatchEvent","createEvent","initMouseEvent","createEventObject","name","createDispatcher","down","isNaN","autoScroll","syncMove","forceCleanAnimation","onDown","onUp","onMouseOut","setScroll","cleanAnimation","add","remove","windowAnimationFrame","temp","hasWindow","toString","call","forEach","get","animationFrame","current","getElementUnderPoint","underPoint","inside","parentNode","getTarget","scrollWindow","scrollTick","scrollx","scrolly","floor","ceil","min","amount","scrollTo","pageXOffset","pageYOffset","scrollY","scrollX","AutoScrollerFactory","pointInside","__assign","assign","t","s","n","p","hasOwnProperty","__read","o","m","r","ar","next","done","error","Subject","Injectable","providedIn","elementRef","duration","delta","Directive","selector","ElementRef","Input","addClass","renderer","classToAdd","split","className","nativeElement","removeClass","classToRemove","draggableHelper","zone","vcr","scrollContainer","EventEmitter","timerBegin","timerEnd","DraggableDirective","checkEventListeners","pointerDragged$","pointerDown$","pipe","filter","_this","canDrag","mergeMap","pointerDownEvent","stopPropagation","globalDragStyle","createElement","setAttribute","appendChild","createText","head","startScrollPosition","getScrollPosition","scrollContainerScroll$","Observable","observer","listen","startWith","currentDrag$","cancelDrag$","ReplaySubject","run","dragPointerDown","dragComplete$","merge","pointerUp$","destroy$","share","pointerMove","combineLatest","pointerMove$","_a","_b","pointerMoveEvent","scroll","transformX","transformY","moveData","dragSnapGrid","round","dragAxis","validateDrag","transform","takeUntil","dragStarted$","take","dragEnded$","takeLast","subscribe","dragStart","scroller","defaultView","dragActiveClass","ghostDragEnabled","clone_1","cloneNode","showOriginalElementWhileDragging","setStyle","ghostElementAppendTo","insertBefore","nextSibling","ghostElement","cursor","dragCursor","setElementStyles","position","willChange","pointerEvents","ghostElementTemplate","viewRef_1","createEmbeddedView","innerHTML","rootNodes","node","Node","indexOf","ghostElementCreated","emit","removeChild","currentDrag","dragEndData","dragEndData$","count","calledCount","dragCancelled","complete","dragEnd","pairwise","previous","dragging","-webkit-transform","-ms-transform","-moz-transform","-o-transform","dropData","changes","unsubscribeEventListeners","hasEventListeners","keys","eventListenerSubscriptions","runOutsideAngular","mousedown","onMouseDown","mouseup","onMouseUp","touchstart","onTouchStart","touchend","onTouchEnd","touchcancel","mouseenter","onMouseEnter","mouseleave","onMouseLeave","mousemove","mouseMoveEvent","isDragActivated","hasContainerScrollbar","activeLongPressDrag","touchStartLongPress","timeLongPress","hasScrollbar","touchmove","contextMenuListener_1","fromEvent","preventDefault","touchMoveListener_1","passive","touchMoveEvent","shouldBeginDrag","unsubscribe","touches","enableScroll","changedTouches","setCursor","styles","key","moveScrollPosition","deltaScroll","abs","deltaTotal","longPressConfig","delay","disableScroll","getScrollElement","containerHasHorizontalScroll","scrollWidth","clientWidth","containerHasVerticalScroll","scrollHeight","clientHeight","Renderer2","DraggableHelper","NgZone","ViewContainerRef","DraggableScrollContainerDirective","Optional","Inject","DOCUMENT","Output","isCoordinateWithinRectangle","DroppableDirective","currentDragSubscription","drag$","currentDragDropData","dragOverActive","droppableElement","updateCache","deregisterScrollListener","overlaps$","scrollContainerRect","isWithinElement","isDropAllowed","validateDrop","overlapsChanged$","distinctUntilChanged","overlapsNow","dragOverClass","dragEnter","dragOver","didOverlap","dragLeave","drop","NgModule","declarations","exports"],"mappings":"k7BAOA,SAASA,EAAQC,EAAMC,GAPvB,IAAgBC,EAAGC,EAWf,OAXeA,EASKF,EAEA,mBAFpBD,OARiB,KADLE,EASEF,QAPU,IAANG,EAAoBD,EAAIC,EAGnCD,GAOI,WAGH,IAFA,IAAIE,EAAcC,UAETC,EAAOD,UAAUE,OAAQC,EAAOC,MAAMH,GAAOI,EAAO,EAAGA,EAAOJ,EAAMI,IACzEF,EAAKE,GAAQN,EAAYM,GAG7B,QAASV,EAAKW,MAAMC,KAAMJ,IAIzBR,EAAO,WACZ,OAAO,GACP,WACA,OAAO,sYAIf,IAAIa,EAA4B,mBAAXC,QAAoD,iBAApBA,OAAOC,SAAwB,SAAUC,GAA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