Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/ui/label/dist/ |
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/ui/label/dist/label.bundle.min.js |
this.BX=this.BX||{};(function(t,s,i,e){"use strict";class l{}l.DEFAULT="ui-label-default";l.DANGER="ui-label-danger";l.SUCCESS="ui-label-success";l.WARNING="ui-label-warning";l.PRIMARY="ui-label-primary";l.SECONDARY="ui-label-secondary";l.LIGHT="ui-label-light";l.TAG_SECONDARY="ui-label-tag-secondary";l.TAG_LIGHT="ui-label-tag-light";l.LIGHT_BLUE="ui-label-lightblue";l.LIGHT_GREEN="ui-label-lightgreen";l.ORANGE="ui-label-orange";l.LIGHT_ORANGE="ui-label-lightorange";l.YELLOW="ui-label-yellow";l.LIGHT_YELLOW="ui-label-lightyellow";l.LIGHT_RED="ui-label-lightred";l.LAVENDER="ui-label-lavender";l.COPILOT_LIGHT="ui-label-copilot-light";l.COPILOT_LIGHT_REVERSE="ui-label-copilot-light-reverse";class a{}a.MD="ui-label-md";a.SM="ui-label-sm";a.LG="ui-label-lg";let n=t=>t,o,h,r,u,c;class C{constructor(t){this.text=t.text;this.color=t.color;this.size=t.size;this.link=t.link;this.icon=t.icon;this.fill=!!t.fill?true:t.fill;this.customClass=t.customClass;this.classList="ui-label";this.status=t.status;this.node={container:null,status:null};this.setText(this.text);this.setLink(this.link);this.setColor(this.color);this.setFill(this.fill);this.setCustomClass(this.customClass)}setColor(t){this.color=t;this.setClassList()}getColor(){return this.color}setFill(t){this.fill=!!t?true:false;this.setClassList()}getFill(){return this.fill}setSize(t){this.size=t;this.setClassList()}getSize(){return this.size}setLink(t){this.link=t}getLink(){return this.link}setText(t){this.text=t;if(s.Type.isStringFilled(t)){this.getTextContainer().textContent=t}}getText(){return this.text}getTextContainer(){if(!this.textContainer){this.textContainer=s.Tag.render(o||(o=n`<span class="ui-label-inner">${0}</span>`),this.getText())}return this.textContainer}setCustomClass(t){this.customClass=t;this.updateClassList()}getCustomClass(){return this.customClass}setClassList(){this.classList="ui-label";if(typeof this.getColor()!="undefined"){this.classList=this.classList+" "+this.color}if(typeof this.getSize()!="undefined"){this.classList=this.classList+" "+this.size}if(typeof this.getCustomClass()!="undefined"){this.classList=this.classList+" "+this.customClass}if(this.fill){this.classList=this.classList+" ui-label-fill"}this.updateClassList()}getClassList(){return this.classList}updateClassList(){if(!this.node.container){this.getContainer()}this.node.container.setAttribute("class",this.classList)}getIconAction(){this.iconNode=s.Tag.render(h||(h=n`<div class="ui-label-icon"></div>`));for(let t in this.icon){this.iconNode.addEventListener(t,this.icon[t])}return this.iconNode}getLoader(){if(!this.loader){this.loader=new i.Loader({size:12})}return this.loader}setStatus(t){if(t){this.status=t}s.Dom.clean(this.getContainerStatus());this.getContainerStatus().classList.remove("--icon");if(this.status.toLocaleUpperCase()==="LOADING"){this.getLoader().show(this.getContainerStatus())}if(this.status.toLocaleUpperCase()==="CHECK"){let t=new e.Icon({icon:e.Main.CHECK,size:10});this.getContainerStatus().classList.add("--icon");this.getContainerStatus().appendChild(t.render())}}getContainerStatus(){if(!this.node.status){this.node.status=s.Tag.render(r||(r=n` <div class="ui-label-status"></div> `))}return this.node.status}getContainer(){if(!this.node.container){if(this.getLink()){this.node.container=s.Tag.render(u||(u=n`<a href="${0}" class="${0}"> ${0} ${0} </a>`),this.link,this.getClassList(),this.getContainerStatus(),this.getTextContainer())}else{this.node.container=s.Tag.render(c||(c=n`<div class="${0}"> ${0} ${0} </div>`),this.getClassList(),this.getContainerStatus(),this.getTextContainer())}if(typeof this.icon==="object"){this.node.container.appendChild(this.getIconAction())}}return this.node.container}render(){if(this.status){this.setStatus(this.status)}return this.getContainer()}}C.Color=l;C.Size=a;t.Label=C;t.LabelColor=l;t.LabelSize=a})(this.BX.UI=this.BX.UI||{},BX,BX,BX.UI.IconSet); //# sourceMappingURL=label.bundle.map.js