All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mware.web.product.map.dist.MapLayersContainer.js Maven / Gradle / Ivy

The newest version!
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1)):"function"==typeof define&&define.amd?define(["openlayers","prop-types","create-react-class","react-dom","util/withDataRequest","jscache","util/vertex/formatters","data/web-worker/store/ontology/selectors","react-redux","data/web-worker/store/selection/actions","data/web-worker/store/product/actions","data/web-worker/store/product/selectors","data/web-worker/store/actions","react","react-virtualized","classnames"],t):"object"==typeof exports?exports.MapLayersContainer=t(require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1),require(!1)):e.MapLayersContainer=t(e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0])}("undefined"!=typeof self?self:this,function(e,t,r,n,o,i,a,s,u,c,l,f,d,p,h,v){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=73)}([function(t,r){t.exports=e},function(e,t){var r=Array.isArray;e.exports=r},function(e,r){e.exports=t},function(e,t,r){var n=r(50),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t,r){function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o,i,a=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],r=e.visible,o=void 0===r||r,i=e.opacity,a=void 0===i?1:i,s=e.zIndex,u=void 0===s?0:s,c=n(e,["visible","opacity","zIndex"]);_.mapObject(c,function(e,r){null===e?t.unset(r):t.set(r,e)}),t.setVisible(o),t.setOpacity(a),t.setZIndex(u)}function c(t,r,i){var a=t.features,u=r.source,c=_.indexBy(u.getFeatures(),function(e){return e.getId()}),l=[],f=!1;if(a)for(var p=0;p=0;t--)if(_.isFunction(e[t].getImage)){var r=e[t].getImage(),n=r&&_.isFunction(r.getRadius)&&r.getRadius();if(n){var o=n/devicePixelRatio;return o}}}var p="org-bigconnect-map-vector-selected-overlay",h={sortable:!0,toggleable:!0},v={tile:{configure:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.source,i=r.sourceOptions,a=void 0===i?{}:i,u=n(r,["source","sourceOptions"]),c=void 0;if(!(o in e.source&&_.isFunction(e.source[o])))throw console.error("Unknown map provider type: ",o),new Error("map.provider is invalid");return c=new e.source[o](s({crossOrigin:"anonymous"},a)),{source:c,layer:new e.layer.Tile(s({},h,{id:t,label:"Base",type:"tile",sortable:!1,source:c},u))}},addEvents:function(e,t,r){return[t.source.on("tileloaderror",function(e){var t=e.tile;t&&(t._retryCount=(t._retryCount||0)+1,t._retryCount<=3&&(console.warn("Tile error retry: "+t._retryCount+" of 3",t.src_),_.defer(function(){t.load()})))})]}},cluster:{configure:function(r){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=new e.source.Vector({features:[]}),u=new t({source:a}),c=new e.layer.Vector(s({},h,{id:r,label:"Cluster",type:"cluster",style:function(e){return n.style(e,{source:a})},source:u},i)),l=new e.layer.Heatmap(s({},h,i,{visible:!1,id:"heatmap_cluster",label:"Heatmap",type:"cluster_heatmap",source:a}));return o.clear(),{source:a,clusterSource:u,layers:[l,c]}},style:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.source,n=t.selected,o=void 0!==n&&n,i=e.get("count"),a=e.get("selectionState")||"none",s=o||"none"!==a;return i>1?y.cluster(e,{selected:s,source:r}):y.feature(e.get("features")[0],{selected:s})},addEvents:function(t,r,n){var o=this,i=r.source,s=r.clusterSource,u=r.layers,c=a(u,2),l=c[0],f=c[1],d=function(e){return function(t){var r=t.get("element"),n="vertex"===r.type?"vertices":"edges";e[n].push(r.id)}},p=function(e){if(e.get("count")<2)return!1;var t=e.get("features"),r=t.filter(function(e){return e.get("selected")});return 01&&void 0!==arguments[1]?arguments[1]:{},o=arguments[2],i=new e.source.Vector({features:[],wrapX:!1});if(n.getExtent){var a=i.getExtent;i.getExtent=function(){var t=a&&a.apply(this,arguments),r=n.getExtent(o,i,t);return e.extent.isEmpty(r)?t||e.extent.createEmpty():r||t||e.extent.createEmpty()}}var u=new e.layer.Vector(s({},h,{id:t,type:"ancillary",sortable:!1,toggleable:!1,source:i,renderBuffer:500,updateWhileInteracting:!0,updateWhileAnimating:!0,style:function(e){return r.style(e)}},n));return{source:i,layer:u}},style:function(e){var t=e.get("styles");if(t){var r=t.normal;if(r.length)return r}},update:c},vectorXhr:{configure:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.sourceOptions,i=void 0===o?{}:o,a=n(r,["sourceOptions"]),u=new e.source.Vector(i);return{source:u,layer:new e.layer.Vector(s({},h,{id:t,type:"vectorXhr",source:u},a))}},addEvents:function(t,r,n){var o=r.source,i=r.layer,a={vertices:[],edges:[]},s=i.get("element"),u="vertex"===s.type?"vertices":"edges",c=f(i);return a[u].push(s.id),[t.on("click",function(e){var t=e.map,r=e.pixel,i=t.getFeaturesAtPixel(r),s=o.getFeatures();i&&(1===i.length&&i[0].getId()===c&&o.getFeatureById(c)?n.onSelectElements({vertices:[],edges:[]}):i.every(function(e){return s.includes(e)})&&n.onSelectElements(a))}),o.on("propertyChange",function(t){if("status"===t.key&&"loaded"===t.target.get(t.key)){var r=o.getFeatureById(c);if(r){var n=void 0;o.forEachFeature(function(t){var r=t.getGeometry(),o=r.getExtent();t.getId()!==c&&(n?e.extent.extend(n,o):n=o)});var i=e.geom.Polygon.fromExtent(n);r.setGeometry(i)}}})]},update:function(t,r){var n=r.source,o=r.layer,i=t.element,a=(t.features,t.selected),s=o.get("status"),u=!1;if(i!==o.get("element")&&(n.set("element",i),u=!0),s){if(a!==n.get("selected")){var c=f(o);if(n.set("selected",a),u=!0,a&&"loaded"===s){var l=void 0;n.forEachFeature(function(t){var r=t.getGeometry(),n=r.getExtent();t.getId()!==c&&(l?e.extent.extend(l,n):l=n)});var d=new e.Feature(e.geom.Polygon.fromExtent(l||[0,0,0,0]));d.setStyle(new e.style.Style({fill:new e.style.Fill({color:[0,136,204,.3]}),stroke:new e.style.Stroke({color:[0,136,204,.4],width:1})})),d.setId(c),n.addFeature(d)}else{var p=n.getFeatureById(c);p&&n.removeFeature(p)}}}else this.loadFeatures(n,o).then(function(e){e&&(n.clear(!0),n.addFeatures(e),o.set("status","loaded"))});return{changed:u}},loadFeatures:function(t,n){var o=n.getProperties(),i=o.id,a=o.element,s=o.propName,u=o.propKey,c=o.mimeType;return n.set("status","loading"),r.dataRequest("vertex","propertyValue",i,s,u).then(function(t){var r=l(c),n=r.readProjection(t);if(n&&e.proj.get(n.getCode())){return r.readFeatures(t,{dataProjection:n,featureProjection:"EPSG:3857"})}throw new Error("unhandledDataProjection")}).then(function(e){return e.map(function(e,t){return e.setId(n.get("id")+":"+t),e.set("element",a),e})}).catch(function(e){var t="unhandledDataProjection"===e.message?i18n("org.bigconnect.web.product.map.MapWorkProduct.layer.error.data.format"):i18n("org.bigconnect.web.product.map.MapWorkProduct.layer.error");n.set("status",{type:"error",message:t})})}}},y={feature:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.selected,n=void 0!==r&&r,i=e.getProperties(),a=i.focused,s=i.focusedDim,u=i.styles,c=i.selected,l=i._nodeRadius,f=n||c,d=!0,p=void 0;if(u){var h=u.normal,v=u.selected,y=void 0;!h.length||f&&v.length?v.length&&f&&(y=v):y=h,y&&(p=_.isArray(y)?y:[y])}else!1,d=!1,p=o.getOrCreateFeature({src:e.get(f?"iconUrlSelected":"iconUrl"),imgSize:e.get("iconSize"),scale:1/e.get("pixelRatio"),anchor:e.get("iconAnchor")},a);return _.isEmpty(p)?(console.warn("No styles for feature, ignoring.",e),[]):d&&a?o.addFocus(l,o.reset(l,p)):s?o.addDim(l,p):o.reset(l,p)},cluster:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.selected,n=void 0!==r&&r,a=t.source,s=(t.clusterSource,e.get("count")),u=e.get("focusStats"),c=e.get("selectionState")||"none",l=e.get("selectionCount")||0,f=a.countStats,d=f.min,p=f.max,h=Math.min(p,Math.max(d,s)),v=d===p?12:i(h,d,p,12,20);return o.getOrCreateCluster({count:s,radius:v,selected:n,selectionState:c,selectionCount:l,focusStats:u})}};return{byType:v,styles:y,setLayerConfig:u}}.apply(t,o))&&(e.exports=i)},function(e,t,r){function n(e,t){var r=i(e,t);return o(r)?r:void 0}var o=r(92),i=r(98);e.exports=n},function(e,t){e.exports=r},function(e,t,r){function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t0});c.max=Math.max(y,c.max),c.min=Math.min(y,c.min),t.features.push(t.createCluster(g,v,y))}}(p[h],h)}(i[l])}},t.prototype.createCluster=function(t,r,n){var o={some:0,all:!1,dim:!1};t.forEach(function(e){var t=e.get("focused");o.some+=t?1:0,o.all=o.all&&t,o.dim=o.dim||e.get("focusedDim")});var i=r.reduce(function(e,t){return e.map(function(e,r){return e+t[r]})},[0,0]),a=i.map(function(e){return e/r.length}),s=new e.geom.Point(a);return new e.Feature({geometry:s,features:t,coordinates:r,count:n,focusStats:o})},t}.apply(t,n))&&(e.exports=o)},function(e,t){e.exports=o},function(e,t){e.exports=i},function(e,t){e.exports=a},function(e,t,r){function n(e){return null==e?void 0===e?u:s:c&&c in Object(e)?i(e):a(e)}var o=r(14),i=r(94),a=r(95),s="[object Null]",u="[object Undefined]",c=o?o.toStringTag:void 0;e.exports=n},function(e,t,r){var n=r(3),o=n.Symbol;e.exports=o},function(e,t){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=r},function(e,t){function r(e){return null!=e&&"object"==typeof e}e.exports=r},function(e,t,r){function n(e){return null!=e&&i(e.length)&&!o(e)}var o=r(49),i=r(44);e.exports=n},function(e,t,r){function n(e){return"symbol"==typeof e||i(e)&&o(e)==a}var o=r(13),i=r(16),a="[object Symbol]";e.exports=n},,function(e,t,r){"use strict";function n(e,t,r){var n=e.slice(0);if(r>=n.length)for(var o=r-n.length;1+o--;)n.push(void 0);return n.splice(r,0,n.splice(t,1)[0]),n}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;nt?t:r}function s(e){return"px"===e.substr(-2)?parseFloat(e):0}function u(e){var t=window.getComputedStyle(e);return{top:s(t.marginTop),right:s(t.marginRight),bottom:s(t.marginBottom),left:s(t.marginLeft)}}function c(e,t){var r=t.displayName||t.name;return r?e+"("+r+")":e}Object.defineProperty(t,"__esModule",{value:!0}),t.arrayMove=n,t.omit=o,t.closest=i,t.limit=a,t.getElementMargin=u,t.provideDisplayName=c;t.events={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},t.vendorPrefix=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}()},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t,r){function n(e,t){t=o(t,e);for(var r=0,n=t.length;null!=e&&rd))return!1;var h=l.get(e),v=l.get(t);if(h&&v)return h==t&&v==e;var y=-1,g=!0,b=r&u?new o:void 0;for(l.set(e,t),l.set(t,e);++y=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var i,a,s=Object.assign||function(e){for(var t=1;tt?0:1;c=Math.max(o.indexOf(f)-d,0)}this.setState({futureIndex:[e,t]}),i(a(o,u,c))},onToggleLayer:function(e){var t=this.props,r=(t.product,t.layersConfig),n=t.updateLayerConfig,a=e.get("id"),s=i({},r[a]||{},{visible:!e.getVisible()});o.setLayerConfig(s,e),n(s,a)}})}.apply(t,n))&&(e.exports=o)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return r=t=function(t){function r(e){i(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.handleStart=function(e){var r=t.props,n=r.distance,o=r.shouldCancelStart;if(2===e.button||o(e))return!1;t._touched=!0,t._pos={x:e.pageX,y:e.pageY};var i=(0,w.closest)(e.target,function(e){return null!=e.sortableInfo});if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,s=i.sortableInfo,u=s.index,c=s.collection;if(a&&!(0,w.closest)(e.target,function(e){return null!=e.sortableHandle}))return;t.manager.active={index:u,collection:c},"a"===e.target.tagName.toLowerCase()&&e.preventDefault(),n||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}},t.nodeIsChild=function(e){return e.sortableInfo.manager===t.manager},t.handleMove=function(e){var r=t.props,n=r.distance,o=r.pressThreshold;if(!t.state.sorting&&t._touched){t._delta={x:t._pos.x-e.pageX,y:t._pos.y-e.pageY};var i=Math.abs(t._delta.x)+Math.abs(t._delta.y);n||o&&!(o&&i>=o)?n&&i>=n&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}},t.handleEnd=function(){var e=t.props.distance;t._touched=!1,e||t.cancel()},t.cancel=function(){t.state.sorting||(clearTimeout(t.pressTimer),t.manager.active=null)},t.handlePress=function(e){var r=t.manager.getActive();if(r){var n=t.props,i=n.axis,a=n.getHelperDimensions,s=n.helperClass,u=n.hideSortableGhost,c=n.onSortStart,l=n.useWindowAsScrollContainer,f=r.node,d=r.collection,p=f.sortableInfo.index,h=(0,w.getElementMargin)(f),v=t.container.getBoundingClientRect(),y=a({index:p,node:f,collection:d});t.node=f,t.margin=h,t.width=y.width,t.height=y.height,t.marginOffset={x:t.margin.left+t.margin.right,y:Math.max(t.margin.top,t.margin.bottom)},t.boundingClientRect=f.getBoundingClientRect(),t.containerBoundingRect=v,t.index=p,t.newIndex=p,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=t.getEdgeOffset(f),t.initialOffset=t.getOffset(e),t.initialScroll={top:t.scrollContainer.scrollTop,left:t.scrollContainer.scrollLeft},t.initialWindowScroll={top:window.pageYOffset,left:window.pageXOffset};var g=f.querySelectorAll("input, textarea, select"),b=f.cloneNode(!0);if([].concat(o(b.querySelectorAll("input, textarea, select"))).forEach(function(e,t){"file"!==e.type&&g[t]&&(e.value=g[t].value)}),t.helper=t.document.body.appendChild(b),t.helper.style.position="fixed",t.helper.style.top=t.boundingClientRect.top-h.top+"px",t.helper.style.left=t.boundingClientRect.left-h.left+"px",t.helper.style.width=t.width+"px",t.helper.style.height=t.height+"px",t.helper.style.boxSizing="border-box",t.helper.style.pointerEvents="none",u&&(t.sortableGhost=f,f.style.visibility="hidden",f.style.opacity=0),t.minTranslate={},t.maxTranslate={},t.axis.x&&(t.minTranslate.x=(l?0:v.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(l?t.contentWindow.innerWidth:v.left+v.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(l?0:v.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(l?t.contentWindow.innerHeight:v.top+v.height)-t.boundingClientRect.top-t.height/2),s){var x;(x=t.helper.classList).add.apply(x,o(s.split(" ")))}t.listenerNode=e.touches?f:t.contentWindow,w.events.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),w.events.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}),t.setState({sorting:!0,sortingIndex:p}),c&&c({node:f,index:p,collection:d},e)}},t.handleSortMove=function(e){var r=t.props.onSortMove;e.preventDefault(),t.updatePosition(e),t.animateNodes(),t.autoscroll(),r&&r(e)},t.handleSortEnd=function(e){var r=t.props,n=r.hideSortableGhost,o=r.onSortEnd,i=t.manager.active.collection;t.listenerNode&&(w.events.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),w.events.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})),t.helper.parentNode.removeChild(t.helper),n&&t.sortableGhost&&(t.sortableGhost.style.visibility="",t.sortableGhost.style.opacity="");for(var a=t.manager.refs[i],s=0,u=a.length;s=t.maxTranslate.y-t.height/2?(r.y=1,n.y=o.y*Math.abs((t.maxTranslate.y-t.height/2-e.y)/t.height)):e.x>=t.maxTranslate.x-t.width/2?(r.x=1,n.x=o.x*Math.abs((t.maxTranslate.x-t.width/2-e.x)/t.width)):e.y<=t.minTranslate.y+t.height/2?(r.y=-1,n.y=o.y*Math.abs((e.y-t.height/2-t.minTranslate.y)/t.height)):e.x<=t.minTranslate.x+t.width/2&&(r.x=-1,n.x=o.x*Math.abs((e.x-t.width/2-t.minTranslate.x)/t.width)),t.autoscrollInterval&&(clearInterval(t.autoscrollInterval),t.autoscrollInterval=null,t.isAutoScrolling=!1),0===r.x&&0===r.y||(t.autoscrollInterval=setInterval(function(){t.isAutoScrolling=!0;var e={left:1*n.x*r.x,top:1*n.y*r.y};t.scrollContainer.scrollTop+=e.top,t.scrollContainer.scrollLeft+=e.left,t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()},5))},t.manager=new m.default,t.events={start:t.handleStart,move:t.handleMove,end:t.handleEnd},(0,b.default)(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time."),t.state={},t}return s(r,t),f(r,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.getContainer,n=t.useWindowAsScrollContainer,o=this.props.contentWindow||window;this.container="function"==typeof r?r(this.getWrappedInstance()):(0,y.findDOMNode)(this),this.document=this.container.ownerDocument||document,this.scrollContainer=n?this.document.body:this.container,this.contentWindow="function"==typeof o?o():o;for(var i in this.events)!function(t){e.events.hasOwnProperty(t)&&w.events[t].forEach(function(r){return e.container.addEventListener(r,e.events[t],!1)})}(i)}},{key:"componentWillUnmount",value:function(){var e=this;for(var t in this.events)!function(t){e.events.hasOwnProperty(t)&&w.events[t].forEach(function(r){return e.container.removeEventListener(r,e.events[t])})}(t)}},{key:"getEdgeOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{top:0,left:0};if(e){var r={top:t.top+e.offsetTop,left:t.left+e.offsetLeft};return e.parentNode!==this.container?this.getEdgeOffset(e.parentNode,r):r}}},{key:"getOffset",value:function(e){return{x:e.touches?e.touches[0].pageX:e.pageX,y:e.touches?e.touches[0].pageY:e.pageY}}},{key:"getLockPixelOffsets",value:function(){var e=this.props.lockOffset;Array.isArray(e)||(e=[e,e]),(0,b.default)(2===e.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",e);var t=e,r=l(t,2),n=r[0],o=r[1];return[this.getLockPixelOffset(n),this.getLockPixelOffset(o)]}},{key:"getLockPixelOffset",value:function(e){var t=e,r=e,n="px";if("string"==typeof e){var o=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(e);(0,b.default)(null!==o,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',e),t=r=parseFloat(e),n=o[1]}return(0,b.default)(isFinite(t)&&isFinite(r),"lockOffset value should be a finite. Given %s",e),"%"===n&&(t=t*this.width/100,r=r*this.height/100),{x:t,y:r}}},{key:"updatePosition",value:function(e){var t=this.props,r=t.lockAxis,n=t.lockToContainerEdges,o=this.getOffset(e),i={x:o.x-this.initialOffset.x,y:o.y-this.initialOffset.y};if(i.y-=window.pageYOffset-this.initialWindowScroll.top,i.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=i,n){var a=this.getLockPixelOffsets(),s=l(a,2),u=s[0],c=s[1],f={x:this.width/2-u.x,y:this.height/2-u.y},d={x:this.width/2-c.x,y:this.height/2-c.y};i.x=(0,w.limit)(this.minTranslate.x+f.x,this.maxTranslate.x-d.x,i.x),i.y=(0,w.limit)(this.minTranslate.y+f.y,this.maxTranslate.y-d.y,i.y)}"x"===r?i.y=0:"y"===r&&(i.x=0),this.helper.style[w.vendorPrefix+"Transform"]="translate3d("+i.x+"px,"+i.y+"px, 0)"}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,r=e.hideSortableGhost,n=this.manager.getOrderedRefs(),o={left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top},i={left:this.offsetEdge.left+this.translate.x+o.left,top:this.offsetEdge.top+this.translate.y+o.top},a={top:window.pageYOffset-this.initialWindowScroll.top,left:window.pageXOffset-this.initialWindowScroll.left};this.newIndex=null;for(var s=0,u=n.length;sf?f/2:this.width/2,height:this.height>d?d/2:this.height/2},h={x:0,y:0},v=n[s].edgeOffset;v||(n[s].edgeOffset=v=this.getEdgeOffset(c));var y=s0&&n[s-1];y&&!y.edgeOffset&&(y.edgeOffset=this.getEdgeOffset(y.node)),l!==this.index?(t&&(c.style[w.vendorPrefix+"TransitionDuration"]=t+"ms"),this.axis.x?this.axis.y?lthis.containerBoundingRect.width-p.width&&(h.x=y.edgeOffset.left-v.left,h.y=y.edgeOffset.top-v.top),null===this.newIndex&&(this.newIndex=l)):l>this.index&&(i.left+a.left+p.width>=v.left&&i.top+a.top+p.height>=v.top||i.top+a.top+p.height>=v.top+d)&&(h.x=-(this.width+this.marginOffset.x),v.left+h.xthis.index&&i.left+a.left+p.width>=v.left?(h.x=-(this.width+this.marginOffset.x),this.newIndex=l):lthis.index&&i.top+a.top+p.height>=v.top?(h.y=-(this.height+this.marginOffset.y),this.newIndex=l):l1)for(var r=1;r0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return(0,c.default)(this.refs[e],function(e){return e.node.sortableInfo.index})}}]),e}();t.default=l},function(e,t,r){var n=r(79),o=r(156),i=n(o);e.exports=i},function(e,t,r){function n(e){return function(t,r,n){var s=Object(t);if(!i(t)){var u=o(r,3);t=a(t),r=function(e){return u(s[e],e,s)}}var c=e(t,r,n);return c>-1?s[u?t[c]:c]:void 0}}var o=r(38),i=r(17),a=r(25);e.exports=n},function(e,t,r){function n(e){var t=i(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(r){return r===e||o(r,e,t)}}var o=r(81),i=r(142),a=r(60);e.exports=n},function(e,t,r){function n(e,t,r,n){var u=r.length,c=u,l=!n;if(null==e)return!c;for(e=Object(e);u--;){var f=r[u];if(l&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++u-1}var o=r(22);e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__,n=o(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var o=r(22);e.exports=n},function(e,t,r){function n(){this.__data__=new o,this.size=0}var o=r(21);e.exports=n},function(e,t){function r(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}e.exports=r},function(e,t){function r(e){return this.__data__.get(e)}e.exports=r},function(e,t){function r(e){return this.__data__.has(e)}e.exports=r},function(e,t,r){function n(e,t){var r=this.__data__;if(r instanceof o){var n=r.__data__;if(!i||n.length1&&a(e,t[0],t[1])?t=[]:r>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,n(t,1),[])});e.exports=s},function(e,t,r){function n(e,t,r,a,s){var u=-1,c=e.length;for(r||(r=i),s||(s=[]);++u0&&r(l)?t>1?n(l,t-1,r,a,s):o(s,l):a||(s[s.length]=l)}return s}var o=r(54),i=r(165);e.exports=n},function(e,t,r){function n(e){return a(e)||i(e)||!!(s&&e&&e[s])}var o=r(14),i=r(42),a=r(1),s=o?o.isConcatSpreadable:void 0;e.exports=n},function(e,t,r){function n(e,t,r){t=t.length?o(t,function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e}):[f];var n=-1;t=o(t,c(a));var p=s(e,function(e,r,i){return{criteria:o(t,function(t){return t(e)}),index:++n,value:e}});return u(p,function(e,t){return l(e,t,r)})}var o=r(62),i=r(45),a=r(38),s=r(167),u=r(173),c=r(58),l=r(174),f=r(27),d=r(1);e.exports=n},function(e,t,r){function n(e,t){var r=-1,n=i(e)?Array(e.length):[];return o(e,function(e,o,i){n[++r]=t(e,o,i)}),n}var o=r(168),i=r(17);e.exports=n},function(e,t,r){var n=r(169),o=r(172),i=o(n);e.exports=i},function(e,t,r){function n(e,t){return e&&o(e,t,i)}var o=r(170),i=r(25);e.exports=n},function(e,t,r){var n=r(171),o=n();e.exports=o},function(e,t){function r(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===r(i[u],u,i))break}return t}}e.exports=r},function(e,t,r){function n(e,t){return function(r,n){if(null==r)return r;if(!o(r))return e(r,n);for(var i=r.length,a=t?i:-1,s=Object(r);(t?a--:++a=u)return c;return c*("desc"==r[n]?-1:1)}}return e.index-t.index}var o=r(175);e.exports=n},function(e,t,r){function n(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e===e,a=o(e),s=void 0!==t,u=null===t,c=t===t,l=o(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||n&&s&&c||!r&&c||!i)return 1;if(!n&&!a&&!l&&e0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,o=16,i=Date.now;e.exports=r},function(e,t,r){function n(e,t,r){if(!s(r))return!1;var n=typeof t;return!!("number"==n?i(r)&&a(t,r.length):"string"==n&&t in r)&&o(r[t],e)}var o=r(39),i=r(17),a=r(43),s=r(15);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(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 a(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)}function s(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return r=t=function(t){function r(){return o(this,r),i(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return a(r,t),c(r,[{key:"componentDidMount",value:function(){var e=this.props,t=e.collection,r=e.disabled,n=e.index;r||this.setDraggable(t,n)}},{key:"componentWillReceiveProps",value:function(e){if(this.props.index!==e.index&&this.node&&(this.node.sortableInfo.index=e.index),this.props.disabled!==e.disabled){var t=e.collection,r=e.disabled,n=e.index;r?this.removeDraggable(t):this.setDraggable(t,n)}else this.props.collection!==e.collection&&(this.removeDraggable(this.props.collection),this.setDraggable(e.collection,e.index))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.collection;e.disabled||this.removeDraggable(t)}},{key:"setDraggable",value:function(e,t){var r=this.node=(0,h.findDOMNode)(this);r.sortableInfo={index:t,collection:e,manager:this.context.manager},this.ref={node:r},this.context.manager.add(e,this.ref)}},{key:"removeDraggable",value:function(e){this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return(0,y.default)(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=n.withRef?"wrappedInstance":null;return f.default.createElement(e,u({ref:t},(0,g.omit)(this.props,"collection","disabled","index")))}}]),r}(l.Component),t.displayName=(0,g.provideDisplayName)("sortableElement",e),t.contextTypes={manager:p.default.object.isRequired},t.propTypes={index:p.default.number.isRequired,collection:p.default.oneOfType([p.default.number,p.default.string]),disabled:p.default.bool},t.defaultProps={collection:0},r}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return r=t=function(t){function r(){return o(this,r),i(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return a(r,t),c(r,[{key:"componentDidMount",value:function(){(0,d.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return(0,h.default)(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=n.withRef?"wrappedInstance":null;return f.default.createElement(e,u({ref:t},this.props))}}]),r}(l.Component),t.displayName=(0,v.provideDisplayName)("sortableHandle",e),r}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o,i,a=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o,i,a=Object.assign||function(e){for(var t=1;t




© 2015 - 2024 Weber Informatics LLC | Privacy Policy