Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-selectable-fast

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-selectable-fast - npm Package Compare versions

Comparing version 2.0.10 to 2.0.11

2

dist/react-selectable-fast.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["React-Selectable-Fast"]=t(require("react")):e["React-Selectable-Fast"]=t(e.React)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(t,o){t.exports=e},function(e,t,o){e.exports=o(13)()},function(e,t,o){"use strict";function n(){return{documentScrollTop:Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),documentScrollLeft:Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft)}}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scrollTop:0,scrollLeft:0},o=t.scrollTop,r=t.scrollLeft,s=n(),i=s.documentScrollTop,l=s.documentScrollLeft,c=e.getBoundingClientRect();return{top:c.top+i+o,left:c.left+l+r,offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight,computedWidth:c.width,computedHeight:c.height}}Object.defineProperty(t,"__esModule",{value:!0}),t.getDocumentScroll=n,t.default=r},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=o(0),u=n(a),f=o(1),p=o(2),d=n(p),h=function(e){var t,o;return o=t=function(t){function o(){var e,t,n,i;r(this,o);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return t=n=s(this,(e=o.__proto__||Object.getPrototypeOf(o)).call.apply(e,[this].concat(c))),n.state={selected:n.props.selected,selecting:!1},n.registerSelectable=function(e){n.bounds=(0,d.default)(n.node,e),n.context.selectable.register(n)},n.selectableRef=function(e){return n.node=e},i=t,s(n,i)}return i(o,t),c(o,[{key:"componentDidMount",value:function(){this.registerSelectable()}},{key:"componentWillUnmount",value:function(){this.context.selectable.unregister(this)}},{key:"render",value:function(){return u.default.createElement(e,l({},this.props,{selected:this.state.selected,selecting:this.state.selecting,selectableRef:this.selectableRef}))}}]),o}(a.Component),t.defaultProps={selected:!1},t.contextTypes={selectable:f.object},o};t.default=h},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=o(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),a=o(1),u=function(e){function t(){var e,o,s,i;n(this,t);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return o=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),s.getRootRef=function(e){return s.root=e},i=o,r(s,i)}return s(t,e),i(t,[{key:"componentDidMount",value:function(){this.root.addEventListener("mousedown",function(e){return e.stopPropagation()})}},{key:"render",value:function(){return c.default.createElement(this.props.component,{ref:this.getRootRef,onClick:this.context.selectable.clearSelection,className:"selectable-deselect-all "+this.props.className},this.props.children)}}]),t}(l.Component);u.defaultProps={component:"div"},u.contextTypes={selectable:a.object},t.default=u},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=o(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),a=o(1),u=function(e){function t(){var e,o,s,i;n(this,t);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return o=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),s.getRootRef=function(e){return s.root=e},i=o,r(s,i)}return s(t,e),i(t,[{key:"componentDidMount",value:function(){this.root.addEventListener("mousedown",function(e){return e.stopPropagation()})}},{key:"render",value:function(){return c.default.createElement(this.props.component,{ref:this.getRootRef,className:"selectable-select-all "+this.props.className,onClick:this.context.selectable.selectAll},this.props.children)}}]),t}(l.Component);u.defaultProps={component:"div"},u.contextTypes={selectable:a.object},t.default=u},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),u=o(0),f=n(u),p=o(1),d=o(10),h=n(d),m=o(2),v=n(m),y=o(8),b=n(y),g=o(7),S=n(g),w=function(){},x=function(e){function t(e){s(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.setScollTop=function(e){var t=o.scrollContainer.scrollTop;o.checkScrollTop(e,t),o.checkScrollBottom(e,t)},o.checkScrollTop=function(e,t){var n=o.props,r=n.minimumSpeedFactor,s=n.scrollSpeed,i=o.scrollBounds.top-e.clientY;if(i>0||e.clientY<0){var l=t-Math.max(i,r)*s;o.scrollContainer.scrollTop=l}},o.checkScrollBottom=function(e,t){var n=o.props,r=n.minimumSpeedFactor,s=n.scrollSpeed,i=e.clientY-o.scrollBounds.bottom;if(i>0||e.clientY>window.innerHeight){var l=t+Math.max(i,r)*s;o.scrollContainer.scrollTop=Math.min(l,o.maxScroll)}},o.updateRegistry=function(){var e={scrollTop:o.scrollContainer.scrollTop,scrollLeft:o.scrollContainer.scrollLeft},t=!0,n=!1,r=void 0;try{for(var s,i=o.registry.values()[Symbol.iterator]();!(t=(s=i.next()).done);t=!0){s.value.registerSelectable(e)}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},o.registerSelectable=function(e){o.registry.add(e),e.props.selected&&o.selectedItems.add(e)},o.unregisterSelectable=function(e){o.registry.delete(e)},o.applyContainerScroll=function(e,t){return e+t},o.openSelectbox=function(e){var t=o.desktopEventCoords(e);if(o.setScollTop(t),!o.mouseMoveStarted){o.mouseMoveStarted=!0,o.mouseMoved=!0;var n=o.scrollContainer.scrollTop,s=t.pageY,i=t.pageX,l=(0,m.getDocumentScroll)(),c=l.documentScrollTop,a=l.documentScrollLeft,u=o.applyContainerScroll(s-o.scrollBounds.top,n-c),f=o.applyContainerScroll(o.mouseDownData.boxTop-o.scrollBounds.top,o.mouseDownData.scrollTop-c),p=f-u;f=Math.min(f-p,f);var d=o.mouseDownData.boxLeft-i,h=o.mouseDownData.boxLeft-o.scrollBounds.left,v=o.applyContainerScroll(Math.min(h-d,h),-a);o.selectbox.setState({isBoxSelecting:!0,boxWidth:Math.abs(d),boxHeight:Math.abs(p),boxLeft:v,boxTop:f},function(){o.updateSelecting(),o.props.duringSelection([].concat(r(o.selectingItems))),o.mouseMoveStarted=!1})}},o.updateSelecting=function(){var e=o.selectbox.getRef();if(e){var t=(0,v.default)(e);o.selectItems(c({},t,{offsetWidth:t.offsetWidth||1,offsetHeight:t.offsetHeight||1}))}},o.selectItems=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.click,r=o.props,s=r.tolerance,i=r.enableDeselect,l=r.mixedDeselect;e.top+=o.scrollContainer.scrollTop,e.left+=o.scrollContainer.scrollLeft;var c=!0,a=!1,u=void 0;try{for(var f,p=o.registry.values()[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var d=f.value;o.processItem(d,s,e,n,i,l)}}catch(e){a=!0,u=e}finally{try{!c&&p.return&&p.return()}finally{if(a)throw u}}},o.clearSelection=function(){var e=!0,t=!1,n=void 0;try{for(var s,i=o.selectedItems.values()[Symbol.iterator]();!(e=(s=i.next()).done);e=!0){var l=s.value;l.setState({selected:!1}),o.selectedItems.delete(l)}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}o.setState({selectionMode:!1}),o.props.onSelectionFinish([].concat(r(o.selectedItems))),o.props.onSelectionClear()},o.selectAll=function(){o.updateWhiteListNodes();var e=!0,t=!1,n=void 0;try{for(var s,i=o.registry.values()[Symbol.iterator]();!(e=(s=i.next()).done);e=!0){var l=s.value;o.inIgnoreList(l.node)||l.state.selected||(l.setState({selected:!0}),o.selectedItems.add(l))}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}o.setState({selectionMode:!0}),o.props.onSelectionFinish([].concat(r(o.selectedItems)))},o.mouseDown=function(e){if(!o.mouseDownStarted&&!o.props.disabled){if(o.updateWhiteListNodes(),o.inIgnoreList(e.target))return void(o.mouseDownStarted=!1);if(o.props.resetOnStart&&o.clearSelection(),o.mouseDownStarted=!0,o.mouseUpStarted=!1,e=o.desktopEventCoords(e),!o.props.globalMouse&&!(0,h.default)(e.target,o.selectableGroup)){var t=(0,v.default)(o.selectableGroup);if(!(0,b.default)({top:t.top,left:t.left,bottom:t.offsetHeight,right:t.offsetWidth},{top:e.pageY,left:e.pageX,offsetWidth:0,offsetHeight:0}))return}o.updateRootBounds(),o.updateRegistry(),o.mouseDownData={boxLeft:e.pageX,boxTop:e.pageY,scrollTop:o.scrollContainer.scrollTop,scrollLeft:o.scrollContainer.scrollLeft,target:e.target},e.preventDefault(),document.addEventListener("mousemove",o.openSelectbox),document.addEventListener("touchmove",o.openSelectbox),document.addEventListener("mouseup",o.mouseUp),document.addEventListener("touchend",o.mouseUp)}},o.mouseUp=function(e){if(!o.mouseUpStarted&&(o.mouseUpStarted=!0,o.mouseDownStarted=!1,o.removeTempEventListeners(),o.mouseDownData)){var t=o.desktopEventCoords(e),n=t.pageY,s=t.pageX;if(!o.mouseMoved&&(0,h.default)(t.target,o.rootNode))o.handleClick(t,n,s);else{var i=!0,l=!1,c=void 0;try{for(var a,u=o.selectingItems.values()[Symbol.iterator]();!(i=(a=u.next()).done);i=!0){a.value.setState({selected:!0,selecting:!1})}}catch(e){l=!0,c=e}finally{try{!i&&u.return&&u.return()}finally{if(l)throw c}}o.selectedItems=new Set([].concat(r(o.selectedItems),r(o.selectingItems))),o.selectingItems.clear(),1===t.which&&o.mouseDownData.target===t.target&&o.preventEvent(t.target,"click"),o.selectbox.setState({isBoxSelecting:!1,boxWidth:0,boxHeight:0}),o.props.onSelectionFinish([].concat(r(o.selectedItems)))}o.toggleSelectionMode(),o.cleanUp(),o.mouseMoved=!1}},o.keyListener=function(e){e.ctrlKey||e.metaKey||27===e.keyCode&&o.clearSelection()},o.getGroupRef=function(e){return o.selectableGroup=e},o.getSelectboxRef=function(e){return o.selectbox=e},o.state={selectionMode:!1},o.mouseDownStarted=!1,o.mouseMoveStarted=!1,o.mouseUpStarted=!1,o.mouseDownData=null,o.registry=new Set,o.selectedItems=new Set,o.selectingItems=new Set,o.ignoreCheckCache=new Map,o.ignoreList=o.props.ignoreList.concat([".selectable-select-all",".selectable-deselect-all"]),o}return l(t,e),a(t,[{key:"getChildContext",value:function(){var e=this;return{selectable:{register:this.registerSelectable,unregister:this.unregisterSelectable,selectAll:this.selectAll,clearSelection:this.clearSelection,getScrolledContainer:function(){return e.scrollContainer}}}}},{key:"componentDidMount",value:function(){this.rootNode=this.selectableGroup,this.scrollContainer=document.querySelector(this.props.scrollContainer)||this.rootNode,this.rootNode.addEventListener("mousedown",this.mouseDown),this.rootNode.addEventListener("touchstart",this.mouseDown),this.props.deselectOnEsc&&(document.addEventListener("keydown",this.keyListener),document.addEventListener("keyup",this.keyListener))}},{key:"componentWillUnmount",value:function(){this.rootNode.removeEventListener("mousedown",this.mouseDown),this.rootNode.removeEventListener("touchstart",this.mouseDown),this.props.deselectOnEsc&&(document.removeEventListener("keydown",this.keyListener),document.removeEventListener("keyup",this.keyListener)),this.removeTempEventListeners()}},{key:"removeTempEventListeners",value:function(){document.removeEventListener("mousemove",this.openSelectbox),document.removeEventListener("touchmove",this.openSelectbox),document.removeEventListener("mouseup",this.mouseUp),document.removeEventListener("touchend",this.mouseUp)}},{key:"updateRootBounds",value:function(){this.scrollBounds=this.scrollContainer.getBoundingClientRect(),this.maxScroll=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight}},{key:"toggleSelectionMode",value:function(){var e=this.selectedItems,t=this.state.selectionMode;e.size&&!t&&this.setState({selectionMode:!0}),!e.size&&t&&this.setState({selectionMode:!1})}},{key:"processItem",value:function(e,t,o,n,r,s){if(this.inIgnoreList(e.node))return null;var i=(0,b.default)(o,e.bounds,t,this.props.delta),l=e.state,c=l.selecting,a=l.selected;if(n&&i)return a?this.selectedItems.delete(e):this.selectedItems.add(e),e.setState({selected:!a}),this.clickedItem=e;if(!n&&i){if(a&&r&&(!this.selectionStarted||s))return e.setState({selected:!1}),e.deselected=!0,this.deselectionStarted=!0,this.selectedItems.delete(e);var u=s?!e.deselected:!this.deselectionStarted;if(!c&&!a&&u)return e.setState({selecting:!0}),this.selectionStarted=!0,this.selectingItems.add(e)}return!n&&!i&&c&&this.selectingItems.has(e)?(e.setState({selecting:!1}),this.selectingItems.delete(e)):null}},{key:"inIgnoreList",value:function(e){if(void 0!==this.ignoreCheckCache.get(e))return this.ignoreCheckCache.get(e);var t=this.ignoreListNodes.some(function(t){return e===t||t.contains(e)});return this.ignoreCheckCache.set(e,t),t}},{key:"updateWhiteListNodes",value:function(){this.ignoreListNodes=[].concat(r(document.querySelectorAll(this.ignoreList.join(", "))))}},{key:"preventEvent",value:function(e,t){var o=function o(n){e.removeEventListener(t,o,!0),n.preventDefault(),n.stopPropagation()};e.addEventListener(t,o,!0)}},{key:"handleClick",value:function(e,t,o){var n=[].concat(r(e.target.classList||[])).indexOf(this.props.clickClassName)>-1;(this.props.allowClickWithoutSelected||this.selectedItems.size||n||this.ctrlPressed)&&(this.selectItems({top:t,left:o,offsetWidth:0,offsetHeight:0},{click:!0}),this.props.onSelectionFinish([].concat(r(this.selectedItems)),this.clickedItem),1===e.which&&this.preventEvent(e.target,"click"),2!==e.which&&3!==e.which||this.preventEvent(e.target,"contextmenu"))}},{key:"cleanUp",value:function(){if(this.deselectionStarted=!1,this.selectionStarted=!1,this.props.mixedDeselect){var e=!0,t=!1,o=void 0;try{for(var n,r=this.registry.values()[Symbol.iterator]();!(e=(n=r.next()).done);e=!0){n.value.deselected=!1}}catch(e){t=!0,o=e}finally{try{!e&&r.return&&r.return()}finally{if(t)throw o}}}}},{key:"desktopEventCoords",value:function(e){return void 0!==e.pageX&&void 0!==e.pageY||(void 0!==e.targetTouches[0]&&void 0!==e.targetTouches[0].pageX?(e.pageX=e.targetTouches[0].pageX,e.pageY=e.targetTouches[0].pageY):void 0!==e.changedTouches[0]&&void 0!==e.changedTouches[0].pageX&&(e.pageX=e.changedTouches[0].pageX,e.pageY=e.changedTouches[0].pageY)),e}},{key:"render",value:function(){return f.default.createElement(this.props.component,{ref:this.getGroupRef,style:this.props.style,className:this.props.className+" "+(this.state.selectionMode?this.props.selectionModeClass:"")},f.default.createElement(S.default,{ref:this.getSelectboxRef,fixedPosition:this.props.fixedPosition,className:this.props.selectboxClassName}),this.props.children)}}]),t}(u.Component);x.defaultProps={component:"div",tolerance:0,globalMouse:!1,ignoreList:[],scrollSpeed:.25,minimumSpeedFactor:60,duringSelection:w,onSelectionFinish:w,onSelectionClear:w,allowClickWithoutSelected:!0,selectionModeClass:"in-selection-mode",resetOnStart:!1,disabled:!1,deselectOnEsc:!0,delta:1},x.childContextTypes={selectable:p.object},t.default=x},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=o(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),a=function(e){function t(){var e,o,s,i;n(this,t);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return o=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),s.state={top:0,left:0,boxWidth:0,boxHeight:0,isBoxSelecting:!1},s.getRef=function(){return s.selectbox},s.getSelectboxRef=function(e){return s.selectbox=e},i=o,r(s,i)}return s(t,e),i(t,[{key:"render",value:function(){var e={left:this.state.boxLeft,top:this.state.boxTop,width:this.state.boxWidth,height:this.state.boxHeight,zIndex:9e3,position:this.props.fixedPosition?"fixed":"absolute",cursor:"default"};return c.default.createElement("div",null,this.state.isBoxSelecting&&c.default.createElement("div",{ref:this.getSelectboxRef,style:e,className:this.props.className}))}}]),t}(l.Component);a.defaultProps={className:"selectable-selectbox"},t.default=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(2),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function(e,t,o,n,r,s,i,l,c){return void 0===c&&(c=0),!(e+s-c<o||e+c>o+l||t+r-c<n||t+c>n+i)};t.default=function(e,t,o,n){void 0===n&&(n=1);var i=e instanceof HTMLElement?(0,r.default)(e):e,l=t instanceof HTMLElement?(0,r.default)(t):t;return 1===n?s(i.top,i.left,l.top,l.left,i.offsetWidth,i.offsetHeight,l.offsetWidth,l.offsetHeight,o):s(i.top,i.left,l.top,l.left,i.computedWidth,i.computedHeight,l.computedWidth,l.computedHeight,o)}},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DeselectAll=t.SelectAll=t.createSelectable=t.SelectableGroup=void 0;var r=o(6),s=n(r),i=o(3),l=n(i),c=o(5),a=n(c),u=o(4),f=n(u);t.SelectableGroup=s.default,t.createSelectable=l.default,t.SelectAll=a.default,t.DeselectAll=f.default},function(e,t,o){"use strict";function n(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,o){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,o){"use strict";function n(e,t,o,n,s,i,l,c){if(r(t),!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[o,n,s,i,l,c],f=0;a=new Error(t.replace(/%s/g,function(){return u[f++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var r=function(e){};e.exports=n},function(e,t,o){"use strict";var n=o(11),r=o(12),s=o(14);e.exports=function(){function e(e,t,o,n,i,l){l!==s&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return o.checkPropTypes=n,o.PropTypes=o,o}},function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["React-Selectable-Fast"]=t(require("react")):e["React-Selectable-Fast"]=t(e.React)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(t,o){t.exports=e},function(e,t,o){e.exports=o(13)()},function(e,t,o){"use strict";function n(){return{documentScrollTop:Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),documentScrollLeft:Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft)}}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scrollTop:0,scrollLeft:0},o=t.scrollTop,r=t.scrollLeft,s=n(),i=s.documentScrollTop,l=s.documentScrollLeft,c=e.getBoundingClientRect();return{top:c.top+i+o,left:c.left+l+r,offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight,computedWidth:c.width,computedHeight:c.height}}Object.defineProperty(t,"__esModule",{value:!0}),t.getDocumentScroll=n,t.default=r},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=o(0),u=n(a),f=o(1),p=o(2),d=n(p),h=function(e){var t,o;return o=t=function(t){function o(){var e,t,n,i;r(this,o);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return t=n=s(this,(e=o.__proto__||Object.getPrototypeOf(o)).call.apply(e,[this].concat(c))),n.state={selected:n.props.selected,selecting:!1},n.registerSelectable=function(e){n.bounds=(0,d.default)(n.node,e),n.context.selectable.register(n)},n.selectableRef=function(e){return n.node=e},i=t,s(n,i)}return i(o,t),c(o,[{key:"componentDidMount",value:function(){this.registerSelectable()}},{key:"componentWillUnmount",value:function(){this.context.selectable.unregister(this)}},{key:"render",value:function(){return u.default.createElement(e,l({},this.props,{selected:this.state.selected,selecting:this.state.selecting,selectableRef:this.selectableRef}))}}]),o}(a.Component),t.defaultProps={selected:!1},t.contextTypes={selectable:f.object},o};t.default=h},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=o(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),a=o(1),u=function(e){function t(){var e,o,s,i;n(this,t);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return o=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),s.getRootRef=function(e){return s.root=e},i=o,r(s,i)}return s(t,e),i(t,[{key:"componentDidMount",value:function(){this.root.addEventListener("mousedown",function(e){return e.stopPropagation()})}},{key:"render",value:function(){return c.default.createElement(this.props.component,{ref:this.getRootRef,onClick:this.context.selectable.clearSelection,className:"selectable-deselect-all "+this.props.className},this.props.children)}}]),t}(l.Component);u.defaultProps={component:"div"},u.contextTypes={selectable:a.object},t.default=u},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=o(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),a=o(1),u=function(e){function t(){var e,o,s,i;n(this,t);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return o=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),s.getRootRef=function(e){return s.root=e},i=o,r(s,i)}return s(t,e),i(t,[{key:"componentDidMount",value:function(){this.root.addEventListener("mousedown",function(e){return e.stopPropagation()})}},{key:"render",value:function(){return c.default.createElement(this.props.component,{ref:this.getRootRef,className:"selectable-select-all "+this.props.className,onClick:this.context.selectable.selectAll},this.props.children)}}]),t}(l.Component);u.defaultProps={component:"div"},u.contextTypes={selectable:a.object},t.default=u},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),u=o(0),f=n(u),p=o(1),d=o(10),h=n(d),m=o(2),v=n(m),y=o(8),b=n(y),g=o(7),S=n(g),w=function(){},x=function(e){function t(e){s(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.setScollTop=function(e){var t=o.scrollContainer.scrollTop;o.checkScrollTop(e,t),o.checkScrollBottom(e,t)},o.checkScrollTop=function(e,t){var n=o.props,r=n.minimumSpeedFactor,s=n.scrollSpeed,i=o.scrollBounds.top-e.clientY;if(i>0||e.clientY<0){var l=t-Math.max(i,r)*s;o.scrollContainer.scrollTop=l}},o.checkScrollBottom=function(e,t){var n=o.props,r=n.minimumSpeedFactor,s=n.scrollSpeed,i=e.clientY-o.scrollBounds.bottom;if(i>0||e.clientY>window.innerHeight){var l=t+Math.max(i,r)*s;o.scrollContainer.scrollTop=Math.min(l,o.maxScroll)}},o.updateRegistry=function(){var e={scrollTop:o.scrollContainer.scrollTop,scrollLeft:o.scrollContainer.scrollLeft},t=!0,n=!1,r=void 0;try{for(var s,i=o.registry.values()[Symbol.iterator]();!(t=(s=i.next()).done);t=!0){s.value.registerSelectable(e)}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},o.registerSelectable=function(e){o.registry.add(e),e.props.selected&&o.selectedItems.add(e)},o.unregisterSelectable=function(e){o.registry.delete(e),o.selectedItems.delete(e),o.selectingItems.delete(e)},o.applyContainerScroll=function(e,t){return e+t},o.openSelectbox=function(e){var t=o.desktopEventCoords(e);if(o.setScollTop(t),!o.mouseMoveStarted){o.mouseMoveStarted=!0,o.mouseMoved=!0;var n=o.scrollContainer.scrollTop,s=t.pageY,i=t.pageX,l=(0,m.getDocumentScroll)(),c=l.documentScrollTop,a=l.documentScrollLeft,u=o.applyContainerScroll(s-o.scrollBounds.top,n-c),f=o.applyContainerScroll(o.mouseDownData.boxTop-o.scrollBounds.top,o.mouseDownData.scrollTop-c),p=f-u;f=Math.min(f-p,f);var d=o.mouseDownData.boxLeft-i,h=o.mouseDownData.boxLeft-o.scrollBounds.left,v=o.applyContainerScroll(Math.min(h-d,h),-a);o.selectbox.setState({isBoxSelecting:!0,boxWidth:Math.abs(d),boxHeight:Math.abs(p),boxLeft:v,boxTop:f},function(){o.updateSelecting(),o.props.duringSelection([].concat(r(o.selectingItems))),o.mouseMoveStarted=!1})}},o.updateSelecting=function(){var e=o.selectbox.getRef();if(e){var t=(0,v.default)(e);o.selectItems(c({},t,{offsetWidth:t.offsetWidth||1,offsetHeight:t.offsetHeight||1}))}},o.selectItems=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.click,r=o.props,s=r.tolerance,i=r.enableDeselect,l=r.mixedDeselect;e.top+=o.scrollContainer.scrollTop,e.left+=o.scrollContainer.scrollLeft;var c=!0,a=!1,u=void 0;try{for(var f,p=o.registry.values()[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var d=f.value;o.processItem(d,s,e,n,i,l)}}catch(e){a=!0,u=e}finally{try{!c&&p.return&&p.return()}finally{if(a)throw u}}},o.clearSelection=function(){var e=!0,t=!1,n=void 0;try{for(var s,i=o.selectedItems.values()[Symbol.iterator]();!(e=(s=i.next()).done);e=!0){var l=s.value;l.setState({selected:!1}),o.selectedItems.delete(l)}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}o.setState({selectionMode:!1}),o.props.onSelectionFinish([].concat(r(o.selectedItems))),o.props.onSelectionClear()},o.selectAll=function(){o.updateWhiteListNodes();var e=!0,t=!1,n=void 0;try{for(var s,i=o.registry.values()[Symbol.iterator]();!(e=(s=i.next()).done);e=!0){var l=s.value;o.inIgnoreList(l.node)||l.state.selected||(l.setState({selected:!0}),o.selectedItems.add(l))}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}o.setState({selectionMode:!0}),o.props.onSelectionFinish([].concat(r(o.selectedItems)))},o.mouseDown=function(e){if(!o.mouseDownStarted&&!o.props.disabled){if(o.updateWhiteListNodes(),o.inIgnoreList(e.target))return void(o.mouseDownStarted=!1);if(o.props.resetOnStart&&o.clearSelection(),o.mouseDownStarted=!0,o.mouseUpStarted=!1,e=o.desktopEventCoords(e),!o.props.globalMouse&&!(0,h.default)(e.target,o.selectableGroup)){var t=(0,v.default)(o.selectableGroup);if(!(0,b.default)({top:t.top,left:t.left,bottom:t.offsetHeight,right:t.offsetWidth},{top:e.pageY,left:e.pageX,offsetWidth:0,offsetHeight:0}))return}o.updateRootBounds(),o.updateRegistry(),o.mouseDownData={boxLeft:e.pageX,boxTop:e.pageY,scrollTop:o.scrollContainer.scrollTop,scrollLeft:o.scrollContainer.scrollLeft,target:e.target},e.preventDefault(),document.addEventListener("mousemove",o.openSelectbox),document.addEventListener("touchmove",o.openSelectbox),document.addEventListener("mouseup",o.mouseUp),document.addEventListener("touchend",o.mouseUp)}},o.mouseUp=function(e){if(!o.mouseUpStarted&&(o.mouseUpStarted=!0,o.mouseDownStarted=!1,o.removeTempEventListeners(),o.mouseDownData)){var t=o.desktopEventCoords(e),n=t.pageY,s=t.pageX;if(!o.mouseMoved&&(0,h.default)(t.target,o.rootNode))o.handleClick(t,n,s);else{var i=!0,l=!1,c=void 0;try{for(var a,u=o.selectingItems.values()[Symbol.iterator]();!(i=(a=u.next()).done);i=!0){a.value.setState({selected:!0,selecting:!1})}}catch(e){l=!0,c=e}finally{try{!i&&u.return&&u.return()}finally{if(l)throw c}}o.selectedItems=new Set([].concat(r(o.selectedItems),r(o.selectingItems))),o.selectingItems.clear(),1===t.which&&o.mouseDownData.target===t.target&&o.preventEvent(t.target,"click"),o.selectbox.setState({isBoxSelecting:!1,boxWidth:0,boxHeight:0}),o.props.onSelectionFinish([].concat(r(o.selectedItems)))}o.toggleSelectionMode(),o.cleanUp(),o.mouseMoved=!1}},o.keyListener=function(e){e.ctrlKey||e.metaKey||27===e.keyCode&&o.clearSelection()},o.getGroupRef=function(e){return o.selectableGroup=e},o.getSelectboxRef=function(e){return o.selectbox=e},o.state={selectionMode:!1},o.mouseDownStarted=!1,o.mouseMoveStarted=!1,o.mouseUpStarted=!1,o.mouseDownData=null,o.registry=new Set,o.selectedItems=new Set,o.selectingItems=new Set,o.ignoreCheckCache=new Map,o.ignoreList=o.props.ignoreList.concat([".selectable-select-all",".selectable-deselect-all"]),o}return l(t,e),a(t,[{key:"getChildContext",value:function(){var e=this;return{selectable:{register:this.registerSelectable,unregister:this.unregisterSelectable,selectAll:this.selectAll,clearSelection:this.clearSelection,getScrolledContainer:function(){return e.scrollContainer}}}}},{key:"componentDidMount",value:function(){this.rootNode=this.selectableGroup,this.scrollContainer=document.querySelector(this.props.scrollContainer)||this.rootNode,this.rootNode.addEventListener("mousedown",this.mouseDown),this.rootNode.addEventListener("touchstart",this.mouseDown),this.props.deselectOnEsc&&(document.addEventListener("keydown",this.keyListener),document.addEventListener("keyup",this.keyListener))}},{key:"componentWillUnmount",value:function(){this.rootNode.removeEventListener("mousedown",this.mouseDown),this.rootNode.removeEventListener("touchstart",this.mouseDown),this.props.deselectOnEsc&&(document.removeEventListener("keydown",this.keyListener),document.removeEventListener("keyup",this.keyListener)),this.removeTempEventListeners()}},{key:"removeTempEventListeners",value:function(){document.removeEventListener("mousemove",this.openSelectbox),document.removeEventListener("touchmove",this.openSelectbox),document.removeEventListener("mouseup",this.mouseUp),document.removeEventListener("touchend",this.mouseUp)}},{key:"updateRootBounds",value:function(){this.scrollBounds=this.scrollContainer.getBoundingClientRect(),this.maxScroll=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight}},{key:"toggleSelectionMode",value:function(){var e=this.selectedItems,t=this.state.selectionMode;e.size&&!t&&this.setState({selectionMode:!0}),!e.size&&t&&this.setState({selectionMode:!1})}},{key:"processItem",value:function(e,t,o,n,r,s){if(this.inIgnoreList(e.node))return null;var i=(0,b.default)(o,e.bounds,t,this.props.delta),l=e.state,c=l.selecting,a=l.selected;if(n&&i)return a?this.selectedItems.delete(e):this.selectedItems.add(e),e.setState({selected:!a}),this.clickedItem=e;if(!n&&i){if(a&&r&&(!this.selectionStarted||s))return e.setState({selected:!1}),e.deselected=!0,this.deselectionStarted=!0,this.selectedItems.delete(e);var u=s?!e.deselected:!this.deselectionStarted;if(!c&&!a&&u)return e.setState({selecting:!0}),this.selectionStarted=!0,this.selectingItems.add(e)}return!n&&!i&&c&&this.selectingItems.has(e)?(e.setState({selecting:!1}),this.selectingItems.delete(e)):null}},{key:"inIgnoreList",value:function(e){if(void 0!==this.ignoreCheckCache.get(e))return this.ignoreCheckCache.get(e);var t=this.ignoreListNodes.some(function(t){return e===t||t.contains(e)});return this.ignoreCheckCache.set(e,t),t}},{key:"updateWhiteListNodes",value:function(){this.ignoreListNodes=[].concat(r(document.querySelectorAll(this.ignoreList.join(", "))))}},{key:"preventEvent",value:function(e,t){var o=function o(n){e.removeEventListener(t,o,!0),n.preventDefault(),n.stopPropagation()};e.addEventListener(t,o,!0)}},{key:"handleClick",value:function(e,t,o){var n=[].concat(r(e.target.classList||[])).indexOf(this.props.clickClassName)>-1;(this.props.allowClickWithoutSelected||this.selectedItems.size||n||this.ctrlPressed)&&(this.selectItems({top:t,left:o,offsetWidth:0,offsetHeight:0},{click:!0}),this.props.onSelectionFinish([].concat(r(this.selectedItems)),this.clickedItem),1===e.which&&this.preventEvent(e.target,"click"),2!==e.which&&3!==e.which||this.preventEvent(e.target,"contextmenu"))}},{key:"cleanUp",value:function(){if(this.deselectionStarted=!1,this.selectionStarted=!1,this.props.mixedDeselect){var e=!0,t=!1,o=void 0;try{for(var n,r=this.registry.values()[Symbol.iterator]();!(e=(n=r.next()).done);e=!0){n.value.deselected=!1}}catch(e){t=!0,o=e}finally{try{!e&&r.return&&r.return()}finally{if(t)throw o}}}}},{key:"desktopEventCoords",value:function(e){return void 0!==e.pageX&&void 0!==e.pageY||(void 0!==e.targetTouches[0]&&void 0!==e.targetTouches[0].pageX?(e.pageX=e.targetTouches[0].pageX,e.pageY=e.targetTouches[0].pageY):void 0!==e.changedTouches[0]&&void 0!==e.changedTouches[0].pageX&&(e.pageX=e.changedTouches[0].pageX,e.pageY=e.changedTouches[0].pageY)),e}},{key:"render",value:function(){return f.default.createElement(this.props.component,{ref:this.getGroupRef,style:this.props.style,className:this.props.className+" "+(this.state.selectionMode?this.props.selectionModeClass:"")},f.default.createElement(S.default,{ref:this.getSelectboxRef,fixedPosition:this.props.fixedPosition,className:this.props.selectboxClassName}),this.props.children)}}]),t}(u.Component);x.defaultProps={component:"div",tolerance:0,globalMouse:!1,ignoreList:[],scrollSpeed:.25,minimumSpeedFactor:60,duringSelection:w,onSelectionFinish:w,onSelectionClear:w,allowClickWithoutSelected:!0,selectionModeClass:"in-selection-mode",resetOnStart:!1,disabled:!1,deselectOnEsc:!0,delta:1},x.childContextTypes={selectable:p.object},t.default=x},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=o(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),a=function(e){function t(){var e,o,s,i;n(this,t);for(var l=arguments.length,c=Array(l),a=0;a<l;a++)c[a]=arguments[a];return o=s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),s.state={top:0,left:0,boxWidth:0,boxHeight:0,isBoxSelecting:!1},s.getRef=function(){return s.selectbox},s.getSelectboxRef=function(e){return s.selectbox=e},i=o,r(s,i)}return s(t,e),i(t,[{key:"render",value:function(){var e={left:this.state.boxLeft,top:this.state.boxTop,width:this.state.boxWidth,height:this.state.boxHeight,zIndex:9e3,position:this.props.fixedPosition?"fixed":"absolute",cursor:"default"};return c.default.createElement("div",null,this.state.isBoxSelecting&&c.default.createElement("div",{ref:this.getSelectboxRef,style:e,className:this.props.className}))}}]),t}(l.Component);a.defaultProps={className:"selectable-selectbox"},t.default=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(2),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function(e,t,o,n,r,s,i,l,c){return void 0===c&&(c=0),!(e+s-c<o||e+c>o+l||t+r-c<n||t+c>n+i)};t.default=function(e,t,o,n){void 0===n&&(n=1);var i=e instanceof HTMLElement?(0,r.default)(e):e,l=t instanceof HTMLElement?(0,r.default)(t):t;return 1===n?s(i.top,i.left,l.top,l.left,i.offsetWidth,i.offsetHeight,l.offsetWidth,l.offsetHeight,o):s(i.top,i.left,l.top,l.left,i.computedWidth,i.computedHeight,l.computedWidth,l.computedHeight,o)}},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DeselectAll=t.SelectAll=t.createSelectable=t.SelectableGroup=void 0;var r=o(6),s=n(r),i=o(3),l=n(i),c=o(5),a=n(c),u=o(4),f=n(u);t.SelectableGroup=s.default,t.createSelectable=l.default,t.SelectAll=a.default,t.DeselectAll=f.default},function(e,t,o){"use strict";function n(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,o){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,o){"use strict";function n(e,t,o,n,s,i,l,c){if(r(t),!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[o,n,s,i,l,c],f=0;a=new Error(t.replace(/%s/g,function(){return u[f++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var r=function(e){};e.exports=n},function(e,t,o){"use strict";var n=o(11),r=o(12),s=o(14);e.exports=function(){function e(e,t,o,n,i,l){l!==s&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return o.checkPropTypes=n,o.PropTypes=o,o}},function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])});
//# sourceMappingURL=react-selectable-fast.js.map

@@ -126,2 +126,4 @@ 'use strict';

_this.registry.delete(selectableItem);
_this.selectedItems.delete(selectableItem);
_this.selectingItems.delete(selectableItem);
};

@@ -128,0 +130,0 @@

{
"name": "react-selectable-fast",
"version": "2.0.10",
"version": "2.0.11",
"description": "Enable other React components to be selectable by drawing a box with your mouse/touch",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc