UNPKG

graphdb-workbench

Version:
2 lines 11.3 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[102],{125:function(e,n){(function(){angular.module("angularBootstrapNavTree",[]).directive("ngTree",["$timeout",function(e){return{restrict:"E",template:('<ul class="nav nav-list nav-pills nav-stacked ng-tree"><li ng-repeat="row in tree_rows | filter:{visible:true} track by row.branch.uid" ng-animate="\'ng-tree-animate\'" data-element-id="{{row.branch.id}}" data-element-label="{{row.branch.label}}" ng-class="\'level-\' + {{ row.level }} + (row.branch.selected ? \' active\':\'\')" class="ng-tree-row"><a ng-click="checkBoxClicked(row)"><div style=\'float:left; padding-top:3px;\'><i ng-if="row.branch.children.length>0" ng-class="row.tree_icon" ng-click="expandClose(row.branch); $event.stopPropagation()" class="indented tree-icon" style="vertical-align: 2px;"></i><i ng-if="row.branch.children.length<1" class="indented tree-icon ng-scope icon-plus glyphicon glyphicon-plus fa fa-plus" style="color:transparent;"></i><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'1\' && row.level > 2 " class=\'indented bootstrap-checkbox\' data-checkbox-id="{{row.branch.id}}" ng-click="checkBoxClicked(row); $event.stopPropagation()"></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'2\' && row.level > 2 " class=\'indented bootstrap-checkbox selectedNode\' data-checkbox-id="{{row.branch.id}}" ng-click="checkBoxClicked(row); $event.stopPropagation()"><i class="icon-stop"></i></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'3\' && row.level > 2 " class=\'indented bootstrap-checkbox selectedNode\' data-checkbox-id="{{row.branch.id}}" ng-click="checkBoxClicked(row); $event.stopPropagation()"><i class="icon-ok"></i></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'1\' && row.level < 3 " class=\'indented bootstrap-checkbox disabledCheckBox\' data-checkbox-id="{{row.branch.id}}"></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'2\' && row.level < 3 " class=\'indented bootstrap-checkbox disabledCheckBox selectedNode\' data-checkbox-id="{{row.branch.id}}"><i class="icon-stop"></i></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'3\' && row.level < 3 " class=\'indented bootstrap-checkbox disabledCheckBox selectedNode\' data-checkbox-id="{{row.branch.id}}"><i class="icon-ok"></i></span></div><div ng-if="row.branch.checkboxStatus ==\'1\'" ng-class="\'div-level-\' + {{ row.level }}" class="indented tree-label">{{ row.branch.id }} - {{ row.label }} </div><div ng-if="row.branch.checkboxStatus !=\'1\'" ng-class="\'div-level-\' + {{ row.level }}" class="indented tree-label selectedNode">{{ row.branch.id }} - {{ row.label }} </div></a></li></ul>','<ul class="nav nav-list nav-pills nav-stacked ng-tree"><li ng-repeat="row in tree_rows | filter:{visible:true} track by row.branch.uid" ng-animate="\'ng-tree-animate\'" data-element-id="{{row.branch.id}}" data-element-label="{{row.branch.label}}" ng-class="\'level-\' + {{ row.level }} + (row.branch.selected ? \' active\':\'\')" class="ng-tree-row"><a ng-click="checkBoxClicked(row)"><div style=\'float:left; padding-top:3px;\'><i ng-if="row.branch.children.length>0" ng-class="row.tree_icon" ng-click="expandClose(row.branch); $event.stopPropagation()" class="indented tree-icon" style="vertical-align: 2px;"></i><i ng-if="row.branch.children.length<1" class="indented tree-icon ng-scope icon-plus glyphicon glyphicon-plus fa fa-plus" style="color:transparent;"></i><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'1\' && row.level > 2 " class=\'indented bootstrap-checkbox\' data-checkbox-id="{{row.branch.id}}" ng-click="checkBoxClicked(row); $event.stopPropagation()"></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'2\' && row.level > 2 " class=\'indented bootstrap-checkbox selectedNode\' data-checkbox-id="{{row.branch.id}}" ng-click="checkBoxClicked(row); $event.stopPropagation()"><i class="icon-stop"></i></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'3\' && row.level > 2 " class=\'indented bootstrap-checkbox selectedNode\' data-checkbox-id="{{row.branch.id}}" ng-click="checkBoxClicked(row); $event.stopPropagation()"><i class="icon-ok"></i></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'1\' && row.level < 3 " class=\'indented bootstrap-checkbox disabledCheckBox\' data-checkbox-id="{{row.branch.id}}"></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'2\' && row.level < 3 " class=\'indented bootstrap-checkbox disabledCheckBox selectedNode\' data-checkbox-id="{{row.branch.id}}"><i class="icon-stop"></i></span><span ng-if="row.branch.showCheckboxes==\'true\' && row.branch.checkboxStatus==\'3\' && row.level < 3 " class=\'indented bootstrap-checkbox disabledCheckBox selectedNode\' data-checkbox-id="{{row.branch.id}}"><i class="icon-ok"></i></span></div><div ng-if="row.branch.checkboxStatus ==\'1\'" ng-class="\'div-level-\' + {{ row.level }}" class="indented tree-label">{{ row.branch.id }} - {{ row.label }} </div><div ng-if="row.branch.checkboxStatus !=\'1\'" ng-class="\'div-level-\' + {{ row.level }}" class="indented tree-label selectedNode">{{ row.branch.id }} - {{ row.label }} </div></a></li></ul>'),replace:!0,scope:{treeData:"=",onSelect:"&",initialSelection:"@",treeControl:"="},controller:function(e,n,t){e.expandClose=function(n){e.$parent.fetchChildData(n),n.expanded=!n.expanded},e.checkBoxClicked=function(n){"true"==n.branch.showCheckboxes&&n.level>2&&(e.$parent.fetchChildDataAll(n.branch),e.$parent.checkBoxClicked(n.branch))}},link:function(n,t,r){var c,l,a,o,i,s,d,h,u,b;if(function(e){console.log("ERROR:"+e)},null==r.iconExpand&&(r.iconExpand="icon-plus glyphicon glyphicon-plus fa fa-plus"),null==r.iconCollapse&&(r.iconCollapse="icon-minus glyphicon glyphicon-minus fa fa-minus"),null==r.iconLeaf&&(r.iconLeaf="icon-file glyphicon glyphicon-file fa fa-file"),null==r.expandLevel&&(r.expandLevel="3"),l=parseInt(r.expandLevel,1),n.treeData){if(null==n.treeData.length){if(null==treeData.label)return void alert("treeData should be an array of root branches");n.treeData=[treeData]}return o=function(e){var t,r,c,l,a,o;for(t=function(n,r){var c,l,a,o,i;if(e(n,r),null!=n.children){for(i=[],l=0,a=(o=n.children).length;l<a;l++)c=o[l],i.push(t(c,r+1));return i}},o=[],c=0,l=(a=n.treeData).length;c<l;c++)r=a[c],o.push(t(r,1));return o},u=null,h=function(t){if(!t)return null!=u&&(u.selected=!1),void(u=null);if(t!==u){if(null!=u&&(u.selected=!1),t.selected=!0,u=t,c(t),null!=t.onSelect)return e((function(){return t.onSelect(t)}));if(null!=n.onSelect)return e((function(){return n.onSelect({branch:t})}))}},n.user_clicks_branch=function(e){if(e!==u)return h(e)},i=function(e){var n;return n=void 0,e.parent_uid&&o((function(t){if(t.uid===e.parent_uid)return n=t})),n},a=function(e,n){var t;if(null!=(t=i(e)))return n(t),a(t,n)},c=function(e){return a(e,(function(e){return e.expanded=!0}))},n.tree_rows=[],d=function(){var e,t,c,l,a,i;for(o((function(e,n){if(!e.uid)return e.uid=""+Math.random()})),console.log("UIDs are set."),o((function(e){var n,t,r,c,l;if(angular.isArray(e.children)){for(l=[],t=0,r=(c=e.children).length;t<r;t++)n=c[t],l.push(n.parent_uid=e.uid);return l}})),n.tree_rows=[],o((function(e){var n,t;return e.children?e.children.length>0?(t=function(e){return"string"==typeof e?{label:e,children:[]}:e},e.children=function(){var r,c,l,a;for(a=[],r=0,c=(l=e.children).length;r<c;r++)n=l[r],a.push(t(n));return a}()):void 0:e.children=[]})),e=function(t,c,l){var a,o,i,s,d,h,u;if(null==c.expanded&&(c.expanded=!1),null!=c.checkboxStatus&&null!=c.checkboxStatus||(c.checkboxStatus=1),null!=c.fetched&&null!=c.fetched||(c.fetched=0),c.showCheckboxes=r.showCheckboxes,i=c.children&&0!==c.children.length?c.expanded?r.iconCollapse:r.iconExpand:r.iconLeaf,n.tree_rows.push({level:t,branch:c,label:c.label,tree_icon:i,visible:l}),null!=c.children){for(u=[],s=0,d=(h=c.children).length;s<d;s++)a=h[s],o=l&&c.expanded,u.push(e(t+1,a,o));return u}},i=[],c=0,l=(a=n.treeData).length;c<l;c++)t=a[c],i.push(e(1,t,!0));return i},n.$watch("treeData",d,!0),null!=r.initialSelection&&o((function(n){if(n.label===r.initialSelection)return e((function(){return h(n)}))})),s=n.treeData.length,console.log("num root branches = "+s),o((function(e,n){return e.level=n,e.expanded=e.level<l})),null!=n.treeControl&&angular.isObject(n.treeControl)?((b=n.treeControl).expand_all=function(){return o((function(e,n){return e.expanded=!0}))},b.collapse_all=function(){return o((function(e,n){return e.expanded=!1}))},b.get_first_branch=function(){if((s=n.treeData.length)>0)return n.treeData[0]},b.select_first_branch=function(){var e;return e=b.get_first_branch(),b.select_branch(e)},b.get_selected_branch=function(){return u},b.get_parent_branch=function(e){return i(e)},b.select_branch=function(e){return h(e),e},b.get_children=function(e){return e.children},b.select_parent_branch=function(e){var n;if(null==e&&(e=b.get_selected_branch()),null!=e&&null!=(n=b.get_parent_branch(e)))return b.select_branch(n),n},b.add_branch=function(e,t){return null!=e?(e.children.push(t),e.expanded=!0):n.treeData.push(t),t},b.add_root_branch=function(e){return b.add_branch(null,e),e},b.expand_branch=function(e){if(null==e&&(e=b.get_selected_branch()),null!=e)return e.expanded=!0,e},b.collapse_branch=function(e){if(null==e&&(e=u),null!=e)return e.expanded=!1,e},b.get_siblings=function(e){var t;if(null==e&&(e=u),null!=e)return(t=b.get_parent_branch(e))?t.children:n.treeData},b.get_next_sibling=function(e){var n,t;if(null==e&&(e=u),null!=e&&(t=b.get_siblings(e),s=t.length,(n=t.indexOf(e))<s))return t[n+1]},b.get_prev_sibling=function(e){var n,t;if(null==e&&(e=u),t=b.get_siblings(e),s=t.length,(n=t.indexOf(e))>0)return t[n-1]},b.select_next_sibling=function(e){var n;if(null==e&&(e=u),null!=e&&null!=(n=b.get_next_sibling(e)))return b.select_branch(n)},b.select_prev_sibling=function(e){var n;if(null==e&&(e=u),null!=e&&null!=(n=b.get_prev_sibling(e)))return b.select_branch(n)},b.get_first_child=function(e){var n;if(null==e&&(e=u),null!=e&&(null!=(n=e.children)?n.length:void 0)>0)return e.children[0]},b.get_closest_ancestor_next_sibling=function(e){var n,t;return null!=(n=b.get_next_sibling(e))?n:(t=b.get_parent_branch(e),b.get_closest_ancestor_next_sibling(t))},b.get_next_branch=function(e){var n;if(null==e&&(e=u),null!=e)return null!=(n=b.get_first_child(e))?n:n=b.get_closest_ancestor_next_sibling(e)},b.select_next_branch=function(e){var n;if(null==e&&(e=u),null!=e&&null!=(n=b.get_next_branch(e)))return b.select_branch(n),n},b.last_descendant=function(e){var n;return 0===(s=e.children.length)?e:(n=e.children[s-1],b.last_descendant(n))},b.get_prev_branch=function(e){var n;if(null==e&&(e=u),null!=e)return null!=(n=b.get_prev_sibling(e))?b.last_descendant(n):b.get_parent_branch(e)},b.select_prev_branch=function(e){var n;if(null==e&&(e=u),null!=e&&null!=(n=b.get_prev_branch(e)))return b.select_branch(n),n}):void 0}alert("no treeData defined for the tree!")}}}])}).call(this)}}]); //# sourceMappingURL=102.08aa6ece37223e1ad62e.bundle.js.map