/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['jquery.sap.global'],function(q){"use strict";var R={};R.render=function(j,l){var v=j;l.doBeforeRendering();v.write("");r(v,l,true);v.write("");var S=l.getSteps();for(var i=0;i0){f(v,l,x);}else{a(v,l,x);}}v.write("");r(v,l,false);v.write("");};R.selectStepWithId=function(i,I){var C=i.getSelectedStep();if(C){q.sap.byId(C).removeClass("sapUiRoadMapSelected");}if(I){q.sap.byId(I).addClass("sapUiRoadMapSelected");}if(sap.ui.getCore().getConfiguration().getAccessibility()){if(C){q.sap.byId(C+"-box").removeAttr("aria-checked");}if(I){q.sap.byId(I+"-box").attr("aria-checked",true);}}};R.selectStep=function(j,S,I,l,E,v){if(!v){R.selectStepWithId(j,S.getId());}if(!I&&S.getSubSteps().length>0){var x=S.getSubSteps();var D=S.$();var y=D.hasClass("sapUiRoadMapExpanded");var C=1;var z=function(){C--;if(C>0){return;}if(E){E(!y?"expanded":"collapsed");}R.updateStepArea(j);};var A=function(F,O,G){var H=q.sap.byId(F);if(!q.fx.off&&!l){H.width(O?"0px":j.iStepWidth);var L=q.sap.byId(F+"-label");L.addClass("sapUiRoadMapHidden");if(O){H.toggleClass("sapUiRoadMapHidden");}H.animate({width:O?j.iStepWidth:"0px"},"fast",function(){if(!O){H.toggleClass("sapUiRoadMapHidden");}H.width("");L.removeClass("sapUiRoadMapHidden");if(G){G();}});}else{H.toggleClass("sapUiRoadMapHidden");if(G){G();}}};D.toggleClass("sapUiRoadMapExpanded");if(sap.ui.getCore().getConfiguration().getAccessibility()){var B=D.hasClass("sapUiRoadMapExpanded");S.$("box").attr("aria-expanded",B);S.$("expandend-box").attr("aria-expanded",B);}for(var i=0;i=0&&P0&&S.getExpanded()){if(v){x.removeClass("sapUiRoadMapHidden");}else{x.addClass("sapUiRoadMapHidden");}for(var i=0;i"+T+"");C.width(j.width());q(sap.ui.getCore().getStaticAreaRef()).append(C);var i=false;while(T.length>0&&C.height()>j.height()){T=T.substr(0,T.length-1);C.html(q.sap.encodeHTML(T+"..."));i=true;}if(i){j.html(""+q.sap.encodeHTML(T)+"");j.attr("title",S.getLabel());}else{j.attr("title",g(S));}C.remove();};R.updateStepAria=function(S){if(!sap.ui.getCore().getConfiguration().getAccessibility()){return;}var I=S.getParent()instanceof sap.ui.commons.RoadMap;var j=S.getParent()[I?"getSteps":"getSubSteps"]();for(var i=0;i0){v=j[i].$("expandend-box");v.attr("aria-posinset",P);v.attr("aria-setsize",l);}}};var r=function(i,j,S){var T=S?"Start":"End";i.write("");};var a=function(j,l,S,A,v,I){j.write("");b(j,I?I:S.getId(),1);j.write("");j.write(x);j.write("");if(v){v(j,l,S);}j.write("");j.write("");var L=S.getLabel();if(L){j.writeEscaped(L);}j.write("");b(j,I?I:S.getId(),2);j.write("");};var g=function(S){var T=S.getTooltip_AsString();if(!T&&!S.getTooltip()&&sap.ui.getCore().getConfiguration().getAccessibility()){T=k("RDMP_DEFAULT_STEP_TOOLTIP",[S.__stepName]);}return T||"";};var b=function(i,I,j){i.write("");};var w=function(i,j,S,I){if(!sap.ui.getCore().getConfiguration().getAccessibility()){return;}i.writeAttribute("role","treeitem");if(S.getEnabled()){i.writeAttribute("aria-checked",j.getSelectedStep()==S.getId());}else{i.writeAttribute("aria-disabled",true);}i.writeAttribute("aria-haspopup",I);i.writeAttribute("aria-level",S.getParent()instanceof sap.ui.commons.RoadMap?1:2);i.writeAttribute("aria-posinset",d(S));i.writeAttribute("aria-setsize",e(S));i.writeAttributeEscaped("aria-label",c(S,S.getLabel()));if(!I){return;}i.writeAttribute("aria-expanded",S.getExpanded());};var c=function(S,l){var i=S.getParent()instanceof sap.ui.commons.RoadMap&&S.getSubSteps().length>0;var j=l||"";if(S.getEnabled()){j=k(i?"RDMP_ARIA_EXPANDABLE_STEP":"RDMP_ARIA_STANDARD_STEP",[j]);}return j;};var d=function(S){var I=S.getParent()instanceof sap.ui.commons.RoadMap;var j=S.getParent()[I?"indexOfStep":"indexOfSubStep"](S);var C=0;var l=S.getParent()[I?"getSteps":"getSubSteps"]();for(var i=0;i");};var I=S.getExpanded();a(j,l,S,I?["sapUiRoadMapExpanded"]:null,function(j,l,S){C(j,l,S.getId(),I?"roundtripstart.gif":"roundtrip.gif");});var v=S.getSubSteps();for(var i=0;i=i.iStepWidth?"sapUiRoadMapStartScroll":"sapUiRoadMapStartFixed");var E=i.$("End");E.removeClass("sapUiRoadMapEndScroll").removeClass("sapUiRoadMapEndFixed");var x=S.get(0).scrollWidth-j*l-S.width()