File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/ui/install/js/ui/progressround/dist/progressround.bundle.min.js
Back
this.BX=this.BX||{};(function(t,e){"use strict";var s=function t(){babelHelpers.classCallCheck(this,t)};babelHelpers.defineProperty(s,"DEFAULT","ui-progressround-default");babelHelpers.defineProperty(s,"DANGER","ui-progressround-danger");babelHelpers.defineProperty(s,"SUCCESS","ui-progressround-success");babelHelpers.defineProperty(s,"PRIMARY","ui-progressround-primary");babelHelpers.defineProperty(s,"WARNING","ui-progressround-warning");var i=function t(){babelHelpers.classCallCheck(this,t)};babelHelpers.defineProperty(i,"COUNTER","COUNTER");babelHelpers.defineProperty(i,"PERCENT","PERCENT");babelHelpers.defineProperty(i,"INCIRCLE","INCIRCLE");babelHelpers.defineProperty(i,"INCIRCLECOUNTER","INCIRCLECOUNTER");babelHelpers.defineProperty(i,"NONE","NONE");var r,n,o,a,u,l;function h(t,e){c(t,e);e.add(t)}function c(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function p(t,e,s){if(!e.has(t)){throw new TypeError("attempted to get private field on non-instance")}return s}var g=new WeakSet;var f=function(){function t(s){babelHelpers.classCallCheck(this,t);h(this,g);this.options=e.Type.isPlainObject(s)?s:{};this.value=e.Type.isNumber(this.options.value)?this.options.value:0;this.maxValue=e.Type.isNumber(this.options.maxValue)?this.options.maxValue:100;this.bar=null;this.container=null;this.width=e.Type.isNumber(this.options.width)?this.options.width:100;this.lineSize=e.Type.isNumber(this.options.lineSize)?this.options.lineSize:5;this.status=null;this.statusType=e.Type.isString(this.options.statusType)?this.options.statusType:BX.UI.ProgressRound.Status.NONE;this.statusPercent="0%";this.statusCounter="0 / 0";this.textBefore=e.Type.isString(this.options.textBefore)?this.options.textBefore:null;this.textBeforeContainer=null;this.textAfter=e.Type.isString(this.options.textAfter)?this.options.textAfter:null;this.textAfterContainer=null;this.fill=false;this.finished=false;this.rotation=e.Type.isBoolean(this.options.rotation)?this.options.rotation:false;this.colorTrack=e.Type.isString(this.options.colorTrack)?this.options.colorTrack:null;this.colorBar=e.Type.isString(this.options.colorBar)?this.options.colorBar:null;this.color=e.Type.isString(this.options.color)?this.options.color:BX.UI.ProgressRound.Color.PRIMARY}babelHelpers.createClass(t,[{key:"setValue",value:function t(s){if(e.Type.isNumber(s)){this.value=s>this.maxValue?this.maxValue:s}return this}},{key:"getValue",value:function t(){return this.value}},{key:"setMaxValue",value:function t(s){if(e.Type.isNumber(s)){this.maxValue=s}return this}},{key:"getMaxValue",value:function t(){return this.maxValue}},{key:"finish",value:function t(){this.update(this.maxValue)}},{key:"isFinish",value:function t(){return this.finished}},{key:"setWidth",value:function t(s){if(e.Type.isNumber(s)){this.width=s}return this}},{key:"getWidth",value:function t(){return this.width}},{key:"setLineSize",value:function t(s){if(e.Type.isNumber(s)){this.lineSize=s>this.width/2?this.width/2:s}return this}},{key:"getLineSize",value:function t(){return this.lineSize}},{key:"setColor",value:function t(s){if(e.Type.isStringFilled(s)){if(this.container===null){this.createContainer()}e.Dom.removeClass(this.container,this.color);this.color=s;e.Dom.addClass(this.container,this.color)}return this}},{key:"setColorBar",value:function t(s){if(e.Type.isStringFilled(s)){this.colorBar=s;s="--ui-current-round-color:"+s+";";p(this,g,d).call(this,s)}return this}},{key:"setColorTrack",value:function t(s){if(e.Type.isStringFilled(s)){this.colorTrack=s;this.setFill(true);s="--ui-current-round-bg-track-color:"+s+";";p(this,g,d).call(this,s)}return this}},{key:"setFill",value:function t(s){if(this.container===null){this.createContainer()}if(e.Type.isBoolean(s)){this.fill=s;if(s===true){e.Dom.addClass(this.container,"ui-progressround-bg")}else{e.Dom.removeClass(this.container,"ui-progressround-bg")}}return this}},{key:"setRotation",value:function t(s){if(this.container===null){this.createContainer()}if(e.Type.isBoolean(s)){this.rotation=s;if(s===true){e.Dom.addClass(this.container,"ui-progressround-rotation")}else{e.Dom.removeClass(this.container,"ui-progressround-rotation")}}return this}},{key:"setTextBefore",value:function t(s){if(e.Type.isStringFilled(s)){this.textBefore=s;if(!this.textBeforeContainer){this.createTextBefore(s)}else{e.Dom.adjust(this.textBeforeContainer,{html:s})}}}},{key:"createTextBefore",value:function t(s){if(!this.textBeforeContainer&&e.Type.isStringFilled(s)){this.textBeforeContainer=e.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-progressround-text-before">',"</div>\n\t\t\t"])),s)}}},{key:"getTextBefore",value:function t(){if(!this.textBeforeContainer){this.createTextBefore(this.textBefore)}return this.textBeforeContainer}},{key:"setTextAfter",value:function t(s){if(e.Type.isStringFilled(s)){this.textAfter=s;if(!this.textAfterContainer){this.createTextAfter(s)}else{e.Dom.adjust(this.textAfterContainer,{html:s})}}}},{key:"createTextAfter",value:function t(s){if(!this.textAfterContainer&&e.Type.isStringFilled(s)){this.textAfterContainer=e.Tag.render(n||(n=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-progressround-text-after">',"</div>\n\t\t\t"])),s)}}},{key:"getTextAfter",value:function t(){if(!this.textAfterContainer){this.createTextAfter(this.textAfter)}return this.textAfterContainer}},{key:"setStatus",value:function t(){if(this.getStatusType()===BX.UI.ProgressRound.Status.COUNTER){e.Dom.adjust(this.status,{text:this.getStatusCounter()})}else if(this.getStatusType()===BX.UI.ProgressRound.Status.PERCENT){e.Dom.adjust(this.status,{text:this.getStatusPercent()})}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLE){e.Dom.adjust(this.status,{text:this.getStatusPercent()})}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLECOUNTER){e.Dom.adjust(this.status,{text:this.getStatusCounter()})}}},{key:"getStatus",value:function t(){if(!this.status){if(this.getStatusType()===BX.UI.ProgressRound.Status.COUNTER){this.status=e.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-progressround-status">',"</div>\n\t\t\t\t"])),this.getStatusCounter())}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLE){this.status=e.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-progressround-status-percent-incircle">',"</div>\n\t\t\t\t"])),this.getStatusPercent())}else if(this.getStatusType()===BX.UI.ProgressRound.Status.INCIRCLECOUNTER){this.status=e.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-progressround-status-incircle">',"</div>\n\t\t\t\t"])),this.getStatusCounter())}else if(this.getStatusType()===BX.UI.ProgressRound.Status.PERCENT){this.status=e.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-progressround-status-percent">',"</div>\n\t\t\t\t"])),this.getStatusPercent())}else{this.status=e.Dom.create("span",{})}}return this.status}},{key:"getStatusPercent",value:function t(){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+"%"}},{key:"getStatusCounter",value:function t(){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}},{key:"getStatusType",value:function t(){return this.statusType}},{key:"setStatusType",value:function t(s){if(e.Type.isStringFilled(s)){this.statusType=s}}},{key:"createContainer",value:function t(){if(this.container===null){this.container=e.Dom.create("div",{props:{className:"ui-progressround"},children:[this.getTextAfter(),this.getTextBefore(),e.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)}}},{key:"getCircleFerence",value:function t(){return(this.width/2-this.lineSize/2)*2*3.14}},{key:"getCircleProgress",value:function t(){return this.getCircleFerence()-this.getCircleFerence()/this.maxValue*this.value}},{key:"getBar",value:function t(){var e=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",e);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",e);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}},{key:"animateProgressBar",value:function t(){this.svg.setAttributeNS(null,"class","task-report-circle-bar task-report-circle-bar-animate");var e=this.maxValue===0?this.getCircleFerence():this.getCircleProgress();this.progressMove.setAttributeNS(null,"stroke-dashoffset",e)}},{key:"update",value:function t(s){if(this.container===null){this.createContainer()}this.setValue(s);if(s>=this.maxValue){setTimeout(function(){e.Dom.addClass(this.container,"ui-progressround-finished")}.bind(this),300);this.finished=true}else{e.Dom.removeClass(this.container,"ui-progressround-finished");this.finished=false}this.setStatus();if(this.svg===null){this.getBar()}this.animateProgressBar()}},{key:"getContainer",value:function t(){if(this.container===null){this.createContainer()}this.animateProgressBar();return this.container}},{key:"renderTo",value:function t(s){if(e.Type.isDomNode(s)){return s.appendChild(this.getContainer())}return null}},{key:"destroy",value:function t(){e.Dom.remove(this.container);this.container=null;this.finished=false;this.textAfterContainer=null;this.textBeforeContainer=null;this.bar=null;this.svg=null;for(var s in this){if(this.hasOwnProperty(s)){delete this[s]}}Object.setPrototypeOf(this,null)}}]);return t}();function d(t){if(this.container===null){this.createContainer()}var e=this.container.getAttribute("style"),s=!e?t:e+t;this.container.setAttribute("style",s)}babelHelpers.defineProperty(f,"Color",s);babelHelpers.defineProperty(f,"Status",i);var y=e.Reflection.namespace("BX.UI");y.Progressround=f;t.ProgressRound=f})(this.BX.UI=this.BX.UI||{},BX); //# sourceMappingURL=progressround.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings