diff --git a/dist/angular-patternfly.js b/dist/angular-patternfly.js index 1676b9ee7..1c92b6d8f 100644 --- a/dist/angular-patternfly.js +++ b/dist/angular-patternfly.js @@ -4929,7 +4929,7 @@ angular.module('patternfly.views').directive('pfDataToolbar', function () { $templateCache.put('charts/utilization-bar/utilization-bar-chart.html', "
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
" + " 'progress-bar-success': isOk, 'progress-bar-danger': isError, 'progress-bar-warning': isWarn}\" ng-style=\"{width:chartData.percentageUsed + '%'}\" tooltip=\"{{chartData.percentageUsed}}% Used\">{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
" ); diff --git a/dist/angular-patternfly.min.js b/dist/angular-patternfly.min.js index 4e691c4bd..1767affad 100644 --- a/dist/angular-patternfly.min.js +++ b/dist/angular-patternfly.min.js @@ -1,2 +1,2 @@ function mergeDeep(dst){"use strict";return angular.forEach(arguments,function(obj){obj!==dst&&angular.forEach(obj,function(value,key){dst[key]&&dst[key].constructor&&dst[key].constructor===Object?mergeDeep(dst[key],value):dst[key]=value})}),dst}angular.module("patternfly.card",[]),angular.module("patternfly.charts",["patternfly.utils","ui.bootstrap"]),angular.module("patternfly.filters",["patternfly.select"]),angular.module("patternfly.form",[]),angular.module("patternfly",["patternfly.autofocus","patternfly.card","patternfly.filters","patternfly.form","patternfly.notification","patternfly.select","patternfly.sort","patternfly.utils","patternfly.validation","patternfly.views"]),angular.module("patternfly.sort",[]),angular.module("patternfly.utils",[]),angular.module("patternfly.views",["patternfly.utils","patternfly.filters","patternfly.sort"]),angular.module("patternfly.autofocus",[]).directive("pfFocused",["$timeout",function($timeout){"use strict";return{restrict:"A",link:function(scope,element,attrs){scope.$watch(attrs.pfFocused,function(newValue){$timeout(function(){newValue&&(element[0].focus(),element[0].select&&element[0].select())})})}}}]),angular.module("patternfly.card").directive("pfAggregateStatusCard",function(){"use strict";return{restrict:"A",scope:{status:"=",showTopBorder:"@?",altLayout:"@?",layout:"@?"},templateUrl:"card/aggregate-status/aggregate-status-card.html",link:function(scope){scope.shouldShowTopBorder="true"===scope.showTopBorder,scope.isAltLayout="true"===scope.altLayout||"tall"===scope.layout,scope.isMiniLayout="mini"===scope.layout}}}),angular.module("patternfly.card").directive("pfCard",function(){"use strict";return{restrict:"A",transclude:!0,templateUrl:"card/basic/card.html",scope:{headTitle:"@",subTitle:"@?",showTopBorder:"@?",showTitlesSeparator:"@?",footer:"=?",filter:"=?"},controller:["$scope",function($scope){$scope.filter&&!$scope.currentFilter&&($scope.filter.defaultFilter?$scope.currentFilter=$scope.filter.filters[$scope.filter.defaultFilter]:$scope.currentFilter=$scope.filter.filters[0]),$scope.footerCallBackFn=function(){$scope.footerCallBackResult=$scope.footer.callBackFn()},$scope.filterCallBackFn=function(f){$scope.currentFilter=f,$scope.filter.callBackFn&&($scope.filterCallBackResult=$scope.filter.callBackFn(f))},$scope.showHeader=function(){return $scope.headTitle||$scope.showFilterInHeader()},$scope.showFilterInHeader=function(){return $scope.filter&&$scope.filter.filters&&$scope.filter.position&&"header"===$scope.filter.position}}]}}),function(){"use strict";angular.module("patternfly.charts").constant("c3ChartDefaults",{getDefaultDonut:function(title){return{title:title,label:{show:!1},width:11}},getDefaultDonutSize:function(){return{height:171}},getDefaultDonutColor:function(){return{pattern:["#0088CE","#D1D1D1"]}},getDefaultDonutTooltip:function(){return{show:!1}},getDefaultDonutLegend:function(){return{show:!1}},getDefaultDonutConfig:function(title){return{donut:this.getDefaultDonut(title),size:this.getDefaultDonutSize(),legend:this.getDefaultDonutLegend(),color:this.getDefaultDonutColor(),tooltip:this.getDefaultDonutTooltip()}},getDefaultSparklineArea:function(){return{zerobased:!0}},getDefaultSparklineSize:function(){return{height:60}},getDefaultSparklineAxis:function(){return{x:{show:!1},y:{show:!1}}},getDefaultSparklineColor:function(){return{pattern:["#0088ce","#00659c","#3f9c35","#ec7a08","#cc0000"]}},getDefaultSparklineLegend:function(){return{show:!1}},getDefaultSparklinePoint:function(){return{r:1,focus:{expand:{r:4}}}},getDefaultSparklineTooltip:function(){return{contents:function(d){return''+d[0].value+" "+d[0].name+""}}},getDefaultSparklineConfig:function(){return{area:this.getDefaultSparklineArea(),size:this.getDefaultSparklineSize(),axis:this.getDefaultSparklineAxis(),color:this.getDefaultSparklineColor(),legend:this.getDefaultSparklineLegend(),point:this.getDefaultSparklinePoint(),tooltip:this.getDefaultSparklineTooltip()}}})}(),function(){"use strict";angular.module("patternfly.charts").directive("pfC3Chart",["$timeout",function($timeout){return{restrict:"A",scope:{config:"="},template:'
',replace:!0,link:function(scope,element,attrs){scope.$watch("config",function(){$timeout(function(){var chartData=scope.config;chartData.bindto="#"+attrs.id,c3.generate(chartData)})},!0)}}}])}(),angular.module("patternfly.charts").directive("pfDonutPctChart",["c3ChartDefaults","pfUtils","$timeout",function(c3ChartDefaults,pfUtils,$timeout){"use strict";return{restrict:"A",scope:{config:"=",data:"=",centerLabel:"=?"},replace:!0,templateUrl:"charts/donut/donut-pct-chart.html",controller:["$scope",function($scope){var donutTooltip;$scope.donutChartId="donutChart",$scope.config.chartId&&($scope.donutChartId=$scope.config.chartId+$scope.donutChartId),$scope.updateAvailable=function(){$scope.data.available=$scope.data.total-$scope.data.used},void 0===$scope.data.available&&$scope.updateAvailable(),$scope.getStatusColor=function(used,thresholds){var color="#0088CE";return thresholds&&(color="#3f9c35",used>=thresholds.error?color="#CC0000":used>=thresholds.warning&&(color="#EC7A08")),color},$scope.statusDonutColor=function(scope){var color,percentUsed;return color={pattern:[]},percentUsed=scope.data.used/scope.data.total*100,color.pattern[0]=$scope.getStatusColor(percentUsed,scope.config.thresholds),color.pattern[1]="#D1D1D1",color},donutTooltip=function(scope){return{contents:function(d){var tooltipHtml;return tooltipHtml=scope.config.tooltipFn?''+scope.config.tooltipFn(d)+"":''+Math.round(100*d[0].ratio)+"% "+$scope.config.units+" "+d[0].name+""}}},$scope.getDonutData=function(scope){return{columns:[["Used",scope.data.used],["Available",scope.data.available]],type:"donut",donut:{label:{show:!1}},groups:[["used","available"]],order:null}},$scope.getCenterLabelText=function(){var centerLabelText;return centerLabelText={bigText:$scope.data.used,smText:$scope.config.units+" Used"},$scope.config.centerLabelFn?(centerLabelText.bigText=$scope.config.centerLabelFn(),centerLabelText.smText=""):"none"===$scope.centerLabel?(centerLabelText.bigText="",centerLabelText.smText=""):"available"===$scope.centerLabel?(centerLabelText.bigText=$scope.data.available,centerLabelText.smText=$scope.config.units+" Available"):"percent"===$scope.centerLabel&&(centerLabelText.bigText=Math.round($scope.data.used/$scope.data.total*100)+"%",centerLabelText.smText="of "+$scope.data.total+" "+$scope.config.units),centerLabelText},$scope.updateAll=function(scope){$scope.updateAvailable(),$scope.config.data=$scope.getDonutData($scope),$scope.config.color=$scope.statusDonutColor($scope),$scope.config.tooltip=donutTooltip(scope),$scope.config.data.onclick=$scope.config.onClickFn},$scope.config=pfUtils.merge(c3ChartDefaults.getDefaultDonutConfig(),$scope.config),$scope.updateAll($scope)}],link:function(scope,element){var setupDonutChartTitle=function(){$timeout(function(){var donutChartTitle,centerLabelText;donutChartTitle=element[0].querySelector("text.c3-chart-arcs-title"),donutChartTitle&&(centerLabelText=scope.getCenterLabelText(),centerLabelText.bigText&&!centerLabelText.smText?donutChartTitle.innerHTML=centerLabelText.bigText:donutChartTitle.innerHTML=''+centerLabelText.bigText+''+centerLabelText.smText+"")},300)};scope.$watch("config",function(){scope.updateAll(scope),setupDonutChartTitle()},!0),scope.$watch("data",function(){scope.updateAll(scope),setupDonutChartTitle()},!0),scope.$watch("centerLabel",function(){setupDonutChartTitle()})}}}]),angular.module("patternfly.charts").directive("pfSparklineChart",["c3ChartDefaults","pfUtils",function(c3ChartDefaults,pfUtils){"use strict";return{restrict:"A",scope:{config:"=",chartData:"=",chartHeight:"=?",showXAxis:"=?",showYAxis:"=?"},replace:!0,templateUrl:"charts/sparkline/sparkline-chart.html",controller:["$scope",function($scope){$scope.sparklineChartId="sparklineChart",$scope.config.chartId&&($scope.sparklineChartId=$scope.config.chartId+$scope.sparklineChartId),$scope.getSparklineData=function(chartData){return{x:chartData.xData[0],columns:[chartData.xData,chartData.yData],type:"area"}},$scope.getTooltipTableHTML=function(tipRows){return'
'+tipRows+"
"},$scope.sparklineTooltip=function(){return{contents:function(d){var tipRows,percentUsed;if($scope.config.tooltipFn)tipRows=$scope.config.tooltipFn(d);else switch($scope.config.tooltipType){case"usagePerDay":percentUsed=Math.round(d[0].value/$scope.chartData.total*100),tipRows=' '+d[0].x.toLocaleDateString()+' '+percentUsed+'%: '+d[0].value+" "+$scope.config.units+" "+d[0].name+"";break;case"valuePerDay":tipRows=' '+d[0].x.toLocaleDateString()+' '+d[0].value+" "+d[0].name+"";break;case"percentage":percentUsed=Math.round(d[0].value/$scope.chartData.total*100),tipRows=' '+percentUsed+"%";break;default:tipRows=c3ChartDefaults.getDefaultSparklineTooltip().contents(d)}return $scope.getTooltipTableHTML(tipRows)},position:function(data,width,height,element){var center,top,chartBox,graphOffsetX,x;try{return center=parseInt(element.getAttribute("x")),top=parseInt(element.getAttribute("y")),chartBox=document.querySelector("#"+$scope.sparklineChartId).getBoundingClientRect(),graphOffsetX=document.querySelector("#"+$scope.sparklineChartId+" g.c3-axis-y").getBoundingClientRect().right,x=Math.max(0,center+graphOffsetX-chartBox.left-Math.floor(width/2)),{top:top-height,left:Math.min(x,chartBox.width-width)}}catch(e){}}}},void 0===$scope.showXAxis&&($scope.showXAxis=void 0!==$scope.config.showAxis&&$scope.config.showAxis),void 0===$scope.showYAxis&&($scope.showYAxis=void 0!==$scope.config.showAxis&&$scope.config.showAxis),$scope.defaultConfig=c3ChartDefaults.getDefaultSparklineConfig(),$scope.defaultConfig.axis={x:{show:$scope.showXAxis===!0,type:"timeseries",tick:{format:function(){return""}}},y:{show:$scope.showYAxis===!0,tick:{format:function(){return""}}}},$scope.defaultConfig.tooltip=$scope.sparklineTooltip(),$scope.chartHeight&&($scope.defaultConfig.size.height=$scope.chartHeight),$scope.defaultConfig.units="",$scope.config=pfUtils.merge($scope.defaultConfig,$scope.config),$scope.config.data=$scope.getSparklineData($scope.chartData)}],link:function(scope){scope.$watch("config",function(){scope.config=pfUtils.merge(scope.defaultConfig,scope.config)},!0),scope.$watch("chartHeight",function(){scope.config.size.height=scope.chartHeight}),scope.$watch("showXAxis",function(){scope.config.axis.x.show=scope.showXAxis===!0}),scope.$watch("showYAxis",function(){scope.config.axis.y.show=scope.showYAxis===!0}),scope.$watch("chartData",function(){scope.config.data=scope.getSparklineData(scope.chartData)},!0)}}}]),angular.module("patternfly.charts").directive("pfTrendsChart",function(){"use strict";return{restrict:"A",scope:{config:"=",chartData:"=",chartHeight:"=?",showXAxis:"=?",showYAxis:"=?"},replace:!0,templateUrl:"charts/trends/trends-chart.html",controller:["$scope",function($scope){var SMALL=30,LARGE=60;$scope.getPercentageValue=function(){return Math.round($scope.getLatestValue()/$scope.chartData.total*100)},$scope.getLatestValue=function(){return $scope.chartData.yData[$scope.chartData.yData.length-1]},$scope.getChartHeight=function(){var retValue=LARGE;return $scope.chartHeight?retValue=$scope.chartHeight:"small"===$scope.config.layout&&(retValue=SMALL),retValue}}],link:function(scope){scope.$watch("config",function(){scope.showLargeCardLayout=!scope.config.layout||"large"===scope.config.layout,scope.showSmallCardLayout="small"===scope.config.layout,scope.showActualValue=!scope.config.valueType||"actual"===scope.config.valueType,scope.showPercentageValue="percentage"===scope.config.valueType},!0)}}}),angular.module("patternfly.charts").directive("pfUtilizationBarChart",["$timeout",function($timeout){"use strict";return{restrict:"A",scope:{chartData:"=",chartTitle:"=",units:"=",thresholdError:"=?",thresholdWarning:"=?",usedLabelFormat:"@?",layout:"=?"},templateUrl:"charts/utilization-bar/utilization-bar-chart.html",link:function(scope){scope.$watch("chartData",function(newVal,oldVal){"undefined"!=typeof newVal&&(scope.chartData.percentageUsed=Math.round(100*(scope.chartData.used/scope.chartData.total)),(scope.thresholdError||scope.thresholdWarning)&&(scope.isError=scope.chartData.percentageUsed>scope.thresholdError,scope.isWarn=scope.chartData.percentageUsed>scope.thresholdWarning&&scope.chartData.percentageUsed0&&(void 0===$scope.config.currentField&&($scope.config.currentField=$scope.config.fields[0],updated=!0),void 0===$scope.config.isAscending&&($scope.config.isAscending=!0,updated=!0)),updated===!0&&$scope.config.onSortChange&&$scope.config.onSortChange($scope.config.currentField,$scope.config.isAscending)},$scope.selectField=function(field){$scope.config.currentField=field,$scope.config.onSortChange&&$scope.config.onSortChange($scope.config.currentField,$scope.config.isAscending)},$scope.changeDirection=function(){$scope.config.isAscending=!$scope.config.isAscending,$scope.config.onSortChange&&$scope.config.onSortChange($scope.config.currentField,$scope.config.currentDirection)},$scope.getSortIconClass=function(){var iconClass;return iconClass="numeric"===$scope.config.currentField.sortType?$scope.config.isAscending?"fa fa-sort-numeric-asc":"fa fa-sort-numeric-desc":$scope.config.isAscending?"fa fa-sort-alpha-asc":"fa fa-sort-alpha-desc"},$scope.setupConfig()}],link:function(scope,element,attrs){scope.$watch("config",function(){scope.setupConfig()},!0)}}}),angular.module("patternfly.utils").directive("pfTransclude",function(){"use strict";return{restrict:"A",link:function($scope,$element,$attrs,controller,$transclude){var iChildScope,iScopeType;if(!$transclude)throw new Error("pfTransclude - Illegal use of pfTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}");switch(iScopeType=$attrs.pfTransclude||"sibling"){case"sibling":$transclude(function(clone){$element.empty(),$element.append(clone)});break;case"parent":$transclude($scope,function(clone){$element.empty(),$element.append(clone)});break;case"child":iChildScope=$scope.$new(),$transclude(iChildScope,function(clone){$element.empty(),$element.append(clone),$element.on("$destroy",function(){iChildScope.$destroy()})})}}}}),function(){"use strict";angular.module("patternfly.utils").constant("pfUtils",{merge:function(source1,source2){var retValue;return retValue="function"==typeof angular.merge?this.angularMerge(source1,source2):"function"==typeof _.merge?this._merge(source1,source2):"function"==typeof $.extend?this.$extend(source1,source2):this.mergeDeep(source1,source2)},angularMerge:function(source1,source2){return angular.merge({},source1,source2)},_merge:function(source1,source2){return _.merge({},source1,source2)},$extend:function(source1,source2){return $.extend(!0,angular.copy(source1),source2)},mergeDeep:function(source1,source2){return mergeDeep({},angular.copy(source1),angular.copy(source2))}})}(),angular.module("patternfly.validation",[]).directive("pfValidation",["$timeout",function($timeout){"use strict";return{restrict:"A",require:"ngModel",scope:{pfValidation:"&",pfValidationDisabled:"="},link:function(scope,element,attrs,ctrl){function validate(){var valid,val=scope.inputCtrl.$modelValue,valFunc=scope.pfValidation({input:val});attrs.pfValidation||(valFunc=!0),valid=!val||valFunc||""===val,toggleErrorClass(scope.valEnabled&&!valid?!0:!1)}function toggleErrorClass(add){var messageElement=element.next(),parentElement=element.parent(),hasErrorM=parentElement.hasClass("has-error"),wasHidden=messageElement.hasClass("ng-hide");scope.inputCtrl.$setValidity("pf-validation",!add),add&&(hasErrorM||parentElement.addClass("has-error"),wasHidden&&messageElement.removeClass("ng-hide")),add||(hasErrorM&&parentElement.removeClass("has-error"),wasHidden||messageElement.addClass("ng-hide"))}scope.inputCtrl=ctrl,scope.valEnabled=!attrs.pfValidationDisabled,scope.$watch("pfValidationDisabled",function(newVal){scope.valEnabled=!newVal,newVal?(scope.inputCtrl.$setValidity("pfValidation",!0),toggleErrorClass(!1)):validate()}),attrs.pfValidation?$timeout(function(){validate()},0):!scope.inputCtrl.$valid&&scope.inputCtrl.$dirty&&toggleErrorClass(!0),scope.$watch("inputCtrl.$valid",function(isValid){toggleErrorClass(isValid?!1:!0)}),scope.$watch("inputCtrl.$modelValue",function(){validate()})}}}]),angular.module("patternfly.views").directive("pfDataList",["$timeout","$window","pfUtils",function($timeout,$window,pfUtils){"use strict";return{restrict:"A",scope:{config:"=?",items:"=",actions:"=?",updateActionForItemFn:"=?"},transclude:!0,templateUrl:"views/datalist/data-list.html",controller:["$scope","$element",function($scope,$element){var setDropMenuLocation=function(parentDiv){var dropButton=parentDiv.querySelector(".dropdown-toggle"),dropMenu=parentDiv.querySelector(".dropdown-menu"),buttonRect=dropButton.getBoundingClientRect(),menuRect=dropMenu.getBoundingClientRect(),top=buttonRect.top+buttonRect.height,left=buttonRect.left+buttonRect.width-menuRect.width,docHeight=$window.innerHeight;top+menuRect.height>docHeight&&(top=docHeight-menuRect.height),dropMenu.style.top=top+"px",dropMenu.style.left=left+"px"},hideOnScroll=function(){$scope.prevMenuItem.showMenu=!1,angular.element(angular.element($element).find(".data-list-pf")[0]).unbind("scroll",hideOnScroll),angular.element($window).unbind("scroll",hideOnScroll),$scope.$apply()},showActionMenu=function(item,event){item.showMenu=!0,$scope.prevMenuItem=item,$timeout(function(){var nextElement,parentDiv=void 0;for(nextElement=event.toElement;nextElement&&!parentDiv;)0===nextElement.className.indexOf("list-menu")&&(parentDiv=nextElement,setDropMenuLocation(parentDiv)),nextElement=nextElement.parentElement;angular.element(angular.element($element).find(".data-list-pf")[0]).bind("scroll",hideOnScroll),angular.element($window).bind("scroll",hideOnScroll)})};if($scope.defaultConfig={selectItems:!1,multiSelect:!1,dblClick:!1,selectionMatchProp:"uuid",selectedItems:[],checkDisabled:!1,showSelectBox:!0,rowHeight:36,onSelect:null,onSelectionChange:null,onCheckBoxChange:null,onClick:null,onDblClick:null},$scope.config=pfUtils.merge($scope.defaultConfig,$scope.config),$scope.config.selectItems&&$scope.config.showSelectBox)throw new Error("pfDataList - Illegal use of pfDataList directive! Cannot allow both select box and click selection in the same data list.");$scope.handleAction=function(action,item){action&&action.actionFn&&action.isDisabled!==!0&&action.actionFn(action,item)},$scope.updateActions=function(item){$scope.actionItem=item,"function"==typeof $scope.updateActionForItemFn&&$scope.actions.forEach(function(action){$scope.updateActionForItemFn(action,item)})},$scope.setupActions=function(item,event){$scope.prevMenuItem&&($scope.prevMenuItem.showMenu=!1,$scope.prevMenuItem=void 0),$scope.checkDisabled(item)||($scope.updateActions(item),showActionMenu(item,event))}}],link:function(scope,element,attrs){attrs.$observe("config",function(){scope.config=pfUtils.merge(scope.defaultConfig,scope.config),scope.config.selectItems||(scope.config.selectedItems=[]),!scope.config.multiSelect&&scope.config.selectedItems&&scope.config.selectedItems.length>0&&(scope.config.selectedItems=[scope.config.selectedItems[0]])}),scope.itemClick=function(e,item){var alreadySelected,selectionChanged=!1,continueEvent=!0;return scope.checkDisabled(item)?continueEvent:(scope.config&&scope.config.selectItems&&item&&(scope.config.multiSelect&&!scope.config.dblClick?(alreadySelected=_.find(scope.config.selectedItems,function(itemObj){return itemObj===item}),alreadySelected?scope.config.selectedItems=_.without(scope.config.selectedItems,item):(scope.config.selectedItems.push(item),selectionChanged=!0)):scope.config.selectedItems[0]===item?(scope.config.dblClick||(scope.config.selectedItems=[],selectionChanged=!0),continueEvent=!1):(scope.config.selectedItems=[item],selectionChanged=!0),selectionChanged&&scope.config.onSelect&&scope.config.onSelect(item,e),selectionChanged&&scope.config.onSelectionChange&&scope.config.onSelectionChange(scope.config.selectedItems,e)),scope.config.onClick&&scope.config.onClick(item,e),continueEvent)},scope.dblClick=function(e,item){scope.config.onDblClick&&scope.config.onDblClick(item,e)},scope.checkBoxChange=function(item){scope.config.onCheckBoxChange&&scope.config.onCheckBoxChange(item)},scope.isSelected=function(item){var matchProp=scope.config.selectionMatchProp,selected=!1;return scope.config.showSelectBox?selected=item.selected:scope.config.selectItems&&scope.config.selectedItems.length&&(selected=_.find(scope.config.selectedItems,function(itemObj){return itemObj[matchProp]===item[matchProp]})),selected},scope.checkDisabled=function(item){return scope.config.checkDisabled&&scope.config.checkDisabled(item)}}}}]),angular.module("patternfly.views").directive("pfDataTiles",["pfUtils",function(pfUtils){"use strict";return{restrict:"A",scope:{config:"=?",items:"=",eventId:"@id"},transclude:!0,templateUrl:"views/datatiles/data-tiles.html",controller:["$scope",function($scope){if($scope.defaultConfig={selectItems:!1,multiSelect:!1,dblClick:!1,selectionMatchProp:"uuid",selectedItems:[],checkDisabled:!1,showSelectBox:!0,onSelect:null,onSelectionChange:null,onCheckBoxChange:null,onClick:null,onDblClick:null},$scope.config=pfUtils.merge($scope.defaultConfig,$scope.config),$scope.config.selectItems&&$scope.config.showSelectBox)throw new Error("pfDataTiles - Illegal use of pfDataTiles directive! Cannot allow both select box and click selection in the same data tiles.")}],link:function(scope,element,attrs){attrs.$observe("config",function(){scope.config=pfUtils.merge(scope.defaultConfig,scope.config),scope.config.selectItems||(scope.config.selectedItems=[]),!scope.config.multiSelect&&scope.config.selectedItems&&scope.config.selectedItems.length>0&&(scope.config.selectedItems=[scope.config.selectedItems[0]])}),scope.itemClick=function(e,item){ -var alreadySelected,selectionChanged=!1,continueEvent=!0;return scope.checkDisabled(item)?continueEvent:(scope.config&&scope.config.selectItems&&item&&(scope.config.multiSelect&&!scope.config.dblClick?(alreadySelected=_.find(scope.config.selectedItems,function(itemObj){return itemObj===item}),alreadySelected?scope.config.selectedItems=_.without(scope.config.selectedItems,item):(scope.config.selectedItems.push(item),selectionChanged=!0)):scope.config.selectedItems[0]===item?(scope.config.dblClick||(scope.config.selectedItems=[],selectionChanged=!0),continueEvent=!1):(scope.config.selectedItems=[item],selectionChanged=!0),selectionChanged&&scope.config.onSelect&&scope.config.onSelect(item,e),selectionChanged&&scope.config.onSelectionChange&&scope.config.onSelectionChange(scope.config.selectedItems,e)),scope.config.onClick&&scope.config.onClick(item,e),continueEvent)},scope.dblClick=function(e,item){scope.config.onDblClick&&scope.config.onDblClick(item,e)},scope.checkBoxChange=function(item){scope.config.onCheckBoxChange&&scope.config.onCheckBoxChange(item)},scope.isSelected=function(item){var matchProp=scope.config.selectionMatchProp,selected=!1;if(scope.config.showSelectBox)selected=item.selected;else if(scope.config.selectedItems.length)return _.find(scope.config.selectedItems,function(itemObj){return itemObj[matchProp]===item[matchProp]});return selected},scope.checkDisabled=function(item){return scope.config.checkDisabled&&scope.config.checkDisabled(item)}}}}]),angular.module("patternfly.views").directive("pfDataToolbar",function(){"use strict";return{restrict:"A",scope:{config:"="},replace:!0,transclude:!1,templateUrl:"views/toolbar/data-toolbar.html",controller:["$scope",function($scope){$scope.viewSelected=function(viewId){$scope.config.viewsConfig.currentView=viewId,$scope.config.viewsConfig.onViewSelect&&!$scope.checkViewDisabled(viewId)&&$scope.config.viewsConfig.onViewSelect(viewId)},$scope.isViewSelected=function(viewId){return $scope.config.viewsConfig&&$scope.config.viewsConfig.currentView===viewId},$scope.checkViewDisabled=function(view){return $scope.config.viewsConfig.checkViewDisabled&&$scope.config.viewsConfig.checkViewDisabled(view)},$scope.filterExists=function(filter){var foundFilter=_.findWhere($scope.config.filterConfig.appliedFilters,{title:filter.title,value:filter.value});return void 0!==foundFilter},$scope.addFilter=function(field,value){var newFilter={id:field.id,title:field.title,value:value};$scope.filterExists(newFilter)||($scope.config.filterConfig.appliedFilters.push(newFilter),$scope.config.filterConfig.onFilterChange&&$scope.config.filterConfig.onFilterChange($scope.config.filterConfig.appliedFilters))},$scope.handleAction=function(action){action&&action.actionFn&&action.isDisabled!==!0&&action.actionFn(action)}}],link:function(scope,element,attrs){scope.$watch("config",function(){scope.config&&scope.config.viewsConfig&&scope.config.viewsConfig.views&&(scope.config.viewsConfig.viewsList=angular.copy(scope.config.viewsConfig.views),scope.config.viewsConfig.currentView||(scope.config.viewsConfig.currentView=scope.config.viewsConfig.viewsList[0]))},!0)}}}),function(){"use strict";angular.module("patternfly.views").constant("pfViewUtils",{getDashboardView:function(title){return{id:"dashboardView",title:title||"Dashboard View",iconClass:"fa fa-dashboard"}},getTilesView:function(title){return{id:"tilesView",title:title||"Tiles View",iconClass:"fa fa-th"}},getListView:function(title){return{id:"listView",title:title||"List View",iconClass:"fa fa-th-list"}},getTableView:function(title){return{id:"tableView",title:title||"Table View",iconClass:"fa fa-table"}},getTopologyView:function(title){return{id:"topologyView",title:title||"Topology View",iconClass:"fa fa-sitemap"}}})}(),angular.module("patternfly.card").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("card/aggregate-status/aggregate-status-card.html",'

{{status.count}} {{status.title}} {{status.count}} {{status.title}}

{{ notification.count }} {{ notification.count }}

{{status.count}} {{status.title}} {{status.count}} {{status.title}}

{{status.notification.count}} {{status.notification.count}}

'),$templateCache.put("card/basic/card-filter.html",''),$templateCache.put("card/basic/card.html",'

{{headTitle}}

{{subTitle}}
')}]),angular.module("patternfly.charts").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("charts/donut/donut-pct-chart.html","
"),$templateCache.put("charts/sparkline/sparkline-chart.html","
"),$templateCache.put("charts/trends/trends-chart.html","
{{config.title}} {{getLatestValue()}} {{config.units}} {{getPercentageValue() + '%'}} of {{chartData.total + ' ' + config.units}}
{{config.timeFrame}}
{{getLatestValue()}} {{config.units}} {{getPercentageValue() + '%'}} of {{chartData.total + ' ' + config.units}} {{config.title}}
{{getPercentageValue() + '%'}}
{{config.trendLabel}} {{getLatestValue()}} of {{chartData.total + ' ' + config.units}}
"),$templateCache.put("charts/utilization-bar/utilization-bar-chart.html",'
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
'),$templateCache.put("charts/utilization/utilization-chart.html",'

{{config.title}}

{{currentValue}}

{{currentText}}
of {{chartData.total}} {{config.units}}
{{legendLeftText}} {{legendRightText}}
')}]),angular.module("patternfly.filters").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("filters/simple-filter-fields.html",'
'),$templateCache.put("filters/simple-filter-results.html",'
{{config.resultsCount}} Results

Active filters:

  • {{filter.title}}: {{filter.value}}

Clear All Filters

'),$templateCache.put("filters/simple-filter.html","
")}]),angular.module("patternfly.form").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("form/datepicker/datepicker.html",'
'),$templateCache.put("form/form-buttons/form-buttons.html",'
'),$templateCache.put("form/form-group/form-group.html",'
  • {{ message }}
')}]),angular.module("patternfly.notification").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("notification/notification-list.html",'
'),$templateCache.put("notification/notification.html",'
{{pfNotificationHeader}} {{pfNotificationMessage}}
')}]),angular.module("patternfly.sort").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("sort/simple-sort.html",'
')}]),angular.module("patternfly.views").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("views/datalist/data-list.html",'
'),$templateCache.put("views/datatiles/data-tiles.html",'
'),$templateCache.put("views/toolbar/data-toolbar.html",'
')}]); \ No newline at end of file +var alreadySelected,selectionChanged=!1,continueEvent=!0;return scope.checkDisabled(item)?continueEvent:(scope.config&&scope.config.selectItems&&item&&(scope.config.multiSelect&&!scope.config.dblClick?(alreadySelected=_.find(scope.config.selectedItems,function(itemObj){return itemObj===item}),alreadySelected?scope.config.selectedItems=_.without(scope.config.selectedItems,item):(scope.config.selectedItems.push(item),selectionChanged=!0)):scope.config.selectedItems[0]===item?(scope.config.dblClick||(scope.config.selectedItems=[],selectionChanged=!0),continueEvent=!1):(scope.config.selectedItems=[item],selectionChanged=!0),selectionChanged&&scope.config.onSelect&&scope.config.onSelect(item,e),selectionChanged&&scope.config.onSelectionChange&&scope.config.onSelectionChange(scope.config.selectedItems,e)),scope.config.onClick&&scope.config.onClick(item,e),continueEvent)},scope.dblClick=function(e,item){scope.config.onDblClick&&scope.config.onDblClick(item,e)},scope.checkBoxChange=function(item){scope.config.onCheckBoxChange&&scope.config.onCheckBoxChange(item)},scope.isSelected=function(item){var matchProp=scope.config.selectionMatchProp,selected=!1;if(scope.config.showSelectBox)selected=item.selected;else if(scope.config.selectedItems.length)return _.find(scope.config.selectedItems,function(itemObj){return itemObj[matchProp]===item[matchProp]});return selected},scope.checkDisabled=function(item){return scope.config.checkDisabled&&scope.config.checkDisabled(item)}}}}]),angular.module("patternfly.views").directive("pfDataToolbar",function(){"use strict";return{restrict:"A",scope:{config:"="},replace:!0,transclude:!1,templateUrl:"views/toolbar/data-toolbar.html",controller:["$scope",function($scope){$scope.viewSelected=function(viewId){$scope.config.viewsConfig.currentView=viewId,$scope.config.viewsConfig.onViewSelect&&!$scope.checkViewDisabled(viewId)&&$scope.config.viewsConfig.onViewSelect(viewId)},$scope.isViewSelected=function(viewId){return $scope.config.viewsConfig&&$scope.config.viewsConfig.currentView===viewId},$scope.checkViewDisabled=function(view){return $scope.config.viewsConfig.checkViewDisabled&&$scope.config.viewsConfig.checkViewDisabled(view)},$scope.filterExists=function(filter){var foundFilter=_.findWhere($scope.config.filterConfig.appliedFilters,{title:filter.title,value:filter.value});return void 0!==foundFilter},$scope.addFilter=function(field,value){var newFilter={id:field.id,title:field.title,value:value};$scope.filterExists(newFilter)||($scope.config.filterConfig.appliedFilters.push(newFilter),$scope.config.filterConfig.onFilterChange&&$scope.config.filterConfig.onFilterChange($scope.config.filterConfig.appliedFilters))},$scope.handleAction=function(action){action&&action.actionFn&&action.isDisabled!==!0&&action.actionFn(action)}}],link:function(scope,element,attrs){scope.$watch("config",function(){scope.config&&scope.config.viewsConfig&&scope.config.viewsConfig.views&&(scope.config.viewsConfig.viewsList=angular.copy(scope.config.viewsConfig.views),scope.config.viewsConfig.currentView||(scope.config.viewsConfig.currentView=scope.config.viewsConfig.viewsList[0]))},!0)}}}),function(){"use strict";angular.module("patternfly.views").constant("pfViewUtils",{getDashboardView:function(title){return{id:"dashboardView",title:title||"Dashboard View",iconClass:"fa fa-dashboard"}},getTilesView:function(title){return{id:"tilesView",title:title||"Tiles View",iconClass:"fa fa-th"}},getListView:function(title){return{id:"listView",title:title||"List View",iconClass:"fa fa-th-list"}},getTableView:function(title){return{id:"tableView",title:title||"Table View",iconClass:"fa fa-table"}},getTopologyView:function(title){return{id:"topologyView",title:title||"Topology View",iconClass:"fa fa-sitemap"}}})}(),angular.module("patternfly.card").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("card/aggregate-status/aggregate-status-card.html",'

{{status.count}} {{status.title}} {{status.count}} {{status.title}}

{{ notification.count }} {{ notification.count }}

{{status.count}} {{status.title}} {{status.count}} {{status.title}}

{{status.notification.count}} {{status.notification.count}}

'),$templateCache.put("card/basic/card-filter.html",''),$templateCache.put("card/basic/card.html",'

{{headTitle}}

{{subTitle}}
')}]),angular.module("patternfly.charts").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("charts/donut/donut-pct-chart.html","
"),$templateCache.put("charts/sparkline/sparkline-chart.html","
"),$templateCache.put("charts/trends/trends-chart.html","
{{config.title}} {{getLatestValue()}} {{config.units}} {{getPercentageValue() + '%'}} of {{chartData.total + ' ' + config.units}}
{{config.timeFrame}}
{{getLatestValue()}} {{config.units}} {{getPercentageValue() + '%'}} of {{chartData.total + ' ' + config.units}} {{config.title}}
{{getPercentageValue() + '%'}}
{{config.trendLabel}} {{getLatestValue()}} of {{chartData.total + ' ' + config.units}}
"),$templateCache.put("charts/utilization-bar/utilization-bar-chart.html",'
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
{{chartTitle}}
{{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
'),$templateCache.put("charts/utilization/utilization-chart.html",'

{{config.title}}

{{currentValue}}

{{currentText}}
of {{chartData.total}} {{config.units}}
{{legendLeftText}} {{legendRightText}}
')}]),angular.module("patternfly.filters").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("filters/simple-filter-fields.html",'
'),$templateCache.put("filters/simple-filter-results.html",'
{{config.resultsCount}} Results

Active filters:

  • {{filter.title}}: {{filter.value}}

Clear All Filters

'),$templateCache.put("filters/simple-filter.html","
")}]),angular.module("patternfly.form").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("form/datepicker/datepicker.html",'
'),$templateCache.put("form/form-buttons/form-buttons.html",'
'),$templateCache.put("form/form-group/form-group.html",'
  • {{ message }}
')}]),angular.module("patternfly.notification").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("notification/notification-list.html",'
'),$templateCache.put("notification/notification.html",'
{{pfNotificationHeader}} {{pfNotificationMessage}}
')}]),angular.module("patternfly.sort").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("sort/simple-sort.html",'
')}]),angular.module("patternfly.views").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("views/datalist/data-list.html",'
'),$templateCache.put("views/datatiles/data-tiles.html",'
'),$templateCache.put("views/toolbar/data-toolbar.html",'
')}]); \ No newline at end of file diff --git a/src/charts/utilization-bar/utilization-bar-chart.html b/src/charts/utilization-bar/utilization-bar-chart.html index 175699fcf..e8442b95e 100644 --- a/src/charts/utilization-bar/utilization-bar-chart.html +++ b/src/charts/utilization-bar/utilization-bar-chart.html @@ -4,12 +4,12 @@
+ ng-style="{width:chartData.percentageUsed + '%'}" tooltip="{{chartData.percentageUsed}}% Used"> {{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
+ ng-style="{width:(100 - chartData.percentageUsed) + '%'}" tooltip="{{100 - chartData.percentageUsed}}% Available">
@@ -20,12 +20,12 @@
+ ng-style="{width:chartData.percentageUsed + '%'}" tooltip="{{chartData.percentageUsed}}% Used"> {{chartData.used}} of {{chartData.total}} {{units}} Used {{chartData.percentageUsed}}% Used
+ ng-style="{width:(100 - chartData.percentageUsed) + '%'}" tooltip="{{100 - chartData.percentageUsed}}% Available">