/*! * 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(['sap/ui/core/date/UniversalDate','sap/ui/core/InvisibleText','sap/ui/unified/library'],function(U,I,u){"use strict";var C=u.CalendarDayType;var a=u.CalendarAppointmentVisualization;var O={};O.render=function(r,c){r.write("");r.renderControl(c.getAggregation("_columnHeaders"));this.renderBlockersContainer(r,c);r.write("");this.renderRowHeaders(r,c);this.renderNowMarker(r,c);this.renderColumns(r,c);r.write("");r.write("");};O.renderBlockersContainer=function(r,c){var b=c._getColumns(),m=c._getBlockersToRender().iMaxlevel,s=c.getStartDate();r.write("");r.write("");for(var i=0;i");r.write("");}this.renderBlockers(r,c);r.write("");r.write("");};O.renderBlockers=function(r,c){var t=this,b=c._getBlockersToRender().oBlockersList;r.write("");b.getIterator().forEach(function(B){t.renderBlockerAppointment(r,c,B);});r.write("");};O.renderBlockerAppointment=function(r,c,b){var g=c._getDayPart(c.getStartDate()).getTime(),B=b.getData(),i=c._getDayPart(B.getStartDate()).getTime(),d=c._getDayPart(B.getEndDate()).getTime(),s=c._calculateDaysDifference(g,i),e=c._calculateDaysDifference(g,d),f=c._getColumns(),F=c.getAppointmentsVisualization()===a.Filled,R=c._getBlockerRowHeight(),h=b.level,j=b.width,t=B.getTooltip_AsString(),T=B.getType(),k=B.getColor(),l=B.getTitle(),m=B.getText(),n=B.getIcon(),o=B.getId(),A={labelledby:{value:I.getStaticId("sap.ui.unified","APPOINTMENT")+" "+o+"-Descr",append:true}},p=c.getAriaLabelledBy(),L=s*(100/f),q=(f-e-1)*(100/f),v=sap.ui.getCore().getConfiguration().getRTL();if(p.length>0){A["labelledby"].value=A["labelledby"].value+" "+p.join(" ");}if(l){A["labelledby"].value=A["labelledby"].value+" "+o+"-Title";}if(m){A["labelledby"].value=A["labelledby"].value+" "+o+"-Text";}if(B.getSelected()){A["labelledby"].value=A["labelledby"].value+" "+I.getStaticId("sap.ui.unified","APPOINTMENT_SELECTED");}if(B.getTentative()){A["labelledby"].value=A["labelledby"].value+" "+I.getStaticId("sap.ui.unified","APPOINTMENT_TENTATIVE");}r.write("");r.write("");r.write("");if(L<0){r.writeIcon("sap-icon://arrow-left",null,{title:null});}if(n){var w=["sapUiCalendarAppIcon"];var x={};x["id"]=o+"-Icon";x["title"]=null;r.writeIcon(n,w,x);}if(l){r.write("");r.writeEscaped(l,true);r.write("");}if(q<0){r.writeIcon("sap-icon://arrow-right",null,{title:null});}r.write("");r.write("");r.write("");};O.renderRowHeaders=function(r,c){var s=c._getVisibleStartHour(),e=c._getVisibleEndHour(),S=c._getUniversalCurrentDate(),h=c._getHoursFormat(),A=c._getAMPMFormat();r.write("");for(var i=s;i<=e;i++){S.setHours(i);r.write("");r.write(h.format(S));if(c._hasAMPM()){r.write("");r.write(" "+A.format(S));r.write("");}r.write("");}r.write("");};O.renderColumns=function(r,c){var b=c._getColumns(),s=c.getStartDate(),A=c._getAppointmentsToRender();r.write("");for(var i=0;i");this.renderRows(r,c);this.renderAppointments(r,c,A[d],o);r.write("");}r.write("");};O.renderRows=function(r,c){var s=c._getVisibleStartHour(),e=c._getVisibleEndHour();for(var i=s;i<=e;i++){r.write("");r.write("");}};O.renderAppointments=function(r,c,A,o){var t=this;if(A){r.write("");A.oAppointmentsList.getIterator().forEach(function(b){var m=A.iMaxLevel,l=b.level,w=b.width,d=b.getData();t.renderAppointment(r,c,m,l,w,d,o);});r.write("");}};O.renderAppointment=function(r,c,m,A,i,o,b){var f=c.getAppointmentsVisualization()===a.Filled,R=c._getRowHeight(),d=new U(b.getFullYear(),b.getMonth(),b.getDate(),c._getVisibleStartHour()),e=new U(b.getFullYear(),b.getMonth(),b.getDate(),c._getVisibleEndHour(),59,59),g=o.getStartDate(),h=o.getEndDate(),t=o.getTooltip_AsString(),T=o.getType(),s=o.getColor(),j=o.getTitle(),k=o.getText(),l=o.getIcon(),n=o.getId(),p={labelledby:{value:I.getStaticId("sap.ui.unified","APPOINTMENT")+" "+n+"-Descr",append:true}},q=c.getAriaLabelledBy(),v=d.getTime()>g.getTime(),w=e.getTime()0){p["labelledby"].value=p["labelledby"].value+" "+q.join(" ");}if(j){p["labelledby"].value=p["labelledby"].value+" "+n+"-Title";}if(k){p["labelledby"].value=p["labelledby"].value+" "+n+"-Text";}if(o.getSelected()){p["labelledby"].value=p["labelledby"].value+" "+I.getStaticId("sap.ui.unified","APPOINTMENT_SELECTED");}if(o.getTentative()){p["labelledby"].value=p["labelledby"].value+" "+I.getStaticId("sap.ui.unified","APPOINTMENT_TENTATIVE");}r.write("");r.write("");r.write("");if(l){var B=["sapUiCalendarAppIcon"];var D={};D["id"]=n+"-Icon";D["title"]=null;r.writeIcon(l,B,D);}if(j){r.write("");r.writeEscaped(j,true);r.write("");}if(k){r.write("");r.writeEscaped(k,true);r.write("");}r.write("");r.write("");r.write("");};O.renderNowMarker=function(r,c){var d=c._getUniversalCurrentDate();r.write("");r.write("");r.write(c._formatTimeAsString(d));r.write("");r.write("");};return O;},true);