
org.visallo.web.table.dist.card.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)):"function"==typeof define&&define.amd?define(["prop-types","react","create-react-class","react-redux","data/web-worker/store/selection/actions","data/web-worker/store/product/selectors","data/web-worker/store/ontology/selectors","classnames","react-virtualized","react-dom","public/v1/api","util/popovers/withPopover"],t):"object"==typeof exports?exports.card=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)):e.card=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])}(this,function(e,t,n,r,o,i,a,s,u,c,l,f){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t-1){t.stopPropagation();var n=$(t.target).data("row-index");e.onRowClick(t,n)}}),$(this.cardRef).parent().on("refreshData",this.onRefreshData),$(this.cardRef).on("columnsConfigured",this.onColumnsConfigured),$(this.cardRef).on("sortConfigured",this.onSortConfigured)},componentWillUnmount:function(){$(this.cardRef).parent().off("refreshData",this.onRefreshData),$(this.cardRef).off("columnsConfigured",this.onColumnsConfigured),$(this.cardRef).off("sortConfigured",this.onSortConfigured)},componentWillReceiveProps:function(e){var t=e.concepts,n=e.relationships,r=e.properties,o=this.props,i=o.concepts,a=o.relationships,s=o.properties;i===t&&a===n&&s===r||this.onRefreshData()},render:function(){function e(e,t,n){if(e){if(n&&Object.keys(n).length){if(Object.keys(t).length<=2)return!0;var r=_.findKey(t,function(e){return e.active||!1});return!n[e][r]}return!0}}var t=this,r=this.state,o=r.tableView,i=r.tableData,a=this.props,s=a.configureItem,l=a.item,f=l.configuration.searchId;return React.createElement("div",{className:"com-visallo-table",ref:function(e){t.cardRef=e}},function(){if(f){if(e(f,o,i)){var r=c(f,i)?i18n("com.visallo.table.watermark.empty"):i18n("com.visallo.table.watermark.loading");return React.createElement("div",{className:"watermark"},React.createElement("h1",null,r))}var a=t.transformDataToProps();return React.createElement(n,u({},a,{showRowNumbers:o.showRowNumbers,onRowsRendered:t.loadRows,onTabClick:t.switchToTab,onRowClick:t.onRowClick,onContextMenu:t.onContextMenu,onHeaderClick:t.onHeaderClick,onConfigureColumnsClick:t.toggleColumnConfigPopover,onColumnResize:t.onColumnResizeThrottled}))}return React.createElement("a",{onClick:s},i18n("com.visallo.table.config.search"))}())},transformDataToProps:function(){var e=this.state,t=e.tableData,n=e.tableView,r=t[this.props.item.configuration.searchId],o=_.findKey(n,function(e){return e.active||!1}),i=n.url.indexOf("vertex")>-1?this.props.selection.vertices:this.props.selection.edges,a=n[o],s=a.sortColumn,u=a.direction,c={tabs:r.buckets,activeTab:o,sort:{property:s,direction:u},data:r[o],columns:n[o].columns,selected:i};return this.scrollToTop&&(c.scrollToIndex=0,this.scrollToTop=!1),c},loadTable:function(){var e=this,t=this.props,n=t.item,r=t.extension,o=t.showError,i=t.configurationChanged,a=n.configuration,s=a.searchId,c=a.tableSettings,l=void 0;return this.dataRequest("search","get",s).catch(function(e){throw new Error("Search unavailable")}).then(function(t){var r={showRowNumbers:!0,url:t.url},o=u({},n.configuration,{searchParameters:t.parameters});n.configuration=o,c&&c[s]?(l=u({},c[s],{url:t.url}),_.isUndefined(l.showRowNumbers)&&(l.showRowNumbers=!0)):c&&t.parameters.conceptType&&c[t.parameters.conceptType]?(l=u({},c[t.parameters.conceptType],{url:t.url}),_.isUndefined(l.showRowNumbers)&&(l.showRowNumbers=!0)):l=r,e.updateTableView(l)}).then(this.loadTabs).then(function(t){if(Object.keys(t).length){l=e.updateTabsSettings(s,t);var n=_.findKey(l,function(e){return e.active||!1});n||(n=Object.keys(t)[0],l[n].active=!0),e.updateTableView(l)}}).catch(function(e){"Search unavailable"===e.message?(n.configuration=_.omit(n.configuration,"searchId","searchParameters"),n.configuration.tableSettings&&(n.configuration.tableSettings=_.omit(n.configuration.tableSettings,s)),i({item:n,extension:r})):(console.warn(e),o())})},loadTabs:function(){var e=this,t=this.state,n=t.tableData,r=t.tableView,o=this.props,i=o.concepts,a=o.relationships,s=this.props.item.configuration,c=s.searchId,l=s.searchParameters,f=r.url,d=function(e,t){var n=e.indexOf("vertex")>-1?"vertex":"edge",r=p[n],o=[JSON.stringify({type:"term",name:"field",field:r})];return u({},t,{size:0,aggregations:o})}(f,l);return this.dataRequest("search","run",c,d).then(function(t){var r=_.mapObject(t.aggregates.field.buckets,function(e,t){var n=f.indexOf("vertex")>-1?i[t].displayName:a[t].displayName;return u({},e,{displayName:n})});return n[c]||(n[c]={}),n[c].buckets=r,_.mapObject(r,function(e,t){for(var r=e.count,o=[],i=0;i-1?"vertex":"edge";if(!c(b,f)){t+=1,t=Math.min(t,f[b].buckets[x].count);var S=function(e,t,n,r,i,a){var s,c=n[r],l=c.direction,f=c.sortPropertyIri,p=[f+":"+l],d=t.indexOf("vertex")>-1?"conceptTypes":"edgeLabels";return u({},e,(s={},o(s,d,JSON.stringify([{iri:r,includeChildNodes:!1}])),o(s,"sort[]",p),o(s,"offset",i),o(s,"size",a-i),s))}(w,v,p,x,e,t);return function(e,t){_.range(e,t).forEach(function(e){f[b][x][e]="loading"})}(e,t),this.dataRequest("search","run",b,S).then(function(e){return n(e.elements)}).then(function(n){for(var r=0,o=e;o-1?"vertex":"edge",{concepts:o,relationships:i,properties:s}),l=u({},f);return n[t]?function(){var e=n[t],r=e.sortPropertyIri,o=e.direction,i=e.columns,a=e.active,s=c.reduce(function(e,t){var n=i.find(function(e){return e.title===t.title});return e.push(n||t),e},[]);l=u({},l,{sortPropertyIri:c[r]?r:f.sortPropertyIri,direction:c[r]?o:f.direction,columns:s,active:a})}():l=u({},l,{columns:c}),l},updateTableView:function(e,t){if(this.setState({tableView:e}),this.props.editable&&!1!==t){var n=this.props,r=n.item,o=n.extension,i=n.configurationChanged;r.configuration.tableSettings||(r.configuration.tableSettings={}),r.configuration.tableSettings[r.configuration.searchId]=e,i({item:r,extension:o,recreate:!1})}},switchToTab:function(e){var t=this,n=this.state.tableView;n=_.mapObject(n,function(t,n){if(_.isObject(t)){return u({},t,{active:n===e})}return t}),this.scrollToTop=!0,this.updateTableView(n),_.defer(function(){t.loadRows(0,25)})},onRowClick:function(e,t){function n(e,t){var n=[];return _.forEach(t,function(t){n.push(e[t].id)}),n}var o=t.index,i=this.state,a=i.tableData,s=i.tableView,u=i.previousRowClickIndex,c=this.props.item.configuration.searchId,l=s.url,f=this.props.selection,p=_.findKey(s,function(e){return e.active||!1}),d=a[c][p],h=f.vertices,m=f.edges,g={vertices:[].concat(r(h)),edges:[].concat(r(m))},v=l.indexOf("vertex")>-1?"vertices":"edges",y=f[v].map(function(e){return parseInt(_.findIndex(d,function(t){return t&&t.id===e}))});if(function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?e.metaKey:e.ctrlKey}(e))_.contains(y,o)?y=_.without(y,o):y.push(o),g[v]=n(d,y);else if(e.shiftKey){var b=Math.min(o,u),w=Math.max(o,u);y=_.range(b,w+1),g[v]=n(d,y)}else{var x=d[o].id;g[v]=[x]}e.shiftKey||this.setState({previousRowClickIndex:o}),this.props.onSetSelection(g)},onContextMenu:function(e,t){e.nativeEvent.preventDefault();var n=this.state,r=n.tableData,o=n.tableView,i=o.url,a=this.props.item.configuration.searchId,s=_.findKey(o,function(e){return e.active||!1}),u=r[a][s],c=u[t].id,l={x:e.clientX,y:e.clientY};i.indexOf("vertex")>-1?this.props.onVertexMenu(e.nativeEvent.target,c,l):this.props.onEdgeMenu(e.nativeEvent.target,[c],l)},onHeaderClick:function(e){var t=this.state,n=t.tableData,r=t.tableView,o=this.props.item.configuration.searchId,i=_.findKey(r,function(e){return e.active||!1}),a=r[i],s=a.columns.find(function(t){return t.title===e});s.sortPropertyIri||(s.sortPropertyIri=function(e,t){return!e.dependentPropertyIris?t:e.dependentPropertyIris[0]}(this.props.properties[e],e));var c=s.sortPropertyIri,l=a.sortPropertyIri&&"ASCENDING"!==a.direction?"ASCENDING":"DESCENDING";!1!==this.props.properties[c].sortable&&(a=u({},a,{sortPropertyIri:c,sortColumn:e,direction:l}),r[i]=a,this.scrollToTop=!0,this.updateTableView(r),n[o][i]=n[o][i].map(function(e){return null}),this.setState({tableData:n}),this.loadRows(0,25))},onColumnResize:function(e,t,n){var r=this.state.tableView,o=_.findKey(r,function(e){return e.active||!1}),i=r[o],a=_.findIndex(i.columns,function(t){return t.title===e});r[o].columns[a].width=t,this.updateTableView(r,n)},toggleColumnConfigPopover:function(e){var t=this.state.tableView,n=this.props.properties,r=_.findKey(t,function(e){return e.active||!1}),o=t[r],a=function(e,t){var n=t.sortColumn;if(n){var r=e[n],o=!!r.dependentPropertyIris,i=o?r.dependentPropertyIris.map(function(n){var r=e[n];return!1===r.userVisible||!1===r.sortable?null:{displayName:r.displayName,active:t.sortPropertyIri===n}}):null;return{property:r.displayName,isCompoundProperty:o,dependentProperties:i?i.filter(function(e){return!!e}):null}}return{}}(n,o),s=e.target,u=$(s).lookupComponent(i);if(u)return u.teardown();i.attachTo(s,{columns:o.columns,showRowNumbers:t.showRowNumbers,sortConfig:a})},onSortConfigured:function(e,t){function n(e){return this.props.properties.list.find(function(t){return t.displayName===e}).title}var r=this.state,o=r.tableView,i=r.tableData,a=this.props.item.configuration.searchId,s=_.findKey(o,function(e){return e.active||!1}),u=o[s],c=n(t.sortColumn),l=n(t.propertyName),f=_.findIndex(u.columns,function(e){return e.title===c});this.scrollToTop=!0,o[s].sortPropertyIri=o[s].columns[f].sortPropertyIri=l,this.updateTableView(o),i[a][s]=i[a][s].map(function(e){return null}),this.setState({tableData:i}),this.loadRows(0,25)},onColumnsConfigured:function(e,t){var n=this.state.tableView,r=_.findKey(n,function(e){return e.active||!1}),o=n[r].columns,i=t.selectedColumns,a=t.showRowNumbers;_.isUndefined(i)||function(){var e=[],t=[];o.map(function(n){var r=_.indexOf(i,n.title);r>-1?e[r]=u({},n,{visible:!0}):t.push(u({},n,{visible:!1}))}),n[r].columns=e.concat(t)}(),_.isUndefined(a)||(n.showRowNumbers=a),this.updateTableView(n)}})}.apply(t,i))&&(e.exports=a)},function(e,t,n){function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var o,i,a=Object.assign||function(e){for(var t=1;tn})},render:function(){var e=this,t=this.state,r=t.offset,o=t.overflow,i=this.props,a=i.tabs,s=i.activeTab,u=i.onTabClick;return React.createElement("div",{className:"tabs"},React.createElement("div",{className:"list-container",ref:function(t){e._container=t}},React.createElement("ul",{className:"tab-list",ref:function(t){e._tabs=t},style:{marginLeft:-r+"px"}},Object.keys(a).map(function(e){var t=a[e],n=t.count,r=t.displayName,o=e===s?"active":"";return React.createElement("li",{onClick:function(){return u(e)},key:e,className:o},React.createElement("span",{className:"name"},r),React.createElement("span",{className:"count"},n))}))),React.createElement(n,{offset:r,overflow:o,onScrollClick:this.onScrollClick}))}})}.apply(t,r))&&(e.exports=o)},function(e,t,n){var r,o;r=[n(0),n(13)],void 0!==(o=function(e,t){"use strict";var n=function(e){var n=e.offset,r=e.overflow,o=e.onScrollClick,i=["scrollButton","disable-text-selection"];return React.createElement("div",{className:"tabScrollButtons"},React.createElement("div",{className:t(i,{disabled:0===n}),onClick:function(){return o("left")}}," ◀ "),React.createElement("div",{className:t(i,{disabled:!r}),onClick:function(){return o("right")}}," ▶ "))};return n.propTypes={offset:e.number,overflow:e.bool,onScrollClick:e.func},n}.apply(t,r))&&(e.exports=o)},function(e,t){e.exports=s},function(e,t,n){var r,o,i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return R({touchAction:"none"},e)}function w(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)"+t+"(?!\\S)"))||(e.className+=" "+t)}function x(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)"+t+"(?!\\S)","g"),"")}Object.defineProperty(t,"__esModule",{value:!0});var R=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r2?n-2:0),o=2;o: Unmounted during event!");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundPosition=r,t.snapToGrid=o,t.canDragX=i,t.canDragY=a,t.getControlPosition=s,t.createCoreData=u,t.createDraggableData=c;var p=n(0),d=n(4),h=function(e){return e&&e.__esModule?e:{default:e}}(d),m=n(5)},function(e,t,n){"use strict";(function(e){function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n not mounted on DragStart!");var n=t.ownerDocument;if(!(r.props.disabled||!(e.target instanceof n.defaultView.Node)||r.props.handle&&!(0,m.matchesSelectorAndParentsTo)(e.target,r.props.handle,t)||r.props.cancel&&(0,m.matchesSelectorAndParentsTo)(e.target,r.props.cancel,t))){var o=(0,m.getTouchIdentifier)(e);r.setState({touchIdentifier:o});var i=(0,g.getControlPosition)(e,o,r);if(null!=i){var a=i.x,s=i.y,u=(0,g.createCoreData)(r,a,s);(0,b.default)("DraggableCore: handleDragStart: %j",u),(0,b.default)("calling",r.props.onStart);!1!==r.props.onStart(e,u)&&(r.props.enableUserSelectHack&&(0,m.addUserSelectStyles)(n),r.setState({dragging:!0,lastX:a,lastY:s}),(0,m.addEvent)(n,x.move,r.handleDrag),(0,m.addEvent)(n,x.stop,r.handleDragStop))}}},r.handleDrag=function(e){"touchmove"===e.type&&e.preventDefault();var t=(0,g.getControlPosition)(e,r.state.touchIdentifier,r);if(null!=t){var n=t.x,o=t.y;if(Array.isArray(r.props.grid)){var i=n-r.state.lastX,a=o-r.state.lastY,u=(0,g.snapToGrid)(r.props.grid,i,a),c=s(u,2);if(i=c[0],a=c[1],!i&&!a)return;n=r.state.lastX+i,o=r.state.lastY+a}var l=(0,g.createCoreData)(r,n,o);(0,b.default)("DraggableCore: handleDrag: %j",l);if(!1!==r.props.onDrag(e,l))r.setState({lastX:n,lastY:o});else try{r.handleDragStop(new MouseEvent("mouseup"))}catch(e){var f=document.createEvent("MouseEvents");f.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.handleDragStop(f)}}},r.handleDragStop=function(e){if(r.state.dragging){var t=(0,g.getControlPosition)(e,r.state.touchIdentifier,r);if(null!=t){var n=t.x,o=t.y,i=(0,g.createCoreData)(r,n,o),a=h.default.findDOMNode(r);a&&r.props.enableUserSelectHack&&(0,m.removeUserSelectStyles)(a.ownerDocument),(0,b.default)("DraggableCore: handleDragStop: %j",i),r.setState({dragging:!1,lastX:NaN,lastY:NaN}),r.props.onStop(e,i),a&&((0,b.default)("DraggableCore: Removing handlers"),(0,m.removeEvent)(a.ownerDocument,x.move,r.handleDrag),(0,m.removeEvent)(a.ownerDocument,x.stop,r.handleDragStop))}}},r.onMouseDown=function(e){return x=w.mouse,r.handleDragStart(e)},r.onMouseUp=function(e){return x=w.mouse,r.handleDragStop(e)},r.onTouchStart=function(e){return x=w.touch,r.handleDragStart(e)},r.onTouchEnd=function(e){return x=w.touch,r.handleDragStop(e)},a=n,i(r,a)}return a(t,e),u(t,[{key:"componentWillUnmount",value:function(){var e=h.default.findDOMNode(this);if(e){var t=e.ownerDocument;(0,m.removeEvent)(t,w.mouse.move,this.handleDrag),(0,m.removeEvent)(t,w.touch.move,this.handleDrag),(0,m.removeEvent)(t,w.mouse.stop,this.handleDragStop),(0,m.removeEvent)(t,w.touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&(0,m.removeUserSelectStyles)(t)}}},{key:"render",value:function(){return l.default.cloneElement(l.default.Children.only(this.props.children),{style:(0,m.styleHacks)(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),t}(l.default.Component);R.displayName="DraggableCore",R.propTypes={allowAnyClick:p.default.bool,disabled:p.default.bool,enableUserSelectHack:p.default.bool,offsetParent:function(t,n){if(!0===e.browser&&t[n]&&1!==t[n].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:p.default.arrayOf(p.default.number),handle:p.default.string,cancel:p.default.string,onStart:p.default.func,onDrag:p.default.func,onStop:p.default.func,onMouseDown:p.default.func,className:v.dontSetMe,style:v.dontSetMe,transform:v.dontSetMe},R.defaultProps={allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){}},t.default=R}).call(t,n(20))},function(e,t,n){"use strict";function r(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";var r=n(13).default;e.exports=r,e.exports.default=r,e.exports.DraggableCore=n(10).default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 u=Object.assign||function(e){for(var t=1;t, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}},{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&g.default.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillReceiveProps",value:function(e){!e.position||this.props.position&&e.position.x===this.props.position.x&&e.position.y===this.props.position.y||this.setState({x:e.position.x,y:e.position.y})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"render",value:function(){var e,t={},n=null,r=Boolean(this.props.position),i=!r||this.state.dragging,a=this.props.position||this.props.defaultPosition,s={x:(0,w.canDragX)(this)&&i?this.state.x:a.x,y:(0,w.canDragY)(this)&&i?this.state.y:a.y};this.state.isElementSVG?n=(0,b.createSVGTransform)(s):t=(0,b.createCSSTransform)(s);var c=this.props,l=c.defaultClassName,f=c.defaultClassNameDragging,d=c.defaultClassNameDragged,h=p.default.Children.only(this.props.children),m=(0,y.default)(h.props.className||"",l,(e={},o(e,f,this.state.dragging),o(e,d,this.state.dragged),e));return p.default.createElement(S.default,u({},this.props,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),p.default.cloneElement(h,{className:m,style:u({},h.props.style,t),transform:n}))}}]),t}(p.default.Component);T.displayName="Draggable",T.propTypes=u({},S.default.propTypes,{axis:h.default.oneOf(["both","x","y","none"]),bounds:h.default.oneOfType([h.default.shape({left:h.default.number,right:h.default.number,top:h.default.number,bottom:h.default.number}),h.default.string,h.default.oneOf([!1])]),defaultClassName:h.default.string,defaultClassNameDragging:h.default.string,defaultClassNameDragged:h.default.string,defaultPosition:h.default.shape({x:h.default.number,y:h.default.number}),position:h.default.shape({x:h.default.number,y:h.default.number}),className:x.dontSetMe,style:x.dontSetMe,transform:x.dontSetMe}),T.defaultProps=u({},S.default.defaultProps,{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null}),t.default=T},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(8),a=n(15),s=n(3),u=n(16);e.exports=function(e,t){function n(e){var t=e&&(T&&e[T]||e[E]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function f(e){function n(n,u,c,f,p,d,h){if(f=f||k,d=d||c,h!==s)if(t)o(!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");else if("production"!==Object({DRAGGABLE_DEBUG:void 0}).NODE_ENV&&"undefined"!=typeof console){var m=f+":"+c;!r[m]&&a<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",d,f),r[m]=!0,a++)}return null==u[c]?n?new l(null===u[c]?"The "+p+" `"+d+"` is marked as required in `"+f+"`, but its value is `null`.":"The "+p+" `"+d+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(u,c,f,p,d)}if("production"!==Object({DRAGGABLE_DEBUG:void 0}).NODE_ENV)var r={},a=0;var u=n.bind(null,!1);return u.isRequired=n.bind(null,!0),u}function p(e){function t(t,n,r,o,i,a){var s=t[n];if(R(s)!==e)return new l("Invalid "+o+" `"+i+"` of type `"+S(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return f(t)}function d(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new l("Invalid "+o+" `"+i+"` of type `"+R(a)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u>",D={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:function(){return f(r.thatReturnsNull)}(),arrayOf:d,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new l("Invalid "+o+" `"+i+"` of type `"+R(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return f(t)}(),instanceOf:h,node:function(){function e(e,t,n,r,o){return w(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return f(e)}(),objectOf:g,oneOf:m,oneOfType:v,shape:y,exact:b};return l.prototype=Error.prototype,D.checkPropTypes=u,D.PropTypes=D,D}},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),c=1;c0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var n=0;n1)for(var n=1;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t-1&&(t+=" selected")}return React.createElement("div",i({},h,{className:t,key:l,style:f,onContextMenu:function(e){d(e,r)},"data-row-index":r}),n)}return e}.apply(t,r))&&(e.exports=o)},function(e,t,n){var r,o;r=[n(23),n(24)],void 0!==(o=function(e,t){"use strict";function n(){this.defaultAttrs({inputSelector:".popover-content input",selectAllSelector:".select-all",rowNumbersSelector:".row-numbers",sortConfigSelector:".sort-property-select",columns:null,showRowNumbers:null,sortConfig:null,template:"/org/visallo/web/table/hbs/columnConfigPopover"}),this.after("initialize",function(){this.selectedColumnIris=_.chain(this.attr.columns).filter(function(e){return e.visible}).map(function(e){return e.title}).value(),this.after("setupWithTemplate",function(){this.updateSelectAllCheckbox(),this.on(this.popover,"change",{inputSelector:this.onChange,selectAllSelector:this.onSelectAllChange,rowNumbersSelector:this.onRowNumbersChange,sortConfigSelector:this.onSortConfigChange}),this.popover.find("ul").sortable({axis:"y",cursor:"move",tolerance:"pointer",containment:"parent"}).on("sortupdate",this.onChange.bind(this)),this.positionDialog()})}),this.onSelectAllChange=function(e){var t=$(e.target),n=t.is(":checked");$(this.attr.inputSelector,this.popover).prop("checked",n).trigger("change")},this.onRowNumbersChange=function(e){var t=$(e.target),n=t.is(":checked");this.trigger("columnsConfigured",{showRowNumbers:n})},this.onSortConfigChange=function(e){var t=$(e.target),n=t.val();this.trigger("sortConfigured",{sortColumn:this.attr.sortConfig.property,propertyName:n})},this.onChange=function(){this.selectedColumnIris=_.unique(this.popover.find("ul li input:checked").map(function(){return $(this).val()})),this.updateSelectAllCheckbox(),this.trigger("columnsConfigured",{selectedColumns:this.selectedColumnIris})},this.updateSelectAllCheckbox=function(){var e=this,t=$(this.attr.selectAllSelector,this.popover);0===this.selectedColumnIris.length?t.prop("checked",!1).prop("indeterminate",!1):this.selectedColumnIris.length===$(this.attr.inputSelector,this.popover).size()?t.prop("checked",!0).prop("indeterminate",!1):t.prop("checked",!0).prop("indeterminate",!0).off("click").one("click",function(t){e.onSelectAllChange(t)})}}return e.defineComponent(n,t)}.apply(t,r))&&(e.exports=o)},function(e,t){e.exports=l},function(e,t){e.exports=f}])});
//# sourceMappingURL=card.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy