Comparing version 0.0.27 to 0.0.28
@@ -30,2 +30,3 @@ import Component from "@egjs/component"; | ||
private onDragStart; | ||
private render; | ||
private onDrag; | ||
@@ -32,0 +33,0 @@ private onDragEnd; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/selecto.git | ||
version: 0.0.27 | ||
version: 0.0.28 | ||
*/ | ||
@@ -344,2 +344,5 @@ 'use strict'; | ||
inputEvent = e.inputEvent; | ||
_this.render(e); | ||
var startX = datas.startX, | ||
@@ -351,3 +354,2 @@ startY = datas.startY; | ||
var height = Math.abs(distY); | ||
_this.target.style.cssText += "display: block;" + ("left:" + startX + "px;top:" + startY + "px;") + ("transform: translate(" + tx + "px, " + ty + "px);") + ("width:" + width + "px;height:" + height + "px;"); | ||
var left = startX + tx; | ||
@@ -369,4 +371,2 @@ var top = startY + ty; | ||
_this.dragScroll.drag(e, scrollOptions); | ||
_this.dragScroll.dragAfter(e, scrollOptions); | ||
} | ||
@@ -382,2 +382,5 @@ | ||
inputEvent = _a.inputEvent; | ||
_this.dragScroll.dragEnd(); | ||
_this.target.style.cssText += "display: none;"; | ||
@@ -690,2 +693,7 @@ | ||
_this.dragger.scrollBy(offsetX, offsetY, inputEvent.inputEvent, false); | ||
inputEvent.distX += offsetX; | ||
inputEvent.distY += offsetY; | ||
_this.render(inputEvent); | ||
}); | ||
@@ -875,2 +883,15 @@ }; | ||
__proto.render = function (e) { | ||
var distX = e.distX, | ||
distY = e.distY, | ||
datas = e.datas; | ||
var startX = datas.startX, | ||
startY = datas.startY; | ||
var tx = Math.min(0, distX); | ||
var ty = Math.min(0, distY); | ||
var width = Math.abs(distX); | ||
var height = Math.abs(distY); | ||
this.target.style.cssText += "display: block;" + ("left:" + startX + "px;top:" + startY + "px;") + ("transform: translate(" + tx + "px, " + ty + "px);") + ("width:" + width + "px;height:" + height + "px;"); | ||
}; | ||
__proto.sameCombiKey = function (e) { | ||
@@ -877,0 +898,0 @@ var toggleContinueSelect = [].concat(this.options.toggleContinueSelect); |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/selecto.git | ||
version: 0.0.27 | ||
version: 0.0.28 | ||
*/ | ||
@@ -342,2 +342,5 @@ import Component from '@egjs/component'; | ||
inputEvent = e.inputEvent; | ||
_this.render(e); | ||
var startX = datas.startX, | ||
@@ -349,3 +352,2 @@ startY = datas.startY; | ||
var height = Math.abs(distY); | ||
_this.target.style.cssText += "display: block;" + ("left:" + startX + "px;top:" + startY + "px;") + ("transform: translate(" + tx + "px, " + ty + "px);") + ("width:" + width + "px;height:" + height + "px;"); | ||
var left = startX + tx; | ||
@@ -367,4 +369,2 @@ var top = startY + ty; | ||
_this.dragScroll.drag(e, scrollOptions); | ||
_this.dragScroll.dragAfter(e, scrollOptions); | ||
} | ||
@@ -380,2 +380,5 @@ | ||
inputEvent = _a.inputEvent; | ||
_this.dragScroll.dragEnd(); | ||
_this.target.style.cssText += "display: none;"; | ||
@@ -688,2 +691,7 @@ | ||
_this.dragger.scrollBy(offsetX, offsetY, inputEvent.inputEvent, false); | ||
inputEvent.distX += offsetX; | ||
inputEvent.distY += offsetY; | ||
_this.render(inputEvent); | ||
}); | ||
@@ -873,2 +881,15 @@ }; | ||
__proto.render = function (e) { | ||
var distX = e.distX, | ||
distY = e.distY, | ||
datas = e.datas; | ||
var startX = datas.startX, | ||
startY = datas.startY; | ||
var tx = Math.min(0, distX); | ||
var ty = Math.min(0, distY); | ||
var width = Math.abs(distX); | ||
var height = Math.abs(distY); | ||
this.target.style.cssText += "display: block;" + ("left:" + startX + "px;top:" + startY + "px;") + ("transform: translate(" + tx + "px, " + ty + "px);") + ("width:" + width + "px;height:" + height + "px;"); | ||
}; | ||
__proto.sameCombiKey = function (e) { | ||
@@ -875,0 +896,0 @@ var toggleContinueSelect = [].concat(this.options.toggleContinueSelect); |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/selecto.git | ||
version: 0.0.27 | ||
version: 0.0.28 | ||
*/ | ||
@@ -339,2 +339,5 @@ (function (global, factory) { | ||
inputEvent = e.inputEvent; | ||
_this.render(e); | ||
var startX = datas.startX, | ||
@@ -346,3 +349,2 @@ startY = datas.startY; | ||
var height = Math.abs(distY); | ||
_this.target.style.cssText += "display: block;" + ("left:" + startX + "px;top:" + startY + "px;") + ("transform: translate(" + tx + "px, " + ty + "px);") + ("width:" + width + "px;height:" + height + "px;"); | ||
var left = startX + tx; | ||
@@ -364,4 +366,2 @@ var top = startY + ty; | ||
_this.dragScroll.drag(e, scrollOptions); | ||
_this.dragScroll.dragAfter(e, scrollOptions); | ||
} | ||
@@ -377,2 +377,5 @@ | ||
inputEvent = _a.inputEvent; | ||
_this.dragScroll.dragEnd(); | ||
_this.target.style.cssText += "display: none;"; | ||
@@ -685,2 +688,7 @@ | ||
_this.dragger.scrollBy(offsetX, offsetY, inputEvent.inputEvent, false); | ||
inputEvent.distX += offsetX; | ||
inputEvent.distY += offsetY; | ||
_this.render(inputEvent); | ||
}); | ||
@@ -870,2 +878,15 @@ }; | ||
__proto.render = function (e) { | ||
var distX = e.distX, | ||
distY = e.distY, | ||
datas = e.datas; | ||
var startX = datas.startX, | ||
startY = datas.startY; | ||
var tx = Math.min(0, distX); | ||
var ty = Math.min(0, distY); | ||
var width = Math.abs(distX); | ||
var height = Math.abs(distY); | ||
this.target.style.cssText += "display: block;" + ("left:" + startX + "px;top:" + startY + "px;") + ("transform: translate(" + tx + "px, " + ty + "px);") + ("width:" + width + "px;height:" + height + "px;"); | ||
}; | ||
__proto.sameCombiKey = function (e) { | ||
@@ -872,0 +893,0 @@ var toggleContinueSelect = [].concat(this.options.toggleContinueSelect); |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/selecto.git | ||
version: 0.0.27 | ||
version: 0.0.28 | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/component"),require("@daybrush/drag"),require("framework-utils"),require("@daybrush/utils"),require("@egjs/children-differ"),require("@scena/dragscroll"),require("keycon"),require("css-styled")):"function"==typeof define&&define.amd?define(["@egjs/component","@daybrush/drag","framework-utils","@daybrush/utils","@egjs/children-differ","@scena/dragscroll","keycon","css-styled"],e):(t=t||self).Selecto=e(t.Component,t.Dragger,t.frameworkUtils,t.utils,t.ChildrenDiffer,t.DragScroll,t.KeyController,t.styled)}(this,function(t,s,a,f,p,l,c,e){"use strict";var u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function g(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=e||{},i=o.className,s=o.style;return{tag:t,className:void 0===i?"":i,style:void 0===s?{}:s,attributes:function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["className","style"]),children:n}}function h(t,e,n){t!==e&&n(t,e)}var y=e("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n"),v="selecto-selection "+y.className,n={target:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object},m=["selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],r=function(e){function t(){this.constructor=n}var n,r;function o(t){void 0===t&&(t={});var y=e.call(this)||this;return y.selectedTargets=[],y.differ=new p,y.dragScroll=new l,y.onDragStart=function(t,e){var n=t.datas,r=t.clientX,o=t.clientY,i=t.inputEvent,s=y.options,a=s.continueSelect,l=s.selectFromInside,c=y.getSelectableTargets(),u=c.map(function(t){var e=t.getBoundingClientRect(),n=e.left,r=e.top;return{left:n,top:r,right:n+e.width,bottom:r+e.height}});n.selectableTargets=c,n.selectableRects=u,n.startSelectedTargets=y.selectedTargets;var d=e||document.elementFromPoint(r,o),g=y.hitTest({left:r,top:o,right:r,bottom:o},r,o,c,u).filter(function(t){return t===d||t.contains(d)}),f=0<g.length;a?g=y.getSelectedTargets(g):y.selectedTargets=[];var h=i.type;if(!(!("mousedown"===h||"touchstart"===h)||y.trigger("dragStart",t)))return!1;if(y.select(g,i,!0),n.startX=r,n.startY=o,n.selectedTargets=g,y.target.style.cssText+="left:"+r+"px;top:"+o+"px",!l&&f)return y.onDragEnd(t),i.preventDefault(),!1;var p=y.options.scrollOptions;return p&&y.dragScroll.dragStart(t,p),!0},y.onDrag=function(t){var e=t.distX,n=t.distY,r=t.datas,o=t.inputEvent,i=r.startX,s=r.startY,a=Math.min(0,e),l=Math.min(0,n),c=Math.abs(e),u=Math.abs(n);y.target.style.cssText+="display: block;left:"+i+"px;top:"+s+"px;transform: translate("+a+"px, "+l+"px);width:"+c+"px;height:"+u+"px;";var d=i+a,g=s+l,f=y.hitTest({left:d,top:g,right:d+c,bottom:g+u},r.startX,r.startY,r.selectableTargets,r.selectableRects),h=y.getSelectedTargets(f),p=y.options.scrollOptions;p&&(y.dragScroll.drag(t,p),y.dragScroll.dragAfter(t,p)),y.select(h,o),r.selectedTargets=h},y.onDragEnd=function(t){var e=t.datas,n=t.inputEvent;y.target.style.cssText+="display: none;",y.selecteEnd(e.startSelectedTargets,e.selectedTargets,n),y.selectedTargets=e.selectedTargets},y.onKeyDown=function(t){y.sameCombiKey(t)&&(y.continueSelect=!0,y.trigger("keydown",{}))},y.onKeyUp=function(t){y.sameCombiKey(t)&&(y.continueSelect=!1,y.trigger("keyup",{}))},y.onBlur=function(){y.toggleContinueSelect&&y.continueSelect&&y.trigger("keyup",{})},y.onDocumentSelectStart=function(t){if(y.dragger.isFlag()){var e=y.dragContainer;e===window&&(e=document.documentElement),e!==t.target&&!e.contains(t.target)||t.preventDefault()}},y.target=t.target,y.container=t.container,y.options=d({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0},t),y.initElement(),y.initDragScroll(),y.setKeyController(),y}u(n=o,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var i=o.prototype;return i.setSelectedTargets=function(t){this.selectedTargets=t,this.differ=new p(t)},i.setKeyContainer=function(t){var e=this,n=this.options;h(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},i.setToggleContinueSelect=function(t){var e=this,n=this.options;h(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},i.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.dragger.unset(),this.injectResult.destroy(),f.removeEvent(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.dragger=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},i.click=function(t,e){var n=function(t){if("touches"in t){var e=t.touches[0];return{clientX:e.clientX,clientY:e.clientY}}return{clientX:t.clientX,clientY:t.clientY}}(t),r={datas:{},clientX:n.clientX,clientY:n.clientY,inputEvent:t};this.onDragStart(r,e)&&this.onDragEnd(r)},i.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new c(e||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},i.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},i.initElement=function(){this.target=function n(t,e,r){var o=t.tag,i=t.children,s=t.attributes,a=t.className,l=t.style,c=e||document.createElement(o);for(var u in s)c.setAttribute(u,s[u]);var d=c.children;if(i.forEach(function(t,e){n(t,d[e],c)}),a&&a.split(" ").forEach(function(t){f.hasClass(c,t)||f.addClass(c,t)}),l){var g=c.style;for(var u in l)g[u]=l[u]}return!e&&r&&r.appendChild(c),c}(g("div",{className:v}),this.target,this.container);var t=this.target;this.dragContainer=this.options.dragContainer||this.target.parentNode,this.dragger=new s(this.dragContainer,{container:window,preventDefault:!1,dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd}),f.addEvent(document,"selectstart",this.onDocumentSelectStart),this.injectResult=y.inject(t)},i.hitTest=function(t,f,h,p,e){var n=this.options,y=n.hitRate,v=n.selectByClick,m=t.left,S=t.top,b=t.right,C=t.bottom,E=[];return e.forEach(function(t,e){var n=t.left,r=t.top,o=t.right,i=t.bottom,s=n<=f&&f<=o&&r<=h&&h<=i,a=(o-n)*(i-r),l=Math.max(n,m),c=Math.min(o,b),u=Math.max(r,S),d=Math.min(i,C);if(v&&s)E.push(p[e]);else if(!(c<l||d<u)){var g=Math.round((c-l)*(d-u)/a*100);y<=g&&E.push(p[e])}}),E},i.initDragScroll=function(){var i=this;this.dragScroll.on("scroll",function(t){var e=t.container,n=t.direction;i.trigger("scroll",{container:e,direction:n})}).on("move",function(t){var e=t.offsetX,n=t.offsetY,r=t.inputEvent,o=r.datas;o.startX-=e,o.startY-=n,o.selectableRects.forEach(function(t){t.top-=n,t.bottom-=n,t.left-=e,t.right-=e}),i.dragger.scrollBy(e,n,r.inputEvent,!1)})},i.getSelectableTargets=function(){var e=[];return this.options.selectableTargets.forEach(function(t){f.isObject(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){e.push(t)})}),e},i.getSelectedTargets=function(t){var e=p.diff(this.selectedTargets,t),n=e.list,r=e.prevList,o=e.added,i=e.removed;return o.map(function(t){return n[t]}).concat(i.map(function(t){return r[t]}))},i.select=function(t,e,n){var r=this.differ.update(t),o=r.added,i=r.removed,s=r.prevList,a=r.list;n&&this.trigger("selectStart",{selected:t,added:o.map(function(t){return a[t]}),removed:i.map(function(t){return s[t]}),inputEvent:e}),(o.length||i.length)&&this.trigger("select",{selected:t,added:o.map(function(t){return a[t]}),removed:i.map(function(t){return s[t]}),inputEvent:e})},i.selecteEnd=function(t,e,n){var r=p.diff(t,e),o=r.added,i=r.removed,s=r.prevList,a=r.list,l=p.diff(this.selectedTargets,e),c=l.added,u=l.removed,d=l.prevList,g=l.list,f=n.type,h="mousedown"===f||"touchstart"===f;this.trigger("selectEnd",{selected:e,added:o.map(function(t){return a[t]}),removed:i.map(function(t){return s[t]}),afterAdded:c.map(function(t){return g[t]}),afterRemoved:u.map(function(t){return d[t]}),isDragStart:h,inputEvent:n})},i.sameCombiKey=function(t){var e=[].concat(this.options.toggleContinueSelect),n=c.getCombi(t.inputEvent,t.key);return e.every(function(t){return-1<n.indexOf(t)})},o=function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;0<=a;a--)(o=t[a])&&(s=(i<3?o(s):3<i?o(e,n,s):o(e,n))||s);return 3<i&&s&&Object.defineProperty(e,n,s),s}([a.Properties(m,function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},r=f.camelize("set "+e);t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)})],o)}(t),o={__proto__:null,default:r,OPTIONS:["dragContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],OPTION_TYPES:n,PROPERTIES:m,EVENTS:["dragStart","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["click","setSelectedTargets"],CLASS_NAME:v};for(var i in o)r[i]=o[i];return r}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/component"),require("@daybrush/drag"),require("framework-utils"),require("@daybrush/utils"),require("@egjs/children-differ"),require("@scena/dragscroll"),require("keycon"),require("css-styled")):"function"==typeof define&&define.amd?define(["@egjs/component","@daybrush/drag","framework-utils","@daybrush/utils","@egjs/children-differ","@scena/dragscroll","keycon","css-styled"],e):(t=t||self).Selecto=e(t.Component,t.Dragger,t.frameworkUtils,t.utils,t.ChildrenDiffer,t.DragScroll,t.KeyController,t.styled)}(this,function(t,s,a,f,p,l,c,e){"use strict";var u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function g(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=e||{},i=o.className,s=o.style;return{tag:t,className:void 0===i?"":i,style:void 0===s?{}:s,attributes:function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["className","style"]),children:n}}function h(t,e,n){t!==e&&n(t,e)}var y=e("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n"),m="selecto-selection "+y.className,n={target:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object},v=["selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],r=function(e){function t(){this.constructor=n}var n,r;function o(t){void 0===t&&(t={});var y=e.call(this)||this;return y.selectedTargets=[],y.differ=new p,y.dragScroll=new l,y.onDragStart=function(t,e){var n=t.datas,r=t.clientX,o=t.clientY,i=t.inputEvent,s=y.options,a=s.continueSelect,l=s.selectFromInside,c=y.getSelectableTargets(),u=c.map(function(t){var e=t.getBoundingClientRect(),n=e.left,r=e.top;return{left:n,top:r,right:n+e.width,bottom:r+e.height}});n.selectableTargets=c,n.selectableRects=u,n.startSelectedTargets=y.selectedTargets;var d=e||document.elementFromPoint(r,o),g=y.hitTest({left:r,top:o,right:r,bottom:o},r,o,c,u).filter(function(t){return t===d||t.contains(d)}),f=0<g.length;a?g=y.getSelectedTargets(g):y.selectedTargets=[];var h=i.type;if(!(!("mousedown"===h||"touchstart"===h)||y.trigger("dragStart",t)))return!1;if(y.select(g,i,!0),n.startX=r,n.startY=o,n.selectedTargets=g,y.target.style.cssText+="left:"+r+"px;top:"+o+"px",!l&&f)return y.onDragEnd(t),i.preventDefault(),!1;var p=y.options.scrollOptions;return p&&y.dragScroll.dragStart(t,p),!0},y.onDrag=function(t){var e=t.distX,n=t.distY,r=t.datas,o=t.inputEvent;y.render(t);var i=r.startX,s=r.startY,a=Math.min(0,e),l=Math.min(0,n),c=Math.abs(e),u=Math.abs(n),d=i+a,g=s+l,f=y.hitTest({left:d,top:g,right:d+c,bottom:g+u},r.startX,r.startY,r.selectableTargets,r.selectableRects),h=y.getSelectedTargets(f),p=y.options.scrollOptions;p&&y.dragScroll.drag(t,p),y.select(h,o),r.selectedTargets=h},y.onDragEnd=function(t){var e=t.datas,n=t.inputEvent;y.dragScroll.dragEnd(),y.target.style.cssText+="display: none;",y.selecteEnd(e.startSelectedTargets,e.selectedTargets,n),y.selectedTargets=e.selectedTargets},y.onKeyDown=function(t){y.sameCombiKey(t)&&(y.continueSelect=!0,y.trigger("keydown",{}))},y.onKeyUp=function(t){y.sameCombiKey(t)&&(y.continueSelect=!1,y.trigger("keyup",{}))},y.onBlur=function(){y.toggleContinueSelect&&y.continueSelect&&y.trigger("keyup",{})},y.onDocumentSelectStart=function(t){if(y.dragger.isFlag()){var e=y.dragContainer;e===window&&(e=document.documentElement),e!==t.target&&!e.contains(t.target)||t.preventDefault()}},y.target=t.target,y.container=t.container,y.options=d({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0},t),y.initElement(),y.initDragScroll(),y.setKeyController(),y}u(n=o,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var i=o.prototype;return i.setSelectedTargets=function(t){this.selectedTargets=t,this.differ=new p(t)},i.setKeyContainer=function(t){var e=this,n=this.options;h(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},i.setToggleContinueSelect=function(t){var e=this,n=this.options;h(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},i.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.dragger.unset(),this.injectResult.destroy(),f.removeEvent(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.dragger=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},i.click=function(t,e){var n=function(t){if("touches"in t){var e=t.touches[0];return{clientX:e.clientX,clientY:e.clientY}}return{clientX:t.clientX,clientY:t.clientY}}(t),r={datas:{},clientX:n.clientX,clientY:n.clientY,inputEvent:t};this.onDragStart(r,e)&&this.onDragEnd(r)},i.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new c(e||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},i.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},i.initElement=function(){this.target=function n(t,e,r){var o=t.tag,i=t.children,s=t.attributes,a=t.className,l=t.style,c=e||document.createElement(o);for(var u in s)c.setAttribute(u,s[u]);var d=c.children;if(i.forEach(function(t,e){n(t,d[e],c)}),a&&a.split(" ").forEach(function(t){f.hasClass(c,t)||f.addClass(c,t)}),l){var g=c.style;for(var u in l)g[u]=l[u]}return!e&&r&&r.appendChild(c),c}(g("div",{className:m}),this.target,this.container);var t=this.target;this.dragContainer=this.options.dragContainer||this.target.parentNode,this.dragger=new s(this.dragContainer,{container:window,preventDefault:!1,dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd}),f.addEvent(document,"selectstart",this.onDocumentSelectStart),this.injectResult=y.inject(t)},i.hitTest=function(t,f,h,p,e){var n=this.options,y=n.hitRate,m=n.selectByClick,v=t.left,S=t.top,b=t.right,C=t.bottom,E=[];return e.forEach(function(t,e){var n=t.left,r=t.top,o=t.right,i=t.bottom,s=n<=f&&f<=o&&r<=h&&h<=i,a=(o-n)*(i-r),l=Math.max(n,v),c=Math.min(o,b),u=Math.max(r,S),d=Math.min(i,C);if(m&&s)E.push(p[e]);else if(!(c<l||d<u)){var g=Math.round((c-l)*(d-u)/a*100);y<=g&&E.push(p[e])}}),E},i.initDragScroll=function(){var i=this;this.dragScroll.on("scroll",function(t){var e=t.container,n=t.direction;i.trigger("scroll",{container:e,direction:n})}).on("move",function(t){var e=t.offsetX,n=t.offsetY,r=t.inputEvent,o=r.datas;o.startX-=e,o.startY-=n,o.selectableRects.forEach(function(t){t.top-=n,t.bottom-=n,t.left-=e,t.right-=e}),i.dragger.scrollBy(e,n,r.inputEvent,!1),r.distX+=e,r.distY+=n,i.render(r)})},i.getSelectableTargets=function(){var e=[];return this.options.selectableTargets.forEach(function(t){f.isObject(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){e.push(t)})}),e},i.getSelectedTargets=function(t){var e=p.diff(this.selectedTargets,t),n=e.list,r=e.prevList,o=e.added,i=e.removed;return o.map(function(t){return n[t]}).concat(i.map(function(t){return r[t]}))},i.select=function(t,e,n){var r=this.differ.update(t),o=r.added,i=r.removed,s=r.prevList,a=r.list;n&&this.trigger("selectStart",{selected:t,added:o.map(function(t){return a[t]}),removed:i.map(function(t){return s[t]}),inputEvent:e}),(o.length||i.length)&&this.trigger("select",{selected:t,added:o.map(function(t){return a[t]}),removed:i.map(function(t){return s[t]}),inputEvent:e})},i.selecteEnd=function(t,e,n){var r=p.diff(t,e),o=r.added,i=r.removed,s=r.prevList,a=r.list,l=p.diff(this.selectedTargets,e),c=l.added,u=l.removed,d=l.prevList,g=l.list,f=n.type,h="mousedown"===f||"touchstart"===f;this.trigger("selectEnd",{selected:e,added:o.map(function(t){return a[t]}),removed:i.map(function(t){return s[t]}),afterAdded:c.map(function(t){return g[t]}),afterRemoved:u.map(function(t){return d[t]}),isDragStart:h,inputEvent:n})},i.render=function(t){var e=t.distX,n=t.distY,r=t.datas,o=r.startX,i=r.startY,s=Math.min(0,e),a=Math.min(0,n),l=Math.abs(e),c=Math.abs(n);this.target.style.cssText+="display: block;left:"+o+"px;top:"+i+"px;transform: translate("+s+"px, "+a+"px);width:"+l+"px;height:"+c+"px;"},i.sameCombiKey=function(t){var e=[].concat(this.options.toggleContinueSelect),n=c.getCombi(t.inputEvent,t.key);return e.every(function(t){return-1<n.indexOf(t)})},o=function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;0<=a;a--)(o=t[a])&&(s=(i<3?o(s):3<i?o(e,n,s):o(e,n))||s);return 3<i&&s&&Object.defineProperty(e,n,s),s}([a.Properties(v,function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},r=f.camelize("set "+e);t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)})],o)}(t),o={__proto__:null,default:r,OPTIONS:["dragContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],OPTION_TYPES:n,PROPERTIES:v,EVENTS:["dragStart","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["click","setSelectedTargets"],CLASS_NAME:m};for(var i in o)r[i]=o[i];return r}); | ||
//# sourceMappingURL=selecto.min.js.map |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/selecto.git | ||
version: 0.0.27 | ||
version: 0.0.28 | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Selecto=e()}(this,function(){"use strict";var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t){return void 0===t}var t=function(){var t=function(){function t(){this._eventHandler={},this.options={}}var e=t.prototype;return e.trigger=function(t,e){void 0===e&&(e={});var n=this._eventHandler[t]||[];if(!(0<n.length))return!0;n=n.concat(),e.eventType=t;var r=!1,i=[e],o=0;e.stop=function(){r=!0},e.currentTarget=this;for(var s=arguments.length,a=new Array(2<s?s-2:0),c=2;c<s;c++)a[c-2]=arguments[c];for(1<=a.length&&(i=i.concat(a)),o=0;n[o];o++)n[o].apply(this,i);return!r},e.once=function(i,o){if("object"==typeof i&&a(o)){var t,e=i;for(t in e)this.once(t,e[t]);return this}if("string"==typeof i&&"function"==typeof o){var s=this;this.on(i,function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];o.apply(s,n),s.off(i,t)})}return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&a(e)){var n,r=t;for(n in r)this.on(n,r[n]);return this}if("string"==typeof t&&"function"==typeof e){var i=this._eventHandler[t];a(i)&&(this._eventHandler[t]=[],i=this._eventHandler[t]),i.push(e)}return this},e.off=function(t,e){if(a(t))return this._eventHandler={},this;if(a(e)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var n,r=t;for(n in r)this.off(n,r[n]);return this}var i,o,s=this._eventHandler[t];if(s)for(i=0;void 0!==(o=s[i]);i++)if(o===e){s=s.splice(i,1);break}return this},t}();return t.VERSION="2.1.2",t}();function u(t,e,n,r){t.addEventListener(e,n,r)}function h(t,e,n){t.removeEventListener(e,n)}var f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function d(t,e,n,r){var i=C(t),o=C(e),s=C(r);return g(b(r[0],E(i,s)),b(r[0],E(o,s)),n[0])}function p(t){return t.touches?m(t.touches):[i(t)]}function g(t,e,n){var r=t.clientX,i=t.clientY;return{clientX:r,clientY:i,deltaX:r-e.clientX,deltaY:i-e.clientY,distX:r-n.clientX,distY:i-n.clientY}}function v(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function y(t,n,r){return t.map(function(t,e){return g(t,n[e],r[e])})}function m(t){for(var e=Math.min(t.length,2),n=[],r=0;r<e;++r)n.push(i(t[r]));return n}function i(t){return{clientX:t.clientX,clientY:t.clientY}}function C(t){return{clientX:(t[0].clientX+t[1].clientX)/2,clientY:(t[0].clientY+t[1].clientY)/2}}function b(t,e){return{clientX:t.clientX+e.clientX,clientY:t.clientY+e.clientY}}function E(t,e){return{clientX:t.clientX-e.clientX,clientY:t.clientY-e.clientY}}var S=function(){function t(t,e){var c=this;void 0===e&&(e={}),this.el=t,this.options={},this.flag=!1,this.pinchFlag=!1,this.datas={},this.isDrag=!1,this.isPinch=!1,this.isMouse=!1,this.isTouch=!1,this.prevClients=[],this.startClients=[],this.movement=0,this.startPinchClients=[],this.startDistance=0,this.customDist=[0,0],this.onDragStart=function(t){if(c.flag||!1!==t.cancelable){if((e=t).touches&&2<=e.touches.length){if(!c.flag&&t.touches.length!==t.changedTouches.length)return;c.pinchFlag||c.onPinchStart(t)}var e;if(!c.flag){var n=c.startClients[0]?c.startClients:p(t);c.customDist=[0,0],c.flag=!0,c.isDrag=!1,c.startClients=n,c.prevClients=n,c.datas={};var r=g(n[c.movement=0],c.prevClients[0],c.startClients[0]),i=c.options,o=i.dragstart,s=i.preventRightClick,a=i.preventDefault;(s&&3===t.which||!1===(o&&o(f({datas:c.datas,inputEvent:t},r))))&&(c.startClients=[],c.prevClients=[],c.flag=!1),c.flag&&a&&t.preventDefault()}}},this.onDrag=function(t,e){if(c.flag){var n=p(t);c.pinchFlag&&c.onPinch(t,n);var r=c.move([0,0],t,n);if(r&&(r.deltaX||r.deltaY)){var i=c.options.drag;i&&i(f({},r,{isScroll:!!e,inputEvent:t}))}}},this.onDragEnd=function(t){if(c.flag){c.pinchFlag&&c.onPinchEnd(t),c.flag=!1;var e=c.options.dragend,n=c.prevClients,r=c.startClients,i=c.pinchFlag?d(n,n,r,c.startPinchClients):g(n[0],n[0],r[0]);c.startClients=[],c.prevClients=[],e&&e(f({datas:c.datas,isDrag:c.isDrag,inputEvent:t},i))}},this.options=f({container:t,preventRightClick:!0,preventDefault:!0,pinchThreshold:0,events:["touch","mouse"]},e);var n=this.options,r=n.container,i=n.events;if(this.isTouch=-1<i.indexOf("touch"),this.isMouse=-1<i.indexOf("mouse"),this.customDist=[0,0],this.isMouse&&(u(t,"mousedown",this.onDragStart),u(r,"mousemove",this.onDrag),u(r,"mouseup",this.onDragEnd)),this.isTouch){var o={passive:!1};u(t,"touchstart",this.onDragStart,o),u(r,"touchmove",this.onDrag,o),u(r,"touchend",this.onDragEnd,o)}}var e=t.prototype;return e.isDragging=function(){return this.isDrag},e.isFlag=function(){return this.flag},e.isPinching=function(){return this.isPinch},e.scrollBy=function(e,n,t,r){void 0===r&&(r=!0),this.flag&&(this.startClients.forEach(function(t){t.clientX-=e,t.clientY-=n}),this.prevClients.forEach(function(t){t.clientX-=e,t.clientY-=n}),r&&this.onDrag(t,!0))},e.move=function(t,e,n){var r=t[0],i=t[1];void 0===n&&(n=this.prevClients);var o=this.customDist,s=this.prevClients,a=this.startClients,c=this.pinchFlag?d(n,s,a,this.startPinchClients):g(n[0],s[0],a[0]);o[0]+=r,o[1]+=i,c.deltaX+=r,c.deltaY+=i;var l=c.deltaX,u=c.deltaY;return c.distX+=o[0],c.distY+=o[1],this.movement+=Math.sqrt(l*l+u*u),this.prevClients=n,this.isDrag=!0,f({datas:this.datas},c,{isScroll:!1,inputEvent:e})},e.onPinchStart=function(t){var e,n,r=this.options,i=r.pinchstart,o=r.pinchThreshold;if(!(this.isDrag&&this.movement>o)){var s=m(t.changedTouches);if(this.pinchFlag=!0,(e=this.startClients).push.apply(e,s),(n=this.prevClients).push.apply(n,s),this.startDistance=v(this.prevClients),this.startPinchClients=this.prevClients.slice(),i){var a=this.prevClients,c=C(a),l=g(c,c,c);i(f({datas:this.datas,touches:y(a,a,a)},l,{inputEvent:t}))}}},e.onPinch=function(t,e){if(this.flag&&this.pinchFlag){this.isPinch=!0;var n=this.options.pinch;if(n){var r=this.prevClients,i=this.startClients,o=g(C(e),C(r),C(i)),s=v(e);n(f({datas:this.datas,touches:y(e,r,i),scale:s/this.startDistance,distance:s},o,{inputEvent:t}))}}},e.onPinchEnd=function(t){if(this.flag&&this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.options.pinchend;if(n){var r=this.prevClients,i=this.startClients,o=g(C(r),C(r),C(i));n(f({datas:this.datas,isPinch:e,touches:y(r,r,i)},o,{inputEvent:t})),this.isPinch=!1,this.pinchFlag=!1}}},e.unset=function(){var t=this.el,e=this.options.container;this.isMouse&&(h(t,"mousedown",this.onDragStart),h(e,"mousemove",this.onDrag),h(e,"mouseup",this.onDragEnd)),this.isTouch&&(h(t,"touchstart",this.onDragStart),h(e,"touchmove",this.onDrag),h(e,"touchend",this.onDragEnd))},t}();var w=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),k=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),O="function"==typeof Map,o=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var D=function(){function t(t,e,n,r,i,o,s,a){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=s,this.fixed=a}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t,n,a,c,e=(t=this.changedBeforeAdded,n=this.fixed,a=[],c=[],t.forEach(function(t){var e=t[0],n=t[1],r=new o;a[e]=r,c[n]=r}),a.forEach(function(t,e){t.connect(a[e-1])}),t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],r=t[1];if(n===r)return[0,0];var i=a[n],o=c[r-1],s=i.getIndex();return i.disconnect(),o?i.connect(o,o.next):i.connect(void 0,a[0]),[s,i.getIndex()]})),l=this.changed,u=[];this.cacheOrdered=e.filter(function(t,e){var n=t[0],r=t[1],i=l[e],o=i[0],s=i[1];if(n!==r)return u.push([o,s]),!0}),this.cachePureChanged=u},t}();function r(t,e,n){var r=O?Map:n?k:w,i=n||function(t){return t},o=[],s=[],a=[],c=t.map(i),l=e.map(i),u=new r,h=new r,f=[],d=[],p={},g=[],v=0,y=0;return c.forEach(function(t,e){u.set(t,e)}),l.forEach(function(t,e){h.set(t,e)}),c.forEach(function(t,e){var n=h.get(t);void 0===n?(++y,s.push(e)):p[n]=y}),l.forEach(function(t,e){var n=u.get(t);void 0===n?(o.push(e),++v):(a.push([n,e]),y=p[e]||0,f.push([n-y,e-v]),d.push(e===n),n!==e&&g.push([n,e]))}),s.reverse(),new D(t,e,o,s,g,a,f,d)}var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var e,_="function"==typeof Map?void 0:(e=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)}),P=function(e){function t(){this.constructor=n}var n,r;function i(t){return void 0===t&&(t=[]),e.call(this,t,_)||this}return s(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t),i}(function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),n=r(this.list,e,this.findKeyCallback);return this.list=e,n},t}());function T(t,e){return r(t,e,_)}var K=function(t,e){return(K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function x(t){var e=t.container;return[e.scrollLeft,e.scrollTop]}var Y=function(e){function t(){this.constructor=n}var n,r;function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.prevDirection=null,t.startPos=[],t.prevPos=[],t}K(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return o.dragStart=function(t,e){var n=e.container.getBoundingClientRect(),r=n.top,i=n.left,o=n.width,s=n.height;this.startPos=[t.clientX,t.clientY],this.startRect={top:r,left:i,width:o,height:s}},o.drag=function(t,e){var n=t.clientX,r=t.clientY;this.prevDirection=null;var i=e.container,o=e.threshold,s=void 0===o?0:o,a=e.getScrollPosition,c=void 0===a?x:a,l=this.startRect,u=this.startPos,h=[0,0];return l.top>r-s?(u[1]>l.top||r<u[1])&&(h[1]=-1):l.top+l.height<r+s&&(u[1]<l.top+l.height||r>u[1])&&(h[1]=1),l.left>n-s?(u[0]>l.left||n<u[0])&&(h[0]=-1):l.left+l.width<n+s&&(u[0]<l.left+l.width||n>u[0])&&(h[0]=1),!(!h[0]&&!h[1])&&(this.prevDirection=h,this.prevPos=c({container:i,direction:h}),this.trigger("scroll",{container:i,direction:h,inputEvent:t}),!0)},o.dragAfter=function(t,e){var n=this.prevPos,r=this.prevDirection;if(!this.prevDirection)return!1;var i=e.container,o=e.getScrollPosition,s=(void 0===o?x:o)({container:i,direction:r}),a=s[0]-n[0],c=s[1]-n[1];return!(!a&&!c)&&(this.trigger("move",{offsetX:r[0]?a:0,offsetY:r[1]?c:0,inputEvent:t}),!0)},i}(t),j=function(t,e){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var n,X=(function(t,e){function n(t){if(t&&"object"==typeof t){var e=t.which||t.keyCode||t.charCode;e&&(t=e)}if("number"==typeof t)return s[t];var n,r=String(t);return(n=i[r.toLowerCase()])?n:(n=o[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(t,e){if(t&&"object"==typeof t){var n=t.which||t.keyCode||t.charCode;if(null==n)return!1;if("string"==typeof e){var r;if(r=i[e.toLowerCase()])return r===n;if(r=o[e.toLowerCase()])return r===n}else if("number"==typeof e)return e===n;return!1}};var i=(e=t.exports=n).code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)i[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)i[r-48]=r;for(r=1;r<13;r++)i["f"+r]=r+111;for(r=0;r<10;r++)i["numpad "+r]=r+96;var s=e.names=e.title={};for(r in i)s[i[r]]=r;for(var a in o)i[a]=o[a]}(n={exports:{}},n.exports),n.exports),R=(X.code,X.codes,X.aliases,X.names);X.title;function M(t){return Array.isArray(t)}function F(t){return"string"==typeof t}function A(t,e,n,r){t.addEventListener(e,n,r)}function L(t,e,n){t.removeEventListener(e,n)}var N,B={"+":"plus","left command":"meta","right command":"meta"},I={shift:1,ctrl:2,alt:3,meta:4};function H(t){var e=R[t]||"";for(var n in B)e=e.replace(n,B[n]);return e.replace(/\s/g,"")}function q(t,e){void 0===e&&(e=H(t.keyCode));var n=[t.shiftKey&&"shift",t.ctrlKey&&"ctrl",t.altKey&&"alt",t.metaKey&&"meta"];return-1===n.indexOf(e)&&n.push(e),n.filter(Boolean)}function U(t){var e=t.slice();return e.sort(function(t,e){return(I[t]||5)-(I[e]||5)}),e}var z=function(n){function t(){this.constructor=e}var e,r;function i(t){void 0===t&&(t=window);var e=n.call(this)||this;return e.container=t,e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e.clear=function(){return e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e},e.keydownEvent=function(t){e.triggerEvent("keydown",t)},e.keyupEvent=function(t){e.triggerEvent("keyup",t)},e.blur=function(){e.clear(),e.trigger("blur")},A(t,"blur",e.blur),A(t,"keydown",e.keydownEvent),A(t,"keyup",e.keyupEvent),e}j(e=i,r=n),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return Object.defineProperty(i,"global",{get:function(){return N=N||new i},enumerable:!0,configurable:!0}),i.setGlobal=function(){return this.global},o.destroy=function(){var t=this.container;this.clear(),this.off(),L(t,"blur",this.blur),L(t,"keydown",this.keydownEvent),L(t,"keyup",this.keyupEvent)},o.keydown=function(t,e){return this.addEvent("keydown",t,e)},o.offKeydown=function(t,e){return this.removeEvent("keydown",t,e)},o.offKeyup=function(t,e){return this.removeEvent("keyup",t,e)},o.keyup=function(t,e){return this.addEvent("keyup",t,e)},o.addEvent=function(t,e,n){return M(e)?this.on(t+"."+U(e).join("."),n):F(e)?this.on(t+"."+e,n):this.on(t,e),this},o.removeEvent=function(t,e,n){return M(e)?this.off(t+"."+U(e).join("."),n):F(e)?this.off(t+"."+e,n):this.off(t,e),this},o.triggerEvent=function(t,e){this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey;var n=H(e.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:e,keyCode:e.keyCode,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey};this.trigger(t,r),this.trigger(t+"."+n,r);var i=q(e,n);1<i.length&&this.trigger(t+"."+i.join("."),r)},i}(t);function V(t,e,n){var r=t.tag,i=t.children,o=t.attributes,s=t.className,a=t.style,c=e||document.createElement(r);for(var l in o)c.setAttribute(l,o[l]);var u=c.children;if(i.forEach(function(t,e){V(t,u[e],c)}),s&&s.split(" ").forEach(function(t){var e,n,r,i;i=t,((r=c).classList?r.classList.contains(i):r.className.match(new RegExp("(\\s|^)"+i+"(\\s|$)")))||(n=t,(e=c).classList?e.classList.add(n):e.className+=" "+n)}),a){var h=c.style;for(var l in a)h[l]=a[l]}return!e&&n&&n.appendChild(c),c}function G(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e||{},o=i.className,s=i.style;return{tag:t,className:void 0===o?"":o,style:void 0===s?{}:s,attributes:function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["className","style"]),children:n}}function $(t,e,n){t!==e&&n(t,e)}function J(r,t,e){var n=document.createElement("style");return n.setAttribute("type","text/css"),n.innerHTML=t.replace(/([^}{]*){/gm,function(t,e){return((n=e.match(/("[^"]*"|'[^']*'|[^,\s()]*\((?:[^()]*|\([^()]*\))*\)[^,\s()]*|[^,])+/g))?n.map(function(t){return t.trim()}):[]).map(function(t){return-1<t.indexOf(":global")?t.replace(/\:global/g,""):-1<t.indexOf(":host")?""+t.replace(/\:host/g,"."+r):"."+r+" "+t}).join(", ")+"{";var n}),(e||document.head||document.body).appendChild(n),n}var Q,W,Z,tt,et=(Z="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(Q="\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n").toString(36),tt=0,{className:Z,inject:function(t){var e,n=function(t){if(t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(t),r=0===tt;return(n||r)&&(e=J(Z,Q,n)),r&&(W=e),n||++tt,{destroy:function(){n?(t.removeChild(e),e=null):(0<tt&&--tt,0===tt&&W&&(W.parentNode.removeChild(W),W=null))}}}}),nt="selecto-selection "+et.className,rt={target:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object},it=["selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],ot=function(e){function t(){this.constructor=n}var n,r;function i(t){void 0===t&&(t={});var v=e.call(this)||this;return v.selectedTargets=[],v.differ=new P,v.dragScroll=new Y,v.onDragStart=function(t,e){var n=t.datas,r=t.clientX,i=t.clientY,o=t.inputEvent,s=v.options,a=s.continueSelect,c=s.selectFromInside,l=v.getSelectableTargets(),u=l.map(function(t){var e=t.getBoundingClientRect(),n=e.left,r=e.top;return{left:n,top:r,right:n+e.width,bottom:r+e.height}});n.selectableTargets=l,n.selectableRects=u,n.startSelectedTargets=v.selectedTargets;var h=e||document.elementFromPoint(r,i),f=v.hitTest({left:r,top:i,right:r,bottom:i},r,i,l,u).filter(function(t){return t===h||t.contains(h)}),d=0<f.length;a?f=v.getSelectedTargets(f):v.selectedTargets=[];var p=o.type;if(!(!("mousedown"===p||"touchstart"===p)||v.trigger("dragStart",t)))return!1;if(v.select(f,o,!0),n.startX=r,n.startY=i,n.selectedTargets=f,v.target.style.cssText+="left:"+r+"px;top:"+i+"px",!c&&d)return v.onDragEnd(t),o.preventDefault(),!1;var g=v.options.scrollOptions;return g&&v.dragScroll.dragStart(t,g),!0},v.onDrag=function(t){var e=t.distX,n=t.distY,r=t.datas,i=t.inputEvent,o=r.startX,s=r.startY,a=Math.min(0,e),c=Math.min(0,n),l=Math.abs(e),u=Math.abs(n);v.target.style.cssText+="display: block;left:"+o+"px;top:"+s+"px;transform: translate("+a+"px, "+c+"px);width:"+l+"px;height:"+u+"px;";var h=o+a,f=s+c,d=v.hitTest({left:h,top:f,right:h+l,bottom:f+u},r.startX,r.startY,r.selectableTargets,r.selectableRects),p=v.getSelectedTargets(d),g=v.options.scrollOptions;g&&(v.dragScroll.drag(t,g),v.dragScroll.dragAfter(t,g)),v.select(p,i),r.selectedTargets=p},v.onDragEnd=function(t){var e=t.datas,n=t.inputEvent;v.target.style.cssText+="display: none;",v.selecteEnd(e.startSelectedTargets,e.selectedTargets,n),v.selectedTargets=e.selectedTargets},v.onKeyDown=function(t){v.sameCombiKey(t)&&(v.continueSelect=!0,v.trigger("keydown",{}))},v.onKeyUp=function(t){v.sameCombiKey(t)&&(v.continueSelect=!1,v.trigger("keyup",{}))},v.onBlur=function(){v.toggleContinueSelect&&v.continueSelect&&v.trigger("keyup",{})},v.onDocumentSelectStart=function(t){if(v.dragger.isFlag()){var e=v.dragContainer;e===window&&(e=document.documentElement),e!==t.target&&!e.contains(t.target)||t.preventDefault()}},v.target=t.target,v.container=t.container,v.options=l({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0},t),v.initElement(),v.initDragScroll(),v.setKeyController(),v}c(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o,s,a=i.prototype;return a.setSelectedTargets=function(t){this.selectedTargets=t,this.differ=new P(t)},a.setKeyContainer=function(t){var e=this,n=this.options;$(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},a.setToggleContinueSelect=function(t){var e=this,n=this.options;$(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},a.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.dragger.unset(),this.injectResult.destroy(),h(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.dragger=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},a.click=function(t,e){var n=function(t){if("touches"in t){var e=t.touches[0];return{clientX:e.clientX,clientY:e.clientY}}return{clientX:t.clientX,clientY:t.clientY}}(t),r={datas:{},clientX:n.clientX,clientY:n.clientY,inputEvent:t};this.onDragStart(r,e)&&this.onDragEnd(r)},a.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new z(e||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},a.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},a.initElement=function(){this.target=V(G("div",{className:nt}),this.target,this.container);var t=this.target;this.dragContainer=this.options.dragContainer||this.target.parentNode,this.dragger=new S(this.dragContainer,{container:window,preventDefault:!1,dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd}),u(document,"selectstart",this.onDocumentSelectStart),this.injectResult=et.inject(t)},a.hitTest=function(t,d,p,g,e){var n=this.options,v=n.hitRate,y=n.selectByClick,m=t.left,C=t.top,b=t.right,E=t.bottom,S=[];return e.forEach(function(t,e){var n=t.left,r=t.top,i=t.right,o=t.bottom,s=n<=d&&d<=i&&r<=p&&p<=o,a=(i-n)*(o-r),c=Math.max(n,m),l=Math.min(i,b),u=Math.max(r,C),h=Math.min(o,E);if(y&&s)S.push(g[e]);else if(!(l<c||h<u)){var f=Math.round((l-c)*(h-u)/a*100);v<=f&&S.push(g[e])}}),S},a.initDragScroll=function(){var o=this;this.dragScroll.on("scroll",function(t){var e=t.container,n=t.direction;o.trigger("scroll",{container:e,direction:n})}).on("move",function(t){var e=t.offsetX,n=t.offsetY,r=t.inputEvent,i=r.datas;i.startX-=e,i.startY-=n,i.selectableRects.forEach(function(t){t.top-=n,t.bottom-=n,t.left-=e,t.right-=e}),o.dragger.scrollBy(e,n,r.inputEvent,!1)})},a.getSelectableTargets=function(){var n=[];return this.options.selectableTargets.forEach(function(t){var e;(e=t)&&"object"==typeof e?n.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){n.push(t)})}),n},a.getSelectedTargets=function(t){var e=T(this.selectedTargets,t),n=e.list,r=e.prevList,i=e.added,o=e.removed;return i.map(function(t){return n[t]}).concat(o.map(function(t){return r[t]}))},a.select=function(t,e,n){var r=this.differ.update(t),i=r.added,o=r.removed,s=r.prevList,a=r.list;n&&this.trigger("selectStart",{selected:t,added:i.map(function(t){return a[t]}),removed:o.map(function(t){return s[t]}),inputEvent:e}),(i.length||o.length)&&this.trigger("select",{selected:t,added:i.map(function(t){return a[t]}),removed:o.map(function(t){return s[t]}),inputEvent:e})},a.selecteEnd=function(t,e,n){var r=T(t,e),i=r.added,o=r.removed,s=r.prevList,a=r.list,c=T(this.selectedTargets,e),l=c.added,u=c.removed,h=c.prevList,f=c.list,d=n.type,p="mousedown"===d||"touchstart"===d;this.trigger("selectEnd",{selected:e,added:i.map(function(t){return a[t]}),removed:o.map(function(t){return s[t]}),afterAdded:l.map(function(t){return f[t]}),afterRemoved:u.map(function(t){return h[t]}),isDragStart:p,inputEvent:n})},a.sameCombiKey=function(t){var e=[].concat(this.options.toggleContinueSelect),n=q(t.inputEvent,t.key);return e.every(function(t){return-1<n.indexOf(t)})},i=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;0<=a;a--)(i=t[a])&&(s=(o<3?i(s):3<o?i(e,n,s):i(e,n))||s);return 3<o&&s&&Object.defineProperty(e,n,s),s}([(o=it,s=function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},r=("set "+e).replace(/[\s-_]([a-z])/g,function(t,e){return e.toUpperCase()});t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)},function(t){var e=t.prototype;o.forEach(function(t){s(e,t)})})],i)}(t),st={__proto__:null,default:ot,OPTIONS:["dragContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],OPTION_TYPES:rt,PROPERTIES:it,EVENTS:["dragStart","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["click","setSelectedTargets"],CLASS_NAME:nt};for(var at in st)ot[at]=st[at];return ot}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Selecto=e()}(this,function(){"use strict";var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t){return void 0===t}var t=function(){var t=function(){function t(){this._eventHandler={},this.options={}}var e=t.prototype;return e.trigger=function(t,e){void 0===e&&(e={});var n=this._eventHandler[t]||[];if(!(0<n.length))return!0;n=n.concat(),e.eventType=t;var i=!1,r=[e],o=0;e.stop=function(){i=!0},e.currentTarget=this;for(var s=arguments.length,a=new Array(2<s?s-2:0),c=2;c<s;c++)a[c-2]=arguments[c];for(1<=a.length&&(r=r.concat(a)),o=0;n[o];o++)n[o].apply(this,r);return!i},e.once=function(r,o){if("object"==typeof r&&a(o)){var t,e=r;for(t in e)this.once(t,e[t]);return this}if("string"==typeof r&&"function"==typeof o){var s=this;this.on(r,function t(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];o.apply(s,n),s.off(r,t)})}return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&a(e)){var n,i=t;for(n in i)this.on(n,i[n]);return this}if("string"==typeof t&&"function"==typeof e){var r=this._eventHandler[t];a(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)}return this},e.off=function(t,e){if(a(t))return this._eventHandler={},this;if(a(e)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var n,i=t;for(n in i)this.off(n,i[n]);return this}var r,o,s=this._eventHandler[t];if(s)for(r=0;void 0!==(o=s[r]);r++)if(o===e){s=s.splice(r,1);break}return this},t}();return t.VERSION="2.1.2",t}();function u(t,e,n,i){t.addEventListener(e,n,i)}function h(t,e,n){t.removeEventListener(e,n)}var f=function(){return(f=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function d(t,e,n,i){var r=C(t),o=C(e),s=C(i);return g(b(i[0],E(r,s)),b(i[0],E(o,s)),n[0])}function p(t){return t.touches?m(t.touches):[r(t)]}function g(t,e,n){var i=t.clientX,r=t.clientY;return{clientX:i,clientY:r,deltaX:i-e.clientX,deltaY:r-e.clientY,distX:i-n.clientX,distY:r-n.clientY}}function v(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function y(t,n,i){return t.map(function(t,e){return g(t,n[e],i[e])})}function m(t){for(var e=Math.min(t.length,2),n=[],i=0;i<e;++i)n.push(r(t[i]));return n}function r(t){return{clientX:t.clientX,clientY:t.clientY}}function C(t){return{clientX:(t[0].clientX+t[1].clientX)/2,clientY:(t[0].clientY+t[1].clientY)/2}}function b(t,e){return{clientX:t.clientX+e.clientX,clientY:t.clientY+e.clientY}}function E(t,e){return{clientX:t.clientX-e.clientX,clientY:t.clientY-e.clientY}}var w=function(){function t(t,e){var c=this;void 0===e&&(e={}),this.el=t,this.options={},this.flag=!1,this.pinchFlag=!1,this.datas={},this.isDrag=!1,this.isPinch=!1,this.isMouse=!1,this.isTouch=!1,this.prevClients=[],this.startClients=[],this.movement=0,this.startPinchClients=[],this.startDistance=0,this.customDist=[0,0],this.onDragStart=function(t){if(c.flag||!1!==t.cancelable){if((e=t).touches&&2<=e.touches.length){if(!c.flag&&t.touches.length!==t.changedTouches.length)return;c.pinchFlag||c.onPinchStart(t)}var e;if(!c.flag){var n=c.startClients[0]?c.startClients:p(t);c.customDist=[0,0],c.flag=!0,c.isDrag=!1,c.startClients=n,c.prevClients=n,c.datas={};var i=g(n[c.movement=0],c.prevClients[0],c.startClients[0]),r=c.options,o=r.dragstart,s=r.preventRightClick,a=r.preventDefault;(s&&3===t.which||!1===(o&&o(f({datas:c.datas,inputEvent:t},i))))&&(c.startClients=[],c.prevClients=[],c.flag=!1),c.flag&&a&&t.preventDefault()}}},this.onDrag=function(t,e){if(c.flag){var n=p(t);c.pinchFlag&&c.onPinch(t,n);var i=c.move([0,0],t,n);if(i&&(i.deltaX||i.deltaY)){var r=c.options.drag;r&&r(f({},i,{isScroll:!!e,inputEvent:t}))}}},this.onDragEnd=function(t){if(c.flag){c.pinchFlag&&c.onPinchEnd(t),c.flag=!1;var e=c.options.dragend,n=c.prevClients,i=c.startClients,r=c.pinchFlag?d(n,n,i,c.startPinchClients):g(n[0],n[0],i[0]);c.startClients=[],c.prevClients=[],e&&e(f({datas:c.datas,isDrag:c.isDrag,inputEvent:t},r))}},this.options=f({container:t,preventRightClick:!0,preventDefault:!0,pinchThreshold:0,events:["touch","mouse"]},e);var n=this.options,i=n.container,r=n.events;if(this.isTouch=-1<r.indexOf("touch"),this.isMouse=-1<r.indexOf("mouse"),this.customDist=[0,0],this.isMouse&&(u(t,"mousedown",this.onDragStart),u(i,"mousemove",this.onDrag),u(i,"mouseup",this.onDragEnd)),this.isTouch){var o={passive:!1};u(t,"touchstart",this.onDragStart,o),u(i,"touchmove",this.onDrag,o),u(i,"touchend",this.onDragEnd,o)}}var e=t.prototype;return e.isDragging=function(){return this.isDrag},e.isFlag=function(){return this.flag},e.isPinching=function(){return this.isPinch},e.scrollBy=function(e,n,t,i){void 0===i&&(i=!0),this.flag&&(this.startClients.forEach(function(t){t.clientX-=e,t.clientY-=n}),this.prevClients.forEach(function(t){t.clientX-=e,t.clientY-=n}),i&&this.onDrag(t,!0))},e.move=function(t,e,n){var i=t[0],r=t[1];void 0===n&&(n=this.prevClients);var o=this.customDist,s=this.prevClients,a=this.startClients,c=this.pinchFlag?d(n,s,a,this.startPinchClients):g(n[0],s[0],a[0]);o[0]+=i,o[1]+=r,c.deltaX+=i,c.deltaY+=r;var l=c.deltaX,u=c.deltaY;return c.distX+=o[0],c.distY+=o[1],this.movement+=Math.sqrt(l*l+u*u),this.prevClients=n,this.isDrag=!0,f({datas:this.datas},c,{isScroll:!1,inputEvent:e})},e.onPinchStart=function(t){var e,n,i=this.options,r=i.pinchstart,o=i.pinchThreshold;if(!(this.isDrag&&this.movement>o)){var s=m(t.changedTouches);if(this.pinchFlag=!0,(e=this.startClients).push.apply(e,s),(n=this.prevClients).push.apply(n,s),this.startDistance=v(this.prevClients),this.startPinchClients=this.prevClients.slice(),r){var a=this.prevClients,c=C(a),l=g(c,c,c);r(f({datas:this.datas,touches:y(a,a,a)},l,{inputEvent:t}))}}},e.onPinch=function(t,e){if(this.flag&&this.pinchFlag){this.isPinch=!0;var n=this.options.pinch;if(n){var i=this.prevClients,r=this.startClients,o=g(C(e),C(i),C(r)),s=v(e);n(f({datas:this.datas,touches:y(e,i,r),scale:s/this.startDistance,distance:s},o,{inputEvent:t}))}}},e.onPinchEnd=function(t){if(this.flag&&this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.options.pinchend;if(n){var i=this.prevClients,r=this.startClients,o=g(C(i),C(i),C(r));n(f({datas:this.datas,isPinch:e,touches:y(i,i,r)},o,{inputEvent:t})),this.isPinch=!1,this.pinchFlag=!1}}},e.unset=function(){var t=this.el,e=this.options.container;this.isMouse&&(h(t,"mousedown",this.onDragStart),h(e,"mousemove",this.onDrag),h(e,"mouseup",this.onDragEnd)),this.isTouch&&(h(t,"touchstart",this.onDragStart),h(e,"touchmove",this.onDrag),h(e,"touchend",this.onDragEnd))},t}();var S=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,i=this.values,r=n.indexOf(t),o=-1===r?n.length:r;n[o]=t,i[o]=e},t}(),k=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),O="function"==typeof Map,o=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var T=function(){function t(t,e,n,i,r,o,s,a){this.prevList=t,this.list=e,this.added=n,this.removed=i,this.changed=r,this.maintained=o,this.changedBeforeAdded=s,this.fixed=a}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t,n,a,c,e=(t=this.changedBeforeAdded,n=this.fixed,a=[],c=[],t.forEach(function(t){var e=t[0],n=t[1],i=new o;a[e]=i,c[n]=i}),a.forEach(function(t,e){t.connect(a[e-1])}),t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],i=t[1];if(n===i)return[0,0];var r=a[n],o=c[i-1],s=r.getIndex();return r.disconnect(),o?r.connect(o,o.next):r.connect(void 0,a[0]),[s,r.getIndex()]})),l=this.changed,u=[];this.cacheOrdered=e.filter(function(t,e){var n=t[0],i=t[1],r=l[e],o=r[0],s=r[1];if(n!==i)return u.push([o,s]),!0}),this.cachePureChanged=u},t}();function i(t,e,n){var i=O?Map:n?k:S,r=n||function(t){return t},o=[],s=[],a=[],c=t.map(r),l=e.map(r),u=new i,h=new i,f=[],d=[],p={},g=[],v=0,y=0;return c.forEach(function(t,e){u.set(t,e)}),l.forEach(function(t,e){h.set(t,e)}),c.forEach(function(t,e){var n=h.get(t);void 0===n?(++y,s.push(e)):p[n]=y}),l.forEach(function(t,e){var n=u.get(t);void 0===n?(o.push(e),++v):(a.push([n,e]),y=p[e]||0,f.push([n-y,e-v]),d.push(e===n),n!==e&&g.push([n,e]))}),s.reverse(),new T(t,e,o,s,g,a,f,d)}var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var e,D="function"==typeof Map?void 0:(e=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)}),_=function(e){function t(){this.constructor=n}var n,i;function r(t){return void 0===t&&(t=[]),e.call(this,t,D)||this}return s(n=r,i=e),n.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t),r}(function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),n=i(this.list,e,this.findKeyCallback);return this.list=e,n},t}());function P(t,e){return i(t,e,D)}var K=function(t,e){return(K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function Y(t){var e=t.container;return[e.scrollLeft,e.scrollTop]}var x=function(e){function t(){this.constructor=n}var n,i;function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.startPos=[],t.prevTime=0,t.timer=0,t}K(n=r,i=e),n.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t);var o=r.prototype;return o.dragStart=function(t,e){var n=e.container.getBoundingClientRect(),i=n.top,r=n.left,o=n.width,s=n.height;this.startPos=[t.clientX,t.clientY],this.startRect={top:i,left:r,width:o,height:s}},o.drag=function(t,e){var n=this,i=t.clientX,r=t.clientY,o=e.container,s=e.threshold,a=void 0===s?0:s,c=e.throttleTime,l=void 0===c?0:c,u=e.getScrollPosition,h=void 0===u?Y:u,f=this.startRect,d=this.startPos,p=Date.now?Date.now():(new Date).getTime(),g=Math.max(l+this.prevTime-p,0),v=[0,0];if(f.top>r-a?(d[1]>f.top||r<d[1])&&(v[1]=-1):f.top+f.height<r+a&&(d[1]<f.top+f.height||r>d[1])&&(v[1]=1),f.left>i-a?(d[0]>f.left||i<d[0])&&(v[0]=-1):f.left+f.width<i+a&&(d[0]<f.left+f.width||i>d[0])&&(v[0]=1),clearTimeout(this.timer),!v[0]&&!v[1])return!1;if(0<g)return this.timer=window.setTimeout(function(){n.drag(t,e)},g),!1;this.prevTime=p;var y=h({container:o,direction:v});this.trigger("scroll",{container:o,direction:v,inputEvent:t});var m=h({container:o,direction:v}),C=m[0]-y[0],b=m[1]-y[1];return!(!C&&!b)&&(this.trigger("move",{offsetX:v[0]?C:0,offsetY:v[1]?b:0,inputEvent:t}),l&&(this.timer=window.setTimeout(function(){n.drag(t,e)},l)),!0)},o.dragEnd=function(){clearTimeout(this.timer)},r}(t),X=function(t,e){return(X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var n,j=(function(t,e){function n(t){if(t&&"object"==typeof t){var e=t.which||t.keyCode||t.charCode;e&&(t=e)}if("number"==typeof t)return s[t];var n,i=String(t);return(n=r[i.toLowerCase()])?n:(n=o[i.toLowerCase()])||(1===i.length?i.charCodeAt(0):void 0)}n.isEventKey=function(t,e){if(t&&"object"==typeof t){var n=t.which||t.keyCode||t.charCode;if(null==n)return!1;if("string"==typeof e){var i;if(i=r[e.toLowerCase()])return i===n;if(i=o[e.toLowerCase()])return i===n}else if("number"==typeof e)return e===n;return!1}};var r=(e=t.exports=n).code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i<123;i++)r[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)r[i-48]=i;for(i=1;i<13;i++)r["f"+i]=i+111;for(i=0;i<10;i++)r["numpad "+i]=i+96;var s=e.names=e.title={};for(i in r)s[r[i]]=i;for(var a in o)r[a]=o[a]}(n={exports:{}},n.exports),n.exports),M=(j.code,j.codes,j.aliases,j.names);j.title;function R(t){return Array.isArray(t)}function F(t){return"string"==typeof t}function A(t,e,n,i){t.addEventListener(e,n,i)}function L(t,e,n){t.removeEventListener(e,n)}var N,B={"+":"plus","left command":"meta","right command":"meta"},I={shift:1,ctrl:2,alt:3,meta:4};function H(t){var e=M[t]||"";for(var n in B)e=e.replace(n,B[n]);return e.replace(/\s/g,"")}function q(t,e){void 0===e&&(e=H(t.keyCode));var n=[t.shiftKey&&"shift",t.ctrlKey&&"ctrl",t.altKey&&"alt",t.metaKey&&"meta"];return-1===n.indexOf(e)&&n.push(e),n.filter(Boolean)}function U(t){var e=t.slice();return e.sort(function(t,e){return(I[t]||5)-(I[e]||5)}),e}var z=function(n){function t(){this.constructor=e}var e,i;function r(t){void 0===t&&(t=window);var e=n.call(this)||this;return e.container=t,e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e.clear=function(){return e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e},e.keydownEvent=function(t){e.triggerEvent("keydown",t)},e.keyupEvent=function(t){e.triggerEvent("keyup",t)},e.blur=function(){e.clear(),e.trigger("blur")},A(t,"blur",e.blur),A(t,"keydown",e.keydownEvent),A(t,"keyup",e.keyupEvent),e}X(e=r,i=n),e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t);var o=r.prototype;return Object.defineProperty(r,"global",{get:function(){return N=N||new r},enumerable:!0,configurable:!0}),r.setGlobal=function(){return this.global},o.destroy=function(){var t=this.container;this.clear(),this.off(),L(t,"blur",this.blur),L(t,"keydown",this.keydownEvent),L(t,"keyup",this.keyupEvent)},o.keydown=function(t,e){return this.addEvent("keydown",t,e)},o.offKeydown=function(t,e){return this.removeEvent("keydown",t,e)},o.offKeyup=function(t,e){return this.removeEvent("keyup",t,e)},o.keyup=function(t,e){return this.addEvent("keyup",t,e)},o.addEvent=function(t,e,n){return R(e)?this.on(t+"."+U(e).join("."),n):F(e)?this.on(t+"."+e,n):this.on(t,e),this},o.removeEvent=function(t,e,n){return R(e)?this.off(t+"."+U(e).join("."),n):F(e)?this.off(t+"."+e,n):this.off(t,e),this},o.triggerEvent=function(t,e){this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey;var n=H(e.keyCode),i={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:e,keyCode:e.keyCode,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey};this.trigger(t,i),this.trigger(t+"."+n,i);var r=q(e,n);1<r.length&&this.trigger(t+"."+r.join("."),i)},r}(t);function V(t,e,n){var i=t.tag,r=t.children,o=t.attributes,s=t.className,a=t.style,c=e||document.createElement(i);for(var l in o)c.setAttribute(l,o[l]);var u=c.children;if(r.forEach(function(t,e){V(t,u[e],c)}),s&&s.split(" ").forEach(function(t){var e,n,i,r;r=t,((i=c).classList?i.classList.contains(r):i.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)")))||(n=t,(e=c).classList?e.classList.add(n):e.className+=" "+n)}),a){var h=c.style;for(var l in a)h[l]=a[l]}return!e&&n&&n.appendChild(c),c}function G(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r=e||{},o=r.className,s=r.style;return{tag:t,className:void 0===o?"":o,style:void 0===s?{}:s,attributes:function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}(r,["className","style"]),children:n}}function $(t,e,n){t!==e&&n(t,e)}function J(i,t,e){var n=document.createElement("style");return n.setAttribute("type","text/css"),n.innerHTML=t.replace(/([^}{]*){/gm,function(t,e){return((n=e.match(/("[^"]*"|'[^']*'|[^,\s()]*\((?:[^()]*|\([^()]*\))*\)[^,\s()]*|[^,])+/g))?n.map(function(t){return t.trim()}):[]).map(function(t){return-1<t.indexOf(":global")?t.replace(/\:global/g,""):-1<t.indexOf(":host")?""+t.replace(/\:host/g,"."+i):"."+i+" "+t}).join(", ")+"{";var n}),(e||document.head||document.body).appendChild(n),n}var Q,W,Z,tt,et=(Z="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(Q="\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n").toString(36),tt=0,{className:Z,inject:function(t){var e,n=function(t){if(t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(t),i=0===tt;return(n||i)&&(e=J(Z,Q,n)),i&&(W=e),n||++tt,{destroy:function(){n?(t.removeChild(e),e=null):(0<tt&&--tt,0===tt&&W&&(W.parentNode.removeChild(W),W=null))}}}}),nt="selecto-selection "+et.className,it={target:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object},rt=["selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],ot=function(e){function t(){this.constructor=n}var n,i;function r(t){void 0===t&&(t={});var v=e.call(this)||this;return v.selectedTargets=[],v.differ=new _,v.dragScroll=new x,v.onDragStart=function(t,e){var n=t.datas,i=t.clientX,r=t.clientY,o=t.inputEvent,s=v.options,a=s.continueSelect,c=s.selectFromInside,l=v.getSelectableTargets(),u=l.map(function(t){var e=t.getBoundingClientRect(),n=e.left,i=e.top;return{left:n,top:i,right:n+e.width,bottom:i+e.height}});n.selectableTargets=l,n.selectableRects=u,n.startSelectedTargets=v.selectedTargets;var h=e||document.elementFromPoint(i,r),f=v.hitTest({left:i,top:r,right:i,bottom:r},i,r,l,u).filter(function(t){return t===h||t.contains(h)}),d=0<f.length;a?f=v.getSelectedTargets(f):v.selectedTargets=[];var p=o.type;if(!(!("mousedown"===p||"touchstart"===p)||v.trigger("dragStart",t)))return!1;if(v.select(f,o,!0),n.startX=i,n.startY=r,n.selectedTargets=f,v.target.style.cssText+="left:"+i+"px;top:"+r+"px",!c&&d)return v.onDragEnd(t),o.preventDefault(),!1;var g=v.options.scrollOptions;return g&&v.dragScroll.dragStart(t,g),!0},v.onDrag=function(t){var e=t.distX,n=t.distY,i=t.datas,r=t.inputEvent;v.render(t);var o=i.startX,s=i.startY,a=Math.min(0,e),c=Math.min(0,n),l=Math.abs(e),u=Math.abs(n),h=o+a,f=s+c,d=v.hitTest({left:h,top:f,right:h+l,bottom:f+u},i.startX,i.startY,i.selectableTargets,i.selectableRects),p=v.getSelectedTargets(d),g=v.options.scrollOptions;g&&v.dragScroll.drag(t,g),v.select(p,r),i.selectedTargets=p},v.onDragEnd=function(t){var e=t.datas,n=t.inputEvent;v.dragScroll.dragEnd(),v.target.style.cssText+="display: none;",v.selecteEnd(e.startSelectedTargets,e.selectedTargets,n),v.selectedTargets=e.selectedTargets},v.onKeyDown=function(t){v.sameCombiKey(t)&&(v.continueSelect=!0,v.trigger("keydown",{}))},v.onKeyUp=function(t){v.sameCombiKey(t)&&(v.continueSelect=!1,v.trigger("keyup",{}))},v.onBlur=function(){v.toggleContinueSelect&&v.continueSelect&&v.trigger("keyup",{})},v.onDocumentSelectStart=function(t){if(v.dragger.isFlag()){var e=v.dragContainer;e===window&&(e=document.documentElement),e!==t.target&&!e.contains(t.target)||t.preventDefault()}},v.target=t.target,v.container=t.container,v.options=l({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0},t),v.initElement(),v.initDragScroll(),v.setKeyController(),v}c(n=r,i=e),n.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t);var o,s,a=r.prototype;return a.setSelectedTargets=function(t){this.selectedTargets=t,this.differ=new _(t)},a.setKeyContainer=function(t){var e=this,n=this.options;$(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},a.setToggleContinueSelect=function(t){var e=this,n=this.options;$(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},a.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.dragger.unset(),this.injectResult.destroy(),h(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.dragger=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},a.click=function(t,e){var n=function(t){if("touches"in t){var e=t.touches[0];return{clientX:e.clientX,clientY:e.clientY}}return{clientX:t.clientX,clientY:t.clientY}}(t),i={datas:{},clientX:n.clientX,clientY:n.clientY,inputEvent:t};this.onDragStart(i,e)&&this.onDragEnd(i)},a.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new z(e||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},a.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},a.initElement=function(){this.target=V(G("div",{className:nt}),this.target,this.container);var t=this.target;this.dragContainer=this.options.dragContainer||this.target.parentNode,this.dragger=new w(this.dragContainer,{container:window,preventDefault:!1,dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd}),u(document,"selectstart",this.onDocumentSelectStart),this.injectResult=et.inject(t)},a.hitTest=function(t,d,p,g,e){var n=this.options,v=n.hitRate,y=n.selectByClick,m=t.left,C=t.top,b=t.right,E=t.bottom,w=[];return e.forEach(function(t,e){var n=t.left,i=t.top,r=t.right,o=t.bottom,s=n<=d&&d<=r&&i<=p&&p<=o,a=(r-n)*(o-i),c=Math.max(n,m),l=Math.min(r,b),u=Math.max(i,C),h=Math.min(o,E);if(y&&s)w.push(g[e]);else if(!(l<c||h<u)){var f=Math.round((l-c)*(h-u)/a*100);v<=f&&w.push(g[e])}}),w},a.initDragScroll=function(){var o=this;this.dragScroll.on("scroll",function(t){var e=t.container,n=t.direction;o.trigger("scroll",{container:e,direction:n})}).on("move",function(t){var e=t.offsetX,n=t.offsetY,i=t.inputEvent,r=i.datas;r.startX-=e,r.startY-=n,r.selectableRects.forEach(function(t){t.top-=n,t.bottom-=n,t.left-=e,t.right-=e}),o.dragger.scrollBy(e,n,i.inputEvent,!1),i.distX+=e,i.distY+=n,o.render(i)})},a.getSelectableTargets=function(){var n=[];return this.options.selectableTargets.forEach(function(t){var e;(e=t)&&"object"==typeof e?n.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){n.push(t)})}),n},a.getSelectedTargets=function(t){var e=P(this.selectedTargets,t),n=e.list,i=e.prevList,r=e.added,o=e.removed;return r.map(function(t){return n[t]}).concat(o.map(function(t){return i[t]}))},a.select=function(t,e,n){var i=this.differ.update(t),r=i.added,o=i.removed,s=i.prevList,a=i.list;n&&this.trigger("selectStart",{selected:t,added:r.map(function(t){return a[t]}),removed:o.map(function(t){return s[t]}),inputEvent:e}),(r.length||o.length)&&this.trigger("select",{selected:t,added:r.map(function(t){return a[t]}),removed:o.map(function(t){return s[t]}),inputEvent:e})},a.selecteEnd=function(t,e,n){var i=P(t,e),r=i.added,o=i.removed,s=i.prevList,a=i.list,c=P(this.selectedTargets,e),l=c.added,u=c.removed,h=c.prevList,f=c.list,d=n.type,p="mousedown"===d||"touchstart"===d;this.trigger("selectEnd",{selected:e,added:r.map(function(t){return a[t]}),removed:o.map(function(t){return s[t]}),afterAdded:l.map(function(t){return f[t]}),afterRemoved:u.map(function(t){return h[t]}),isDragStart:p,inputEvent:n})},a.render=function(t){var e=t.distX,n=t.distY,i=t.datas,r=i.startX,o=i.startY,s=Math.min(0,e),a=Math.min(0,n),c=Math.abs(e),l=Math.abs(n);this.target.style.cssText+="display: block;left:"+r+"px;top:"+o+"px;transform: translate("+s+"px, "+a+"px);width:"+c+"px;height:"+l+"px;"},a.sameCombiKey=function(t){var e=[].concat(this.options.toggleContinueSelect),n=q(t.inputEvent,t.key);return e.every(function(t){return-1<n.indexOf(t)})},r=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(o<3?r(s):3<o?r(e,n,s):r(e,n))||s);return 3<o&&s&&Object.defineProperty(e,n,s),s}([(o=rt,s=function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},i=("set "+e).replace(/[\s-_]([a-z])/g,function(t,e){return e.toUpperCase()});t[i]?n.set=function(t){this[i](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)},function(t){var e=t.prototype;o.forEach(function(t){s(e,t)})})],r)}(t),st={__proto__:null,default:ot,OPTIONS:["dragContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions"],OPTION_TYPES:it,PROPERTIES:rt,EVENTS:["dragStart","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["click","setSelectedTargets"],CLASS_NAME:nt};for(var at in st)ot[at]=st[at];return ot}); | ||
//# sourceMappingURL=selecto.pkgd.min.js.map |
{ | ||
"name": "selecto", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"description": "Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.", | ||
@@ -14,5 +14,6 @@ "main": "./dist/selecto.cjs.js", | ||
"doc": "rm -rf ./doc && jsdoc -c jsdoc.json", | ||
"prerelease": "npm run build && npm run doc && prerelease --dirs=dist,doc", | ||
"release": "npm run build && npm run doc && release --dirs=dist,doc", | ||
"release:init": "npm run build && npm run doc && release -i --dirs=dist,doc", | ||
"prerelease": "npm run build && npm run doc && npm run storybook && prerelease --dirs=dist,doc", | ||
"storybook": "cd storybook/ && npm run build && cd ../", | ||
"release": "npm run build && npm run doc && npm run storybook && release --dirs=dist,doc", | ||
"release:init": "npm run build && npm run doc && npm run storybook && release -i --dirs=dist,doc", | ||
"deploy": "gh-pages -d ./demo --dest=./ --add --remote origin", | ||
@@ -48,3 +49,3 @@ "deploy:init": "gh-pages -d ./demo --dest=./ --remote origin", | ||
"@egjs/component": "^2.1.2", | ||
"@scena/dragscroll": "^0.1.1", | ||
"@scena/dragscroll": "^0.2.1", | ||
"css-styled": "^0.1.7", | ||
@@ -59,3 +60,3 @@ "framework-utils": "^0.3.4", | ||
"@daybrush/drag": ">=0.12.0", | ||
"@scena/dragscroll": ">=0.1.1" | ||
"@scena/dragscroll": ">=0.2.1" | ||
}, | ||
@@ -62,0 +63,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
522460
6522
+ Added@scena/dragscroll@0.2.1(transitive)
- Removed@scena/dragscroll@0.1.1(transitive)
Updated@scena/dragscroll@^0.2.1