diff --git a/.eslintskipwords.js b/.eslintskipwords.js index 909de419..8347d57c 100644 --- a/.eslintskipwords.js +++ b/.eslintskipwords.js @@ -10,6 +10,7 @@ module.exports = [ "jwt", "microservice", "init", + "concat", "http", "stringify", "tokenize", @@ -21,10 +22,19 @@ module.exports = [ "microservices", "ui", "tooltip", + "interactor", + "comparator", + "shortid", "br", "svg", + "li", + "decendants", + "fns", + "unselect", + "fn", "eslint", "checkbox", + "const", "socialpanelheader", "socialpanelbody", "searchpanel", diff --git a/TreeControlInteractor/index.js b/TreeControlInteractor/index.js new file mode 100644 index 00000000..cdf8a5f2 --- /dev/null +++ b/TreeControlInteractor/index.js @@ -0,0 +1,3 @@ +"use strict" + +module.exports = require("./lib/TreeControlInteractor"); \ No newline at end of file diff --git a/TreeControlInteractor/lib/TreeControlInteractor.js b/TreeControlInteractor/lib/TreeControlInteractor.js index 7eed540a..59b2d9dd 100644 --- a/TreeControlInteractor/lib/TreeControlInteractor.js +++ b/TreeControlInteractor/lib/TreeControlInteractor.js @@ -1,2 +1,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.TreeControlInteractor=t(require("react")):e.TreeControlInteractor=t(e.react)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?t-1:0),r=1;r0,i=function u(){var n=r.length?r.shift():null,i=function(){return n.forEach(function(n){Array.isArray(n.ChildTabs)?e(n,t):null,Array.isArray(n.ChildTabs)&&n.ChildTabs.length?r.push(n.ChildTabs):null,o?u():a()})},c=function(){return null};n?i():c()},a=function(){return null};i()}},{key:"findParent",value:function(e){var t={},n=function(e){t=e||{}},r=function(t,r){var o=parseInt(t.TabId)===parseInt(e.ParentTabId);o?n(t):null};return this.traverse(r),t}},{key:"updateTree",value:function(e){var t=null,n=function(n,r){n=JSON.parse(JSON.stringify(e)),t=r},r=function(t,r){parseInt(t.TabId)===parseInt(e.TabId)?n(t,r):null};this.traverse(r),this.setState({tabs:t}),this["export"](this.state.tabs)}},{key:"reAlignTree",value:function(){var e=this,t=[],n=function(e){var n;return e.ChildTabs.length?(n=t).push.apply(n,o(e.ChildTabs)):null};this.traverse(n);var r=function(n){t=[];var r=0,o=[],i=[];n.ChildTabs;n.ChildTabs.forEach(function(e){e.HasChildren?o.push(e):i.push(e)});var a=i.length+o.length*e.fullyChecked;switch(i.forEach(function(t){t.CheckedState===e.individuallyChecked?r+=1:null}),o.forEach(function(t){switch(!0){case t.CheckedState===e.fullyChecked:return void(r+=2);case t.CheckedState===e.individuallyChecked:return void(r+=1);default:return}}),!0){case r===a&&n.HasChildren:n.CheckedState=n.CheckedState===e.individuallyChecked?e.fullyChecked:n.CheckedState;break;case 0!==r&&r===a&&!n.HasChildren:n.CheckedState=e.individuallyChecked;break;case 0!==r&&r1)for(var n=1;n0;)r=p.nextValue(),e=Math.floor(r*t.length),n.push(t.splice(e,1)[0]);return n.join("")}function c(){return d?d:d=u()}function s(e){var t=c();return t[e]}var l,f,d,p=n(27),h="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";e.exports={characters:i,seed:a,lookup:s,shuffled:c}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"block";return{display:e}},listStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";return{listStyle:e}},textAlign:function(e){return{textAlign:e}},"float":function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left";return{"float":e}},clearFix:function(e){return{clear:e}},padding:function(e){var t=e.top,n=void 0===t?0:t,r=e.left,o=void 0===r?0:r,i=e.right,a=void 0===i?0:i,u=e.bottom,c=void 0===u?0:u,s=e.all,l=void 0===s?void 0:s,f=e.horizontal,d=void 0===f?void 0:f,p=e.vertical,h=void 0===p?void 0:p;return{padding:" "+(l||h||n)+"px\n "+(l||d||a)+"px\n "+(l||h||c)+"px\n "+(l||d||o)+"px"}},margin:function(e){var t=e.top,n=void 0===t?0:t,r=e.left,o=void 0===r?0:r,i=e.right,a=void 0===i?0:i,u=e.bottom,c=void 0===u?0:u,s=e.all,l=void 0===s?void 0:s,f=e.horizontal,d=void 0===f?void 0:f,p=e.vertical,h=void 0===p?void 0:p;return{margin:"\n "+(l||h||n)+"px\n "+(l||d||a)+"px\n "+(l||h||c)+"px\n "+(l||d||o)+"px"}},width:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"%";return{width:""+e+t}},height:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return{height:""+e+t}},backgroundColor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"orange";return{backgroundColor:e}},merge:function(){for(var e=arguments.length,t=Array(e),r=0;r1?t-1:0),r=1;r2?r-2:0),i=2;i>4*r&15|o()),n=t0,i=function u(){var n=r.length?r.shift():null,i=function(){return n.forEach(function(n){Array.isArray(n.ChildTabs)?e(n,t.props.tabs):null,Array.isArray(n.ChildTabs)&&n.ChildTabs.length?r.push(n.ChildTabs):null,o?u():a()})},c=function(){return null};n?i():c()},a=function(){return null};i()}},{key:"_mapToParentTabs",value:function(e,t){var n=this,r=function(e){return Object.keys(e).length>0};e=this.props.findParent(e);var o=function a(){e?t(e):null,e=parseInt(e.TabId)!==-1?n.props.findParent(e):{},r(e)?a():i()},i=function(){return null};o()}},{key:"_mapToChildTabs",value:function(e,t){var n=e.ChildTabs,r=[];r.push(n);var o=r.length>0,i=function u(){var e=r.length?r.shift():null,n=function(){return e.forEach(function(e){Array.isArray(e.ChildTabs)?t(e):null,Array.isArray(e.ChildTabs)&&e.ChildTabs.length?r.push(e.ChildTabs):null,o?u():a()})},i=function(){return null};e?n():i()},a=function(){return null};i()}},{key:"setCheckedState",value:function(e){var t=this,n=function(){return e.HasChildren?t.selectParent(e):t.selectIndividual(e)};e.CheckedState?this.resetCheckedState(e):n()}},{key:"mapParentCheckedState",value:function(e){var t=this,n=[];e.ChildTabs.map(function(e){return e.CheckedState!==t.props.unchecked?n.push(!0):n.push(!1)}),n.indexOf(!1)!==-1?e.CheckedState=this.props.individuallyChecked:e.CheckedState=this.props.fullyChecked,this.props.updateTree(e)}},{key:"resetCheckedState",value:function(e){var t=this,n=function(e){e.CheckedState=t.props.unchecked,e.ChildrenSelected=!1,t.props.updateTree(e)},r=function(){e.CheckedState=t.props.unchecked,e.ChildrenSelected=!1,t.props.updateTree(e)};e.HasChildren?this._mapToChildTabs(e,n):r(),e.CheckedState=this.props.unchecked,e.ChildrenSelected=!1,this.props.updateTree(e);var o=this.props.findParent(e);this.setParentCheckedState(o),this.props.reAlignTree()}},{key:"setParentCheckedState",value:function(e){var t=this,n=e.ChildTabs||[],r=n.length,o=[],i=function(){switch(e.ChildrenSelected=!0,!0){case o.filter(function(e){return!!e}).length===r:return e.CheckedState=e.CheckedState===t.props.individuallyChecked?t.props.fullyChecked:e.CheckedState,void t.props.updateTree(e);case o.indexOf(!0)!==-1:return e.CheckedState=e.CheckedState===t.props.fullyChecked?t.props.individuallyChecked:e.CheckedState,void t.props.updateTree(e)}t.props.updateTree(e)},a=function(){e.CheckedState=t.props.individuallyChecked,e.ChildrenSelected=!1,t.props.updateTree(e)};n.forEach(function(e){return e.CheckedState?o.push(!0):o.push(!1)}),o.indexOf(!0)!==-1?i():a()}},{key:"selectParent",value:function(e){var t=this,n=function(e){switch(!0){case e.HasChildren===!0:return e.CheckedState=t.props.fullyChecked,e.ChildrenSelected=!0,void t.props.updateTree(e);case e.HasChildren===!1:return e.CheckedState=t.props.individuallyChecked,e.ChildrenSelected=!1,void t.props.updateTree(e)}};e.CheckedState=this.props.fullyChecked,e.ChildrenSelected=!0,this._mapToChildTabs(e,n),this.props.updateTree(e);var r=this.props.findParent(e);this.setParentCheckedState(r),this.props.reAlignTree()}},{key:"selectIndividual",value:function(e){e.CheckedState=this.props.individuallyChecked,e.ChildrenSelected=!1,this.props.updateTree(e);var t=this.props.findParent(e);this.setParentCheckedState(t),this.props.reAlignTree()}},{key:"expandParent",value:function(e){var t=this,n=e.HasChildren&&e.ChildTabs.length>0,r=function(){return e.IsOpen=!e.IsOpen},o=function(){t.props.getDescendantPortalTabs(e.TabId,function(){e.IsOpen=!e.IsOpen,t.props.updateTree(e)})};n?r():o(),this.props.updateTree(e)}},{key:"render_icon",value:function(e){var t=p.width(100),n="90deg"===e,r=l["default"].createElement("div",{style:v(t)},l["default"].createElement(this.icon,{animate:n,reset:!1,direction:e}));return r}},{key:"render_Bullet",value:function(e){var t=e.HasChildren,n=e.IsOpen&&e.ChildTabs.length?"90deg":"0deg",r=t?this.render_icon(n):function(){return null};return r}},{key:"render_ListBullet",value:function(e,t){var n=this,r=function(){var r=p.width(20,"px"),o=p.height(20,"px");return l["default"].createElement("div",{onClick:function(){return t()},style:v(h,r,o)},n.render_Bullet.call(n,e))}();return r}},{key:"render_ListCheckbox",value:function(e){var t=this,n=function(){return l["default"].createElement("div",{style:v(h)},l["default"].createElement("input",{type:"checkbox",onChange:function(){return t.setCheckedState.call(t,e)},checked:e.CheckedState}),l["default"].createElement("label",{onClick:function(){return t.setCheckedState.call(t,e)}}))}();return n}},{key:"render_tabName",value:function(e){var t=function(){var t=p.margin({top:10});return l["default"].createElement("span",{style:v(t)},e.Name)}();return t}},{key:"render_li",value:function(e){var t=this,n=function(){return e.map(function(e){var n=(p.listStyle(),p.textAlign("left"),p.padding({all:3}),p.padding({left:5}),t.render_tabName(e)),r=t.render_ListCheckbox(e),o=t.render_ListBullet.call(t,e,t.expandParent.bind(t,e)),i=t.render_tree(e.ChildTabs),a=function(e){var n=e.ChildTabs,r=function(){var n=[],r=function(e){var r=e.CheckedState!==t.props.unchecked;r?n.push(!0):n.push(!1)};t._mapToChildTabs(e,r);var o=n.indexOf(!0)!==-1;return o},o=function(){return null};return n.length?r():o()},u=function(){return l["default"].createElement("li",{key:e.Name},e.HasChildren?o:null,r,n,e.HasChildren&&a(e)||e.HasChildren&&e.CheckedState?l["default"].createElement("span",null,"*"):l["default"].createElement("span",null),i)},c=t.props.findParent(e),s=c.IsOpen||parseInt(e.TabId)===-1?u():null;return s})}();return n}},{key:"render_tree",value:function(e){var n=this,r=function(){return l["default"].createElement(t,{tabs:e,icon_type:"arrow_bullet",updateTree:n.props.updateTree.bind(n),reAlignTree:n.props.reAlignTree.bind(n),findParent:n.props.findParent.bind(n),fullyChecked:n.props.fullyChecked,individuallyChecked:n.props.individuallyChecked,unchecked:n.props.unchecked,"export":n.props["export"],PortalTabsParameters:n.props.PortalTabsParameters,getDescendantPortalTabs:n.props.getDescendantPortalTabs})}();return r}},{key:"render",value:function(){var e=p.listStyle(),t=(p.textAlign("left"),p.padding({all:3}),p.padding({left:5}),this.render_li(this.props.tabs));return l["default"].createElement("ul",{className:"page-picker",style:v(e)},t)}}]),t}(s.Component)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":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"!==("undefined"==typeof t?"undefined":c(t))&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":c(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)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowIcon=void 0;var s=function(){function e(e,t){for(var n=0;n\n\n'; -},function(e,t,n){"use strict";e.exports=n(24)},function(e,t,n){"use strict";function r(e){var t="",n=Math.floor(.001*(Date.now()-c));return n===i?o++:(o=0,i=n),t+=a(u.lookup,s),t+=a(u.lookup,e),o>0&&(t+=a(u.lookup,o)),t+=a(u.lookup,n)}var o,i,a=n(11),u=n(2),c=1459707606518,s=6;e.exports=r},function(e,t,n){"use strict";function r(e){var t=o.shuffled();return{version:15&t.indexOf(e.substr(0,1)),worker:15&t.indexOf(e.substr(1,1))}}var o=n(2);e.exports=r},function(e,t,n){"use strict";function r(t){return u.seed(t),e.exports}function o(t){return f=t,e.exports}function i(e){return void 0!==e&&u.characters(e),u.shuffled()}function a(){return s(f)}var u=n(2),c=(n(11),n(23)),s=n(22),l=n(25),f=n(28)||0;e.exports=a,e.exports.generate=a,e.exports.seed=r,e.exports.worker=o,e.exports.characters=i,e.exports.decode=c,e.exports.isValid=l},function(e,t,n){"use strict";function r(e){if(!e||"string"!=typeof e||e.length<6)return!1;for(var t=o.characters(),n=e.length,r=0;r=0&&m.splice(t,1)}function u(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function s(e,t){var n,r,o;if(t.singleton){var i=g++;n=b||(b=u(t)),r=l.bind(null,n,i,!1),o=l.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=d.bind(null,n),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=u(t),r=f.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function l(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t){var n=t.css,r=t.media;t.sourceMap;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n=t.css,r=(t.media,t.sourceMap);r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var p={},h=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},v=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),y=h(function(){return document.head||document.getElementsByTagName("head")[0]}),b=null,g=0,m=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=v()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a1?t-1:0),r=1;r0,i=function u(){var n=r.length?r.shift():null,i=function(){return n.forEach(function(n){Array.isArray(n.ChildTabs)?e(n,t):null,Array.isArray(n.ChildTabs)&&n.ChildTabs.length?r.push(n.ChildTabs):null,o?u():a()})},c=function(){return null};n?i():c()},a=function(){return null};i()}},{key:"findParent",value:function(e){var t={},n=function(e){t=e||{}},r=function(t){var r=parseInt(t.TabId)===parseInt(e.ParentTabId);r?n(t):null};return this.traverse(r),t}},{key:"updateTree",value:function(e){var t=null,n=function(n,r){n=JSON.parse(JSON.stringify(e)),t=r},r=function(t,r){parseInt(t.TabId)===parseInt(e.TabId)?n(t,r):null};this.traverse(r),this.setState({tabs:t}),this["export"](this.state.tabs)}},{key:"reAlignTree",value:function(){var e=this,t=[],n=function(e){var n;return e.ChildTabs.length?(n=t).push.apply(n,o(e.ChildTabs)):null};this.traverse(n);var r=function(n){t=[];var r=0,o=[],i=[];n.ChildTabs.forEach(function(e){e.HasChildren?o.push(e):i.push(e)});var a=i.length+o.length*e.fullyChecked;switch(i.forEach(function(t){t.CheckedState===e.individuallyChecked?r+=1:null}),o.forEach(function(t){switch(!0){case t.CheckedState===e.fullyChecked:return void(r+=2);case t.CheckedState===e.individuallyChecked:return void(r+=1);default:return}}),!0){case r===a&&n.HasChildren:n.CheckedState=n.CheckedState===e.individuallyChecked?e.fullyChecked:n.CheckedState;break;case 0!==r&&r===a&&!n.HasChildren:n.CheckedState=e.individuallyChecked;break;case 0!==r&&r1)for(var n=1;n0;)r=p.nextValue(),e=Math.floor(r*t.length),n.push(t.splice(e,1)[0]);return n.join("")}function c(){return d?d:d=u()}function s(e){var t=c();return t[e]}var l,f,d,p=n(27),h="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";e.exports={characters:i,seed:a,lookup:s,shuffled:c}},function(e,t){"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,n){(function(t){"use strict";function n(e,t,n,o,i,a,u,c){if(r(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,u,c],f=0;s=new Error(t.replace(/%s/g,function(){return l[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(1))},function(t,n){t.exports=e},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"block";return{display:e}},listStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";return{listStyle:e}},textAlign:function(e){return{textAlign:e}},"float":function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left";return{"float":e}},clearFix:function(e){return{clear:e}},padding:function(e){var t=e.top,n=void 0===t?0:t,r=e.left,o=void 0===r?0:r,i=e.right,a=void 0===i?0:i,u=e.bottom,c=void 0===u?0:u,s=e.all,l=void 0===s?void 0:s,f=e.horizontal,d=void 0===f?void 0:f,p=e.vertical,h=void 0===p?void 0:p;return{padding:" "+(l||h||n)+"px\n "+(l||d||a)+"px\n "+(l||h||c)+"px\n "+(l||d||o)+"px"}},margin:function(e){var t=e.top,n=void 0===t?0:t,r=e.left,o=void 0===r?0:r,i=e.right,a=void 0===i?0:i,u=e.bottom,c=void 0===u?0:u,s=e.all,l=void 0===s?void 0:s,f=e.horizontal,d=void 0===f?void 0:f,p=e.vertical,h=void 0===p?void 0:p;return{margin:"\n "+(l||h||n)+"px\n "+(l||d||a)+"px\n "+(l||h||c)+"px\n "+(l||d||o)+"px"}},width:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"%";return{width:""+e+t}},height:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return{height:""+e+t}},backgroundColor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"orange";return{backgroundColor:e}},merge:function(){for(var e=arguments.length,t=Array(e),r=0;r1?t-1:0),r=1;r2?r-2:0),i=2;i>4*r&15|o()),n=t0,i=function u(){var n=r.length?r.shift():null,i=function(){return n.forEach(function(n){Array.isArray(n.ChildTabs)?e(n,t.props.tabs):null,Array.isArray(n.ChildTabs)&&n.ChildTabs.length?r.push(n.ChildTabs):null,o?u():a()})},c=function(){return null};n?i():c()},a=function(){return null};i()}},{key:"_mapToParentTabs",value:function(e,t){var n=this,r=function(e){return Object.keys(e).length>0};e=this.props.findParent(e);var o=function a(){e?t(e):null,e=parseInt(e.TabId)!==-1?n.props.findParent(e):{},r(e)?a():i()},i=function(){return null};o()}},{key:"_mapToChildTabs",value:function(e,t){var n=e.ChildTabs,r=[];r.push(n);var o=r.length>0,i=function u(){var e=r.length?r.shift():null,n=function(){return e.forEach(function(e){Array.isArray(e.ChildTabs)?t(e):null,Array.isArray(e.ChildTabs)&&e.ChildTabs.length?r.push(e.ChildTabs):null,o?u():a()})},i=function(){return null};e?n():i()},a=function(){return null};i()}},{key:"setCheckedState",value:function(e){var t=this,n=function(){return e.HasChildren?t.selectParent(e):t.selectIndividual(e)};e.CheckedState?this.resetCheckedState(e):n()}},{key:"mapParentCheckedState",value:function(e){var t=this,n=[];e.ChildTabs.map(function(e){return e.CheckedState!==t.props.unchecked?n.push(!0):n.push(!1)}),n.indexOf(!1)!==-1?e.CheckedState=this.props.individuallyChecked:e.CheckedState=this.props.fullyChecked,this.props.updateTree(e)}},{key:"resetCheckedState",value:function(e){var t=this,n=function(e){e.CheckedState=t.props.unchecked,e.ChildrenSelected=!1,t.props.updateTree(e)},r=function(){e.CheckedState=t.props.unchecked,e.ChildrenSelected=!1,t.props.updateTree(e)};e.HasChildren?this._mapToChildTabs(e,n):r(),e.CheckedState=this.props.unchecked,e.ChildrenSelected=!1,this.props.updateTree(e);var o=this.props.findParent(e);this.setParentCheckedState(o),this.props.reAlignTree()}},{key:"setParentCheckedState",value:function(e){var t=this,n=e.ChildTabs||[],r=n.length,o=[],i=function(){switch(e.ChildrenSelected=!0,!0){case o.filter(function(e){return!!e}).length===r:return e.CheckedState=e.CheckedState===t.props.individuallyChecked?t.props.fullyChecked:e.CheckedState,void t.props.updateTree(e);case o.indexOf(!0)!==-1:return e.CheckedState=e.CheckedState===t.props.fullyChecked?t.props.individuallyChecked:e.CheckedState,void t.props.updateTree(e)}t.props.updateTree(e)},a=function(){e.CheckedState=t.props.individuallyChecked,e.ChildrenSelected=!1,t.props.updateTree(e)};n.forEach(function(e){return e.CheckedState?o.push(!0):o.push(!1)}),o.indexOf(!0)!==-1?i():a()}},{key:"selectParent",value:function(e){var t=this,n=function(e){switch(!0){case e.HasChildren===!0:return e.CheckedState=t.props.fullyChecked,e.ChildrenSelected=!0,void t.props.updateTree(e);case e.HasChildren===!1:return e.CheckedState=t.props.individuallyChecked,e.ChildrenSelected=!1,void t.props.updateTree(e)}};e.CheckedState=this.props.fullyChecked,e.ChildrenSelected=!0,this._mapToChildTabs(e,n),this.props.updateTree(e);var r=this.props.findParent(e);this.setParentCheckedState(r),this.props.reAlignTree()}},{key:"selectIndividual",value:function(e){e.CheckedState=this.props.individuallyChecked,e.ChildrenSelected=!1,this.props.updateTree(e);var t=this.props.findParent(e);this.setParentCheckedState(t),this.props.reAlignTree()}},{key:"expandParent",value:function(e){var t=this,n=e.HasChildren&&e.ChildTabs.length>0,r=function(){return e.IsOpen=!e.IsOpen},o=function(){t.props.getDescendantPortalTabs(e.TabId,function(){e.IsOpen=!e.IsOpen,t.props.updateTree(e)})};n?r():o(),this.props.updateTree(e)}},{key:"render_icon",value:function(e){var t=p.width(100),n="90deg"===e,r=l["default"].createElement("div",{style:v(t)},l["default"].createElement(this.icon,{animate:n,reset:!1,direction:e}));return r}},{key:"render_Bullet",value:function(e){var t=e.HasChildren,n=e.IsOpen&&e.ChildTabs.length?"90deg":"0deg",r=t?this.render_icon(n):function(){return null};return r}},{key:"render_ListBullet",value:function(e,t){var n=this,r=function(){var r=p.width(20,"px"),o=p.height(20,"px");return l["default"].createElement("div",{onClick:function(){return t()},style:v(h,r,o)},n.render_Bullet.call(n,e))}();return r}},{key:"render_ListCheckbox",value:function(e){var t=this,n=function(){return l["default"].createElement("div",{style:v(h)},l["default"].createElement("input",{type:"checkbox",onChange:function(){return t.setCheckedState.call(t,e)},checked:e.CheckedState}),l["default"].createElement("label",{onClick:function(){return t.setCheckedState.call(t,e)}}))}();return n}},{key:"render_tabName",value:function(e){var t=function(){var t=p.margin({top:10});return l["default"].createElement("span",{style:v(t)},e.Name)}();return t}},{key:"render_li",value:function(e){var t=this,n=function(){return e.map(function(e){var n=t.render_tabName(e),r=t.render_ListCheckbox(e),o=t.render_ListBullet.call(t,e,t.expandParent.bind(t,e)),i=t.render_tree(e.ChildTabs),a=function(e){var n=e.ChildTabs,r=function(){var n=[],r=function(e){var r=e.CheckedState!==t.props.unchecked;r?n.push(!0):n.push(!1)};t._mapToChildTabs(e,r);var o=n.indexOf(!0)!==-1;return o},o=function(){return null};return n.length?r():o()},u=function(){return l["default"].createElement("li",{key:e.Name},e.HasChildren?o:null,r,n,e.HasChildren&&a(e)||e.HasChildren&&e.CheckedState?l["default"].createElement("span",null,"*"):l["default"].createElement("span",null),i)},c=t.props.findParent(e),s=c.IsOpen||parseInt(e.TabId)===-1?u():null;return s})}();return n}},{key:"render_tree",value:function(e){var n=this,r=function(){return l["default"].createElement(t,{tabs:e,icon_type:"arrow_bullet",updateTree:n.props.updateTree.bind(n),reAlignTree:n.props.reAlignTree.bind(n),findParent:n.props.findParent.bind(n),fullyChecked:n.props.fullyChecked,individuallyChecked:n.props.individuallyChecked,unchecked:n.props.unchecked,"export":n.props["export"],PortalTabsParameters:n.props.PortalTabsParameters,getDescendantPortalTabs:n.props.getDescendantPortalTabs})}();return r}},{key:"render",value:function(){var e=p.listStyle(),t=this.render_li(this.props.tabs);return l["default"].createElement("ul",{className:"page-picker",style:v(e)},t)}}]),t}(s.Component);t["default"]=y},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":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"!==("undefined"==typeof t?"undefined":c(t))&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":c(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)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowIcon=void 0;var s=function(){function e(e,t){for(var n=0;n\r\n\r\n'},function(e,t,n){"use strict";e.exports=n(24)},function(e,t,n){"use strict"; +function r(e){var t="",n=Math.floor(.001*(Date.now()-c));return n===i?o++:(o=0,i=n),t+=a(u.lookup,s),t+=a(u.lookup,e),o>0&&(t+=a(u.lookup,o)),t+=a(u.lookup,n)}var o,i,a=n(11),u=n(2),c=1459707606518,s=6;e.exports=r},function(e,t,n){"use strict";function r(e){var t=o.shuffled();return{version:15&t.indexOf(e.substr(0,1)),worker:15&t.indexOf(e.substr(1,1))}}var o=n(2);e.exports=r},function(e,t,n){"use strict";function r(t){return u.seed(t),e.exports}function o(t){return f=t,e.exports}function i(e){return void 0!==e&&u.characters(e),u.shuffled()}function a(){return s(f)}var u=n(2),c=(n(11),n(23)),s=n(22),l=n(25),f=n(28)||0;e.exports=a,e.exports.generate=a,e.exports.seed=r,e.exports.worker=o,e.exports.characters=i,e.exports.decode=c,e.exports.isValid=l},function(e,t,n){"use strict";function r(e){if(!e||"string"!=typeof e||e.length<6)return!1;for(var t=o.characters(),n=e.length,r=0;r=0&&g.splice(t,1)}function u(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function s(e,t){var n,r,o;if(t.singleton){var i=m++;n=b||(b=u(t)),r=l.bind(null,n,i,!1),o=l.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=d.bind(null,n),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=u(t),r=f.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function l(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t){var n=t.css,r=t.media;t.sourceMap;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n=t.css,r=(t.media,t.sourceMap);r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var p={},h=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},v=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),y=h(function(){return document.head||document.getElementsByTagName("head")[0]}),b=null,m=0,g=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=v()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a 0; + const cachedChildTabs = []; + cachedChildTabs.push(ChildTabs); + const condition = cachedChildTabs.length > 0; const loop = () => { - const childtab = cached_childtabs.length ? cached_childtabs.shift() : null; - const left = () => childtab.forEach(tab => { + const childTab = cachedChildTabs.length ? cachedChildTabs.shift() : null; + const left = () => childTab.forEach(tab => { Array.isArray(tab.ChildTabs) ? comparator(tab, this.props.tabs) : null; - Array.isArray(tab.ChildTabs) && tab.ChildTabs.length ? cached_childtabs.push(tab.ChildTabs) : null; + Array.isArray(tab.ChildTabs) && tab.ChildTabs.length ? cachedChildTabs.push(tab.ChildTabs) : null; condition ? loop() : exit(); }); const right = () => null; - childtab ? left() : right(); + childTab ? left() : right(); }; const exit = () => null; @@ -62,19 +60,19 @@ export class TreeControl extends Component { _mapToChildTabs(tab, fn) { let ChildTabs = tab.ChildTabs; - const cached_childtabs = []; - cached_childtabs.push(ChildTabs); - const condition = cached_childtabs.length > 0; + const cachedChildTabs = []; + cachedChildTabs.push(ChildTabs); + const condition = cachedChildTabs.length > 0; const loop = () => { - const childtab = cached_childtabs.length ? cached_childtabs.shift() : null; - const left = () => childtab.forEach(tab => { + const childTab = cachedChildTabs.length ? cachedChildTabs.shift() : null; + const left = () => childTab.forEach(tab => { Array.isArray(tab.ChildTabs) ? fn(tab) : null; - Array.isArray(tab.ChildTabs) && tab.ChildTabs.length ? cached_childtabs.push(tab.ChildTabs) : null; + Array.isArray(tab.ChildTabs) && tab.ChildTabs.length ? cachedChildTabs.push(tab.ChildTabs) : null; condition ? loop() : exit(); }); const right = () => null; - childtab ? left() : right(); + childTab ? left() : right(); }; const exit = () => null; @@ -95,10 +93,10 @@ export class TreeControl extends Component { } resetCheckedState(tab) { - const unselectChildren = (childtab) => { - childtab.CheckedState = this.props.unchecked; - childtab.ChildrenSelected = false; - this.props.updateTree(childtab); + const unselectChildren = (childTab) => { + childTab.CheckedState = this.props.unchecked; + childTab.ChildrenSelected = false; + this.props.updateTree(childTab); }; const unselectIndividual = () => { @@ -267,11 +265,6 @@ export class TreeControl extends Component { render_li(tabs) { const render = (() => { return tabs.map(tab => { - const listStyle = styles.listStyle(); - const textLeft = styles.textAlign("left"); - const ULPadding = styles.padding({ all: 3 }); - const spanPadLeft = styles.padding({ left: 5 }); - const tabName = this.render_tabName(tab); const checkbox = this.render_ListCheckbox(tab); const bullet = this.render_ListBullet.call(this, tab, this.expandParent.bind(this, tab)); @@ -279,14 +272,14 @@ export class TreeControl extends Component { const anyChildrenSelected = (tab) => { const ChildTabs = tab.ChildTabs; const left = () => { - const truthyCheckedState = []; + const trueCheckedState = []; const AreChildrenChecked = (t) => { const condition = t.CheckedState !== this.props.unchecked; - condition ? truthyCheckedState.push(true) : truthyCheckedState.push(false); + condition ? trueCheckedState.push(true) : trueCheckedState.push(false); }; this._mapToChildTabs(tab, AreChildrenChecked); - const bool = truthyCheckedState.indexOf(true) !== -1 ? true : false; + const bool = trueCheckedState.indexOf(true) !== -1 ? true : false; return bool; }; const right = () => null; @@ -337,12 +330,7 @@ export class TreeControl extends Component { render() { const listStyle = styles.listStyle(); - const textLeft = styles.textAlign("left"); - const ULPadding = styles.padding({ all: 3 }); - const spanPadLeft = styles.padding({ left: 5 }); - const list_items = this.render_li(this.props.tabs); - return (
    {list_items} diff --git a/TreeControlInteractor/src/_treeControlInteractor.jsx b/TreeControlInteractor/src/TreeControlInteractor.jsx similarity index 88% rename from TreeControlInteractor/src/_treeControlInteractor.jsx rename to TreeControlInteractor/src/TreeControlInteractor.jsx index 4271ae4f..741d13d2 100644 --- a/TreeControlInteractor/src/_treeControlInteractor.jsx +++ b/TreeControlInteractor/src/TreeControlInteractor.jsx @@ -1,28 +1,20 @@ import React, { Component } from "react"; import { PropTypes } from "prop-types"; -import { TreeControl } from "./_treeControl"; -import { IconSelector } from "./icons/selector"; -import { global } from "./_global"; - -const styles = global.styles; -const floatLeft = styles.float(); -const merge = styles.merge; - +import TreeControl from "./TreeControl"; +import {IconSelector} from "./icons/IconSelector"; import "./styles.less"; -export class TreeControlInteractor extends Component { +export default class TreeControlInteractor extends Component { constructor(props) { super(); - this.cached_ChildTabs; + this.cachedChildTabs; this.icon = IconSelector("arrow_bullet"); this.PortalTabsParameters = props.PortalTabsParameters; - this.fullyChecked = 2; this.individuallyChecked = 1; this.unchecked = 0; - } componentWillMount() { @@ -47,8 +39,6 @@ export class TreeControlInteractor extends Component { } - - requestDescendantTabs(ParentTabId, callback) { let descendantTabs = []; @@ -116,19 +106,19 @@ export class TreeControlInteractor extends Component { traverse(comparator) { const copy = this.state.tabs; let ChildTabs = copy; - const cached_childtabs = []; - cached_childtabs.push(ChildTabs); - const condition = cached_childtabs.length > 0; + const cachedChildTabs = []; + cachedChildTabs.push(ChildTabs); + const condition = cachedChildTabs.length > 0; const loop = () => { - const childtab = cached_childtabs.length ? cached_childtabs.shift() : null; - const left = () => childtab.forEach(tab => { + const childTab = cachedChildTabs.length ? cachedChildTabs.shift() : null; + const left = () => childTab.forEach(tab => { Array.isArray(tab.ChildTabs) ? comparator(tab, copy) : null; - Array.isArray(tab.ChildTabs) && tab.ChildTabs.length ? cached_childtabs.push(tab.ChildTabs) : null; + Array.isArray(tab.ChildTabs) && tab.ChildTabs.length ? cachedChildTabs.push(tab.ChildTabs) : null; condition ? loop() : exit(); }); const right = () => null; - childtab ? left() : right(); + childTab ? left() : right(); }; const exit = () => null; @@ -136,28 +126,27 @@ export class TreeControlInteractor extends Component { return; } - findParent(tabdata) { + findParent(tabData) { let parent = {}; const capture = (tab) => { parent = tab || {}; }; - const find = (tab, copy) => { - const condition = parseInt(tab.TabId) === parseInt(tabdata.ParentTabId); + const find = (tab) => { + const condition = parseInt(tab.TabId) === parseInt(tabData.ParentTabId); condition ? capture(tab) : null; }; this.traverse(find); return parent; } - updateTree(tabdata) { - let updateTab = null; + updateTree(tabData) { let newState = null; const capture = (tab, copy) => { - tab = JSON.parse(JSON.stringify(tabdata)); + tab = JSON.parse(JSON.stringify(tabData)); newState = copy; }; const find = (tab, copy) => { - parseInt(tab.TabId) === parseInt(tabdata.TabId) ? capture(tab, copy) : null; + parseInt(tab.TabId) === parseInt(tabData.TabId) ? capture(tab, copy) : null; }; this.traverse(find); this.setState({ tabs: newState }); @@ -173,17 +162,12 @@ export class TreeControlInteractor extends Component { const realign = (tab) => { iterationsArray = []; let sum = 0; - let newState = null; const tabsWithChildren = []; const tabsWithoutChildren = []; - const ChildTabs = tab.ChildTabs; - tab.ChildTabs.forEach((t) => { t.HasChildren ? tabsWithChildren.push(t) : tabsWithoutChildren.push(t); }); - const expect = tabsWithoutChildren.length + tabsWithChildren.length * this.fullyChecked; - tabsWithoutChildren.forEach(t => { t.CheckedState === this.individuallyChecked ? sum += 1 : null; }); @@ -247,9 +231,7 @@ export class TreeControlInteractor extends Component { children = filterOnlyChildren(tabs); children = filterOutIfAllSelected(children, parents); parents = filterOutIfAllSelected(parents, parents); - const exports = parents.concat(children); - console.log(exports); this.props.OnSelect(exports); } @@ -278,7 +260,7 @@ export class TreeControlInteractor extends Component { TreeControlInteractor.propTypes = { PortalTabsParameters: PropTypes.object.isRequired, OnSelect: PropTypes.func.isRequired, - PortalTabParamters: PropTypes.object.isRequired, + PortalTabParameters: PropTypes.object.isRequired, getInitialPortalTabs: PropTypes.func.isRequired, getDescendantPortalTabs: PropTypes.func.isRequired }; diff --git a/TreeControlInteractor/src/_global.js b/TreeControlInteractor/src/global.js similarity index 74% rename from TreeControlInteractor/src/_global.js rename to TreeControlInteractor/src/global.js index 8b5fcd3f..aaaaf073 100644 --- a/TreeControlInteractor/src/_global.js +++ b/TreeControlInteractor/src/global.js @@ -40,10 +40,10 @@ export const global = { vertical = undefined }) => { return { - padding: ` ${all||vertical||top}px - ${all||horizontal||right}px - ${all||vertical||bottom}px - ${all||horizontal||left}px` + padding: ` ${all || vertical || top}px + ${all || horizontal || right}px + ${all || vertical || bottom}px + ${all || horizontal || left}px` }; }, @@ -58,10 +58,10 @@ export const global = { }) => { return { margin: ` - ${all||vertical||top}px - ${all||horizontal||right}px - ${all||vertical||bottom}px - ${all||horizontal||left}px` + ${all || vertical || top}px + ${all || horizontal || right}px + ${all || vertical || bottom}px + ${all || horizontal || left}px` }; }, @@ -83,7 +83,7 @@ export const global = { }; }, - merge: (...objs) => Object.assign({}, ...objs) + merge: (...objects) => Object.assign({}, ...objects) } }; diff --git a/TreeControlInteractor/src/icons/selector.js b/TreeControlInteractor/src/icons/IconSelector.js similarity index 98% rename from TreeControlInteractor/src/icons/selector.js rename to TreeControlInteractor/src/icons/IconSelector.js index 0b455310..2e314726 100644 --- a/TreeControlInteractor/src/icons/selector.js +++ b/TreeControlInteractor/src/icons/IconSelector.js @@ -11,5 +11,4 @@ export const IconSelector = (type) => { default: return ArrowIcon; } - }; \ No newline at end of file diff --git a/TreeControlInteractor/src/icons/__schema.js b/TreeControlInteractor/src/icons/__schema.js deleted file mode 100644 index bb916836..00000000 --- a/TreeControlInteractor/src/icons/__schema.js +++ /dev/null @@ -1,49 +0,0 @@ - - -import arrow_svg from './arrow_bullet.svg' - -export class ArrowIcon extends Component { - - state ={ - selected:false - } - - constructor(props){ - super() - this.props = props; - - } - - ComponentDidMount(){ - this.update() - } - - - update(){ - let {animate, reset} = this.props - this.animate(animate) - this.reset(reset) - } - - - animate = (bool) =>{ - this.setState({selected:!this.state.selected}) - } - - reset = (bool) => { - if(bool) - this.setState({selected:false}) - } - - - - - render(){ - return ( -
    - > -
    - ) - } - -} diff --git a/TreeControlInteractor/src/icons/arrow-icon/_arrow_icon.jsx b/TreeControlInteractor/src/icons/arrow-icon/_arrow_icon.jsx index c0dfb275..5b4dd63a 100644 --- a/TreeControlInteractor/src/icons/arrow-icon/_arrow_icon.jsx +++ b/TreeControlInteractor/src/icons/arrow-icon/_arrow_icon.jsx @@ -1,7 +1,7 @@ import React, { Component, PropTypes } from "react"; const arrow_svg = require("!raw!./arrow_bullet.svg"); -import { global } from "../../_global"; +import { global } from "../../global"; const styles = global.styles; const merge = styles.merge; @@ -24,6 +24,7 @@ export class ArrowIcon extends Component { this.direction = props.direction; this.id = shortid.generate(); this.shouldAnimate = props.animate; + this.state = {}; } diff --git a/TreeControlInteractor/src/index.js b/TreeControlInteractor/src/index.js deleted file mode 100644 index 0deb5fe1..00000000 --- a/TreeControlInteractor/src/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict" - -module.exports = "./lib/TreeControlInteractor"; \ No newline at end of file diff --git a/TreeControlInteractor/src/mocks/_portal-tabs-selected-root-only.js b/TreeControlInteractor/src/mocks/_portal-tabs-selected-root-only.js deleted file mode 100644 index b7d262d1..00000000 --- a/TreeControlInteractor/src/mocks/_portal-tabs-selected-root-only.js +++ /dev/null @@ -1,108 +0,0 @@ -export const tabs = { - "Name": "My Website", - "TabId": 23, - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Portal.png", - "Tooltip": null, - "ParentTabId": 0, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [{ - "Name": "Home", - "TabId": "20", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": -1, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": -1, - "ChildTabs": [ - { - "Name": "Inner Child 1", - "TabId": "201", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": 20, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [ - { - "Name": "Inner Inner Child 1", - "TabId": "20A", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '2011', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - } - ] - } - ] - }, { - "Name": "Activity Feed", - "TabId": "21", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": -1, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Child 2", - "TabId": "21A", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": 21, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Inner Child 2", - "TabId": "21AB", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '21A', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - } - ] - } - ] - }, { - "Name": "Search Results", - "TabId": "22", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": -1, - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - }, { - "Name": "404 Error Page", - "TabId": "23", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": -1, - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - }] - } diff --git a/TreeControlInteractor/src/mocks/_portal-tabs.js b/TreeControlInteractor/src/mocks/_portal-tabs.js deleted file mode 100644 index 80415e5b..00000000 --- a/TreeControlInteractor/src/mocks/_portal-tabs.js +++ /dev/null @@ -1,157 +0,0 @@ -export const PortalTabs = [{ - "Name": "My Website", - "TabId": "-1", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Portal.png", - "Tooltip": null, - "ParentTabId": "0", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 2, - "ChildTabs": [{ - "Name": "Home", - "TabId": "20", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": "-1", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 2, - "ChildTabs": [ - { - "Name": "Inner Child 1", - "TabId": "201", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": "20", - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - }, - { - "Name": "Inner Child 2", - "TabId": "202", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": "20", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 2, - "ChildTabs": [ - { - "Name": "Inner Inner Child 1", - "TabId": "2011", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '202', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - } - ,{ - "Name": "Inner Inner Sib 2", - "TabId": "2012", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '201', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - } - ] - }] - } - ,{ - "Name": "Activity Feed", - "TabId": "21", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": "-1", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 2, - "ChildTabs": [ - { - "Name": "Inner Child 2", - "TabId": "211", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": "21", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [ - { - "Name": "Inner Inner Child 2", - "TabId": "2111", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '211', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - } - ] - },{ - "Name": "Inner Child Sibling", - "TabId": "212", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": "21", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 2, - "ChildTabs": [ - { - "Name": "Inner Inner Child 2", - "TabId": "2121", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '212', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - } - ] - } - ] - },{ - "Name": "Search Results", - "TabId": "22", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": "-1", - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - },{ - "Name": "404 Error Page", - "TabId": "23", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": "-1", - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 1, - "ChildTabs": [] - } - ] - }] diff --git a/TreeControlInteractor/src/mocks/_portal-tabs2.js b/TreeControlInteractor/src/mocks/_portal-tabs2.js deleted file mode 100644 index ee229a5e..00000000 --- a/TreeControlInteractor/src/mocks/_portal-tabs2.js +++ /dev/null @@ -1,108 +0,0 @@ -export const tabs2 = { - "Name": "My Website", - "TabId": -1, - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Portal.png", - "Tooltip": null, - "ParentTabId": 0, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [{ - "Name": "Home", - "TabId": "20", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": -1, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Child 1", - "TabId": "201", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": 20, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Inner Child 1", - "TabId": "20A", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '201', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - } - ] - } - ] - }, { - "Name": "Activity Feed", - "TabId": "21", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": -1, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Child 2", - "TabId": "21A", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": 21, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Inner Child 2", - "TabId": "21AB", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": '21A', - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - } - ] - } - ] - }, { - "Name": "Search Results", - "TabId": "22", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": -1, - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - }, { - "Name": "404 Error Page", - "TabId": "23", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": -1, - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - }] - } diff --git a/TreeControlInteractor/src/mocks/_post.export.js b/TreeControlInteractor/src/mocks/_post.export.js deleted file mode 100644 index 9f6d6a7b..00000000 --- a/TreeControlInteractor/src/mocks/_post.export.js +++ /dev/null @@ -1,53 +0,0 @@ -{ - "PortalId": 0, - "ExportName": "tet33", - "ExportDescription": "", - "IncludeUsers": true, - "IncludeVocabularies": true, - "IncludeTemplates": true, - "IncludeProperfileProperties": true, - "IncludeRoles": true, - "IncludePermissions": true, - "IncludeDeletions": false, - "IncludeContent": true, - "IncludeFiles": true, - "ExportMode": "Differential", - "ItemsToExport": [], - "pages": [{ - "TabId": "22", - "ParentTabId": -1, - "CheckedState": 2 - }, { - "TabId": "33", - "ParentTabId": 22, - "CheckedState": 0 - }, { - "TabId": "32", - "ParentTabId": 22, - "CheckedState": 0 - }, { - "TabId": "-1", - "ParentTabId": -1, - "CheckedState": 2 - }, { - "TabId": "26", - "ParentTabId": -1, - "CheckedState": 0 - }, { - "TabId": "25", - "ParentTabId": -1, - "CheckedState": 0 - }, { - "TabId": "24", - "ParentTabId": -1, - "CheckedState": 0 - }, { - "TabId": "23", - "ParentTabId": -1, - "CheckedState": 0 - }, { - "TabId": "20", - "ParentTabId": -1, - "CheckedState": 0 - }] -} \ No newline at end of file diff --git a/TreeControlInteractor/src/mocks/_sub-set-portal-tabs.js b/TreeControlInteractor/src/mocks/_sub-set-portal-tabs.js deleted file mode 100644 index da34b4db..00000000 --- a/TreeControlInteractor/src/mocks/_sub-set-portal-tabs.js +++ /dev/null @@ -1,76 +0,0 @@ -module.exports = { - "Name": "Home", - "TabId": "20", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Home.png", - "Tooltip": "Homepage of the site", - "ParentTabId": 0, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Child", - "TabId": "211", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": 20, - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Inner Child", - "TabId": "21111", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": "211", - "HasChildren": true, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [ - { - "Name": "Inner Inner Inner Child", - "TabId": "001", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": "21111", - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs":[] - } - ] - }, - { - "Name": "Inner Inner Child 2", - "TabId": "222", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": 211, - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - }, - ] - }, - { - "Name": "Our Products", - "TabId": "213", - "ImageUrl": "/DesktopModules/Admin/Tabs/images/Icon_Everyone.png", - "Tooltip": "Page is visible to everyone", - "ParentTabId": 20, - "HasChildren": false, - "IsOpen": false, - "Selectable": true, - "CheckedState": 0, - "ChildTabs": [] - } - - ] - } diff --git a/TreeControlInteractor/src/mocks/index.js b/TreeControlInteractor/src/mocks/index.js deleted file mode 100644 index 32463912..00000000 --- a/TreeControlInteractor/src/mocks/index.js +++ /dev/null @@ -1 +0,0 @@ -export {PortalTabs} from './_portal-tabs' diff --git a/TreeControlInteractor/webpack.config.js b/TreeControlInteractor/webpack.config.js index 236bc55b..49b3c525 100644 --- a/TreeControlInteractor/webpack.config.js +++ b/TreeControlInteractor/webpack.config.js @@ -1,5 +1,5 @@ module.exports = { - entry: "./src/_treeControlInteractor.jsx", + entry: "./src/TreeControlInteractor.jsx", output: { path: "./lib/", filename: "TreeControlInteractor.js",