Your IP : 3.144.78.255


Current Path : /var/www/admin_ftp_12/data/www/httpdocs/bitrix/js/ui/progressround/dist/
Upload File :
Current File : /var/www/admin_ftp_12/data/www/httpdocs/bitrix/js/ui/progressround/dist/progressround.bundle.min.js

this.BX=this.BX||{};(function(t,e,s){"use strict";class i{}i.DEFAULT="ui-progressround-default";i.DANGER="ui-progressround-danger";i.SUCCESS="ui-progressround-success";i.PRIMARY="ui-progressround-primary";i.WARNING="ui-progressround-warning";class r{}r.COUNTER="COUNTER";r.PERCENT="PERCENT";r.INCIRCLE="INCIRCLE";r.INCIRCLECOUNTER="INCIRCLECOUNTER";r.NONE="NONE";let o=t=>t,n,a,h,u,l,g;var c=babelHelpers.classPrivateFieldLooseKey("setCustomColors");class d{constructor(t){Object.defineProperty(this,c,{value:p});this.options=s.Type.isPlainObject(t)?t:{};this.value=s.Type.isNumber(this.options.value)?this.options.value:0;this.maxValue=s.Type.isNumber(this.options.maxValue)?this.options.maxValue:100;this.bar=null;this.container=null;this.width=s.Type.isNumber(this.options.width)?this.options.width:100;this.lineSize=s.Type.isNumber(this.options.lineSize)?this.options.lineSize:5;this.status=null;this.statusType=s.Type.isString(this.options.statusType)?this.options.statusType:BX.UI.ProgressRound.Status.NONE;this.statusPercent="0%";this.statusCounter="0 / 0";this.textBefore=s.Type.isString(this.options.textBefore)?this.options.textBefore:null;this.textBeforeContainer=null;this.textAfter=s.Type.isString(this.options.textAfter)?this.options.textAfter:null;this.textAfterContainer=null;this.fill=false;this.finished=false;this.rotation=s.Type.isBoolean(this.options.rotation)?this.options.rotation:false;this.colorTrack=s.Type.isString(this.options.colorTrack)?this.options.colorTrack:null;this.colorBar=s.Type.isString(this.options.colorBar)?this.options.colorBar:null;this.color=s.Type.isString(this.options.color)?this.options.color:BX.UI.ProgressRound.Color.PRIMARY}setValue(t){if(s.Type.isNumber(t)){this.value=t>this.maxValue?this.maxValue:t}return this}getValue(){return this.value}setMaxValue(t){if(s.Type.isNumber(t)){this.maxValue=t}return this}getMaxValue(){return this.maxValue}finish(){this.update(this.maxValue)}isFinish(){return this.finished}setWidth(t){if(s.Type.isNumber(t)){this.width=t}return this}getWidth(){return this.width}setLineSize(t){if(s.Type.isNumber(t)){this.lineSize=t>this.width/2?this.width/2:t}return this}getLineSize(){return this.lineSize}setColor(t){if(s.Type.isStringFilled(t)){if(this.container===null){this.createContainer()}s.Dom.removeClass(this.container,this.color);this.color=t;s.Dom.addClass(this.container,this.color)}return this}setColorBar(t){if(s.Type.isStringFilled(t)){this.colorBar=t;t="--ui-current-round-color:"+t+";";babelHelpers.classPrivateFieldLooseBase(this,c)[c](t)}return this}setColorTrack(t){if(s.Type.isStringFilled(t)){this.colorTrack=t;this.setFill(true);t="--ui-current-round-bg-track-color:"+t+";";babelHelpers.classPrivateFieldLooseBase(this,c)[c](t)}return this}setFill(t){if(this.container===null){this.createContainer()}if(s.Type.isBoolean(t)){this.fill=t;if(t===true){s.Dom.addClass(this.container,"ui-progressround-bg")}else{s.Dom.removeClass(this.container,"ui-progressround-bg")}}return this}setRotation(t){if(this.container===null){this.createContainer()}if(s.Type.isBoolean(t)){this.rotation=t;if(t===true){s.Dom.addClass(this.container,"ui-progressround-rotation")}else{s.Dom.removeClass(this.container,"ui-progressround-rotation")}}return this}setTextBefore(t){if(s.Type.isStringFilled(t)){this.textBefore=t;if(!this.textBeforeContainer){this.createTextBefore(t)}else{s.Dom.adjust(this.textBeforeContainer,{html:t})}}}createTextBefore(t){if(!this.textBeforeContainer&&s.Type.isStringFilled(t)){this.textBeforeContainer=s.Tag.render(n||(n=o`
				<div class="ui-progressround-text-before">${0}</div>
			`),t)}}getTextBefore(){if(!this.textBeforeContainer){this.createTextBefore(this.textBefore)}return this.textBeforeContainer}setTextAfter(t){if(s.Type.isStringFilled(t)){this.textAfter=t;if(!this.textAfterContainer){this.createTextAfter(t)}else{s.Dom.adjust(this.textAfterContainer,{html:t})}}}createTextAfter(t){if(!this.textAfterContainer&&s.Type.isStringFilled(t)){this.textAfterContainer=s.Tag.render(a||(a=o`
				<div class="ui-progressround-text-after">${0}</div>
			`),t)}}getTextAfter(){if(!this.textAfterContainer){this.createTextAfter(this.textAfter)}return this.textAfterContainer}setStatus(){if(this.getStatusType()===BX.UI.ProgressRound.Status.COUNTER){s.Dom.adjust(this.status,{text:this.getStatusCounter()})}else if(this.getStatusType()===BX.UI.ProgressRound.Status.PERCENT){s.Dom.adjust(this.status,{text:this.getStatusPercent()})}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLE){s.Dom.adjust(this.status,{text:this.getStatusPercent()})}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLECOUNTER){s.Dom.adjust(this.status,{text:this.getStatusCounter()})}}getStatus(){if(!this.status){if(this.getStatusType()===BX.UI.ProgressRound.Status.COUNTER){this.status=s.Tag.render(h||(h=o`
					<div class="ui-progressround-status">${0}</div>
				`),this.getStatusCounter())}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLE){this.status=s.Tag.render(u||(u=o`
					<div class="ui-progressround-status-percent-incircle">${0}</div>
				`),this.getStatusPercent())}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLECOUNTER){this.status=s.Tag.render(l||(l=o`
					<div class="ui-progressround-status-incircle">${0}</div>
				`),this.getStatusCounter())}else if(this.getStatusType()===BX.UI.ProgressRound.Status.PERCENT){this.status=s.Tag.render(g||(g=o`
					<div class="ui-progressround-status-percent">${0}</div>
				`),this.getStatusPercent())}else{this.status=s.Dom.create("span",{})}}return this.status}getStatusPercent(){if(this.maxValue===0){return"0%"}this.statusPercent=Math.round(this.getValue()/(this.getMaxValue()/100));if(this.statusPercent>100){this.statusPercent=100}return this.statusPercent+"%"}getStatusCounter(){if(Math.round(this.getValue())>Math.round(this.getMaxValue())){this.statusCounter=Math.round(this.getMaxValue())+" / "+Math.round(this.getMaxValue())}else{this.statusCounter=Math.round(this.getValue())+" / "+Math.round(this.getMaxValue())}return this.statusCounter}getStatusType(){return this.statusType}setStatusType(t){if(s.Type.isStringFilled(t)){this.statusType=t}}createContainer(){if(this.container===null){this.container=s.Dom.create("div",{props:{className:"ui-progressround"},children:[this.getTextAfter(),this.getTextBefore(),s.Dom.create("div",{props:{className:"ui-progressround-track"},children:[this.getStatus(),this.getBar()]})]});this.setStatusType(this.statusType);this.setColor(this.color);this.setRotation(this.rotation);this.setFill(this.fill);this.setColorTrack(this.colorTrack);this.setColorBar(this.colorBar)}}getCircleFerence(){return(this.width/2-this.lineSize/2)*2*3.14}getCircleProgress(){return this.getCircleFerence()-this.getCircleFerence()/this.maxValue*this.value}getBar(){var t=this.width/2-this.lineSize/2;this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg");this.svg.setAttributeNS(null,"class","ui-progressround-track-bar");this.svg.setAttributeNS(null,"viewport","0 0 "+this.width+" "+this.width);this.svg.setAttributeNS(null,"width",this.width);this.svg.setAttributeNS(null,"height",this.width);this.progressBg=document.createElementNS("http://www.w3.org/2000/svg","circle");this.progressBg.setAttributeNS(null,"r",t);this.progressBg.setAttributeNS(null,"cx",this.width/2);this.progressBg.setAttributeNS(null,"cy",this.width/2);this.progressBg.setAttributeNS(null,"stroke-width",this.lineSize);this.progressBg.setAttributeNS(null,"class","ui-progressround-track-bar-bg");this.svg.appendChild(this.progressBg);this.progressMove=document.createElementNS("http://www.w3.org/2000/svg","circle");this.progressMove.setAttributeNS(null,"r",t);this.progressMove.setAttributeNS(null,"cx",this.width/2);this.progressMove.setAttributeNS(null,"cy",this.width/2);this.progressMove.setAttributeNS(null,"stroke-width",this.lineSize);this.progressMove.setAttributeNS(null,"stroke-dasharray",this.getCircleFerence());this.progressMove.setAttributeNS(null,"stroke-dashoffset",this.getCircleFerence());this.progressMove.setAttributeNS(null,"class","ui-progressround-track-bar-progress");this.svg.appendChild(this.progressMove);return this.svg}animateProgressBar(){this.svg.setAttributeNS(null,"class","task-report-circle-bar task-report-circle-bar-animate");var t=this.maxValue===0?this.getCircleFerence():this.getCircleProgress();this.progressMove.setAttributeNS(null,"stroke-dashoffset",t)}update(t){if(this.container===null){this.createContainer()}this.setValue(t);if(t>=this.maxValue){setTimeout(function(){s.Dom.addClass(this.container,"ui-progressround-finished")}.bind(this),300);this.finished=true}else{s.Dom.removeClass(this.container,"ui-progressround-finished");this.finished=false}this.setStatus();if(this.svg===null){this.getBar()}this.animateProgressBar()}getContainer(){if(this.container===null){this.createContainer()}this.animateProgressBar();return this.container}renderTo(t){if(s.Type.isDomNode(t)){return t.appendChild(this.getContainer())}return null}destroy(){s.Dom.remove(this.container);this.container=null;this.finished=false;this.textAfterContainer=null;this.textBeforeContainer=null;this.bar=null;this.svg=null;for(const t in this){if(this.hasOwnProperty(t)){delete this[t]}}Object.setPrototypeOf(this,null)}}function p(t){if(this.container===null){this.createContainer()}let e=this.container.getAttribute("style"),s=!e?t:e+t;this.container.setAttribute("style",s)}d.Color=i;d.Status=r;const f=s.Reflection.namespace("BX.UI");f.Progressround=d;t.ProgressRound=d;t.ProgressRoundColor=i;t.ProgressRoundStatus=r})(this.BX.UI=this.BX.UI||{},BX,BX);
//# sourceMappingURL=progressround.bundle.map.js