File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/ui/install/js/ui/stageflow/dist/stageflow.bundle.min.js
Back
this.BX=this.BX||{};(function(e,t,i){"use strict";var a,n;var s=function(){function e(t){var i=t.id,a=t.name,n=t.color,s=t.backgroundColor,r=t.isFilled,l=t.events,o=t.isSuccess,c=t.isFail,g=t.fillingColor;babelHelpers.classCallCheck(this,e);babelHelpers.defineProperty(this,"backgroundImage","url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2216px%22%20height%3D%2232px%22%20viewBox%3D%220%200%2016%2032%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%3E%3Cdefs%3E%3Cpath%20d%3D%22M0%2C2.99610022%20C0%2C1.34139976%201.3355407%2C0%202.99805158%2C0%20L6.90478569%2C0%20C8.56056385%2C0%2010.3661199%2C1.25756457%2010.9371378%2C2.80757311%20L16%2C16.5505376%20L11.0069874%2C29.2022189%20C10.3971821%2C30.7473907%208.56729657%2C32%206.90478569%2C32%20L2.99805158%2C32%20C1.34227341%2C32%200%2C30.6657405%200%2C29.0038998%20L0%2C2.99610022%20Z%22%20id%3D%22Bg%22/%3E%3C/defs%3E%3Cg%20id%3D%22Bar%22%20stroke%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cmask%20fill%3D%22white%22%20id%3D%22mask%22%3E%3Cuse%20xlink%3Ahref%3D%22%23Bg%22/%3E%3C/mask%3E%3Cuse%20fill%3D%22#COLOR2#%22%20xlink%3Ahref%3D%22%23Bg%22/%3E%3Cpolygon%20id%3D%22Ln%22%20fill%3D%22#COLOR1#%22%20mask%3D%22url%28%23mask%29%22%20points%3D%220%2030%2016%2030%2016%2032%200%2032%22/%3E%3C/g%3E%3C/svg%3E) 3 10 3 3 fill repeat");this.id=i;this.name=a;this.color=n;this.backgroundColor=s;this.isFilled=r;this.events=l;this.success=o;this.fail=c;this.fillingColor=g}babelHelpers.createClass(e,[{key:"getId",value:function e(){return this.id}},{key:"getName",value:function e(){return this.name}},{key:"setName",value:function e(t){this.name=t;if(this.textNode){this.textNode.innerText=this.name}return this}},{key:"isSuccess",value:function e(){return this.success===true}},{key:"isFail",value:function e(){return this.fail===true}},{key:"isFinal",value:function e(){return this.isFail()||this.isSuccess()}},{key:"getColor",value:function e(){return this.color}},{key:"setColor",value:function e(t){this.color=t;return this}},{key:"render",value:function i(){if(this.node){this.textNode.style.backgroundImage=this.getBackgroundImage()}else{this.textNode=t.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['<div style="border-image: ',';" class="ui-stageflow-stage-item-text">',"</div>"])),this.getBackgroundImage(),t.Text.encode(this.getName()));this.node=t.Tag.render(n||(n=babelHelpers.taggedTemplateLiteral(['<div \n\t\t\t\t\tclass="ui-stageflow-stage" \n\t\t\t\t\tdata-stage-id="','" \n\t\t\t\t\tonmouseenter="','" \n\t\t\t\t\tonmouseleave="','"\n\t\t\t\t\tonclick="','"\n\t\t\t\t>\n\t\t\t\t<div class="ui-stageflow-stage-item">\n\t\t\t\t\t',"\n\t\t\t\t</div>\n\t\t\t</div>"])),this.getId(),this.onMouseEnter.bind(this),this.onMouseLeave.bind(this),this.onClick.bind(this),this.textNode)}this.textNode.style.color=e.calculateTextColor("#"+(this.isFilled?this.color:this.backgroundColor));return this.node}},{key:"getBackgroundImage",value:function e(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!i){if(this.isFilled&&this.fillingColor){i=this.fillingColor}else{i=this.getColor()}}if(t.Type.isNull(a)){a=this.isFilled}var n=this.backgroundImage.replace("#COLOR1#",encodeURIComponent("#"+i));if(a){n=n.replace("#COLOR2#",encodeURIComponent("#"+i))}else{n=n.replace("#COLOR2#",encodeURIComponent("#"+this.backgroundColor))}return n}},{key:"onMouseEnter",value:function e(){if(t.Type.isFunction(this.events.onMouseEnter)){this.events.onMouseEnter(this)}}},{key:"onMouseLeave",value:function e(){if(t.Type.isFunction(this.events.onMouseLeave)){this.events.onMouseLeave(this)}}},{key:"onClick",value:function e(){if(t.Type.isFunction(this.events.onClick)){this.events.onClick(this)}}},{key:"addBackLight",value:function t(i){if(this.textNode){this.textNode.style.borderImage=this.getBackgroundImage(i,true);this.textNode.style.color=e.calculateTextColor("#"+i)}}},{key:"removeBackLight",value:function t(){if(this.textNode){this.textNode.style.borderImage=this.getBackgroundImage();this.textNode.style.color=e.calculateTextColor("#"+(this.isFilled?this.fillingColor:this.backgroundColor))}}}],[{key:"create",value:function i(a){if(t.Type.isPlainObject(a)&&a.id&&a.name&&a.color&&a.backgroundColor){a.id=t.Text.toInteger(a.id);a.name=a.name.toString();a.color=a.color.toString();a.backgroundColor=a.backgroundColor.toString();if(!t.Type.isPlainObject(a.events)){a.events={}}if(!t.Type.isBoolean(a.isFilled)){a.isFilled=false}if(a.id>0){return new e(a)}}return null}},{key:"calculateTextColor",value:function e(t){var i,a,n;if(t.length>7){var s=t.split("(")[1].split(")")[0];s=s.split(",");i=parseInt(s[0]);a=parseInt(s[1]);n=parseInt(s[2])}else{if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(t)){var r=t.substring(1).split("");if(r.length===3){r=[r[0],r[0],r[1],r[1],r[2],r[2]]}r="0x"+r.join("");i=r>>16&255;a=r>>8&255;n=r&255}}var l=.21*i+.72*a+.07*n;return l<145?"#fff":"#333"}}]);return e}();var r,l,o,c,g,u;function f(e,t){var i=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=h(e))||t&&e&&typeof e.length==="number"){if(i)e=i;var a=0;var n=function e(){};return{s:n,n:function t(){if(a>=e.length)return{done:true};return{done:false,value:e[a++]}},e:function e(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s=true,r=false,l;return{s:function t(){i=i.call(e)},n:function e(){var t=i.next();s=t.done;return t},e:function e(t){r=true;l=t},f:function e(){try{if(!s&&i["return"]!=null)i["return"]()}finally{if(r)throw l}}}}function h(e,t){if(!e)return;if(typeof e==="string")return d(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return d(e,t)}function d(e,t){if(t==null||t>e.length)t=e.length;for(var i=0,a=new Array(t);i<t;i++){a[i]=e[i]}return a}function S(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function v(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?S(Object(i),!0).forEach((function(t){babelHelpers.defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):S(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var p="ui-stageflow-select-semantic-popup";var C="ui-stageflow-select-final-stage-popup";var k={id:"final",color:"7BD500",isFilled:false};var m={finalStageName:t.Loc.getMessage("UI_STAGEFLOW_FINAL_STAGE_NAME"),finalStagePopupTitle:t.Loc.getMessage("UI_STAGEFLOW_FINAL_STAGE_POPUP_TITLE"),finalStagePopupFail:t.Loc.getMessage("UI_STAGEFLOW_FINAL_STAGE_POPUP_FAIL"),finalStageSelectorTitle:t.Loc.getMessage("UI_STAGEFLOW_FINAL_STAGE_SELECTOR_TITLE")};var b=function(){function e(i){var a=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];babelHelpers.classCallCheck(this,e);babelHelpers.defineProperty(this,"currentStage",0);babelHelpers.defineProperty(this,"isActive",false);this.labels=m;if(t.Type.isPlainObject(i)){if(t.Type.isString(i.backgroundColor)&&i.backgroundColor.length===6){this.backgroundColor=i.backgroundColor}if(i.currentStage){this.currentStage=t.Text.toInteger(i.currentStage)}if(t.Type.isBoolean(i.isActive)){this.isActive=i.isActive}if(t.Type.isFunction(i.onStageChange)){this.onStageChange=i.onStageChange}if(t.Type.isPlainObject(i.labels)){this.labels=v(v({},this.labels),i.labels)}}k.name=this.labels.finalStageName;if(t.Type.isArray(n)){var s=null;if(this.currentStage>0){n.forEach((function(e){if(t.Text.toInteger(e.id)===t.Text.toInteger(a.currentStage)){s=e.color}}))}this.fillStages(n,s)}if(!this.currentStage&&this.stages.length>0){this.currentStage=this.stages.keys().next().value}}babelHelpers.createClass(e,[{key:"setCurrentStageId",value:function e(i){i=t.Text.toInteger(i);var a=this.getStageById(i);if(!a){return}this.currentStage=i;var n=this.getFinalStage();if(n){if(a.isFinal()){n.setColor(a.getColor()).setName(a.getName())}else{n.setColor(k.color).setName(k.name)}}this.stages.forEach((function(e){if(!e.isFinal()){e.fillingColor=a.getColor()}}));this.addBackLightUpToStage();return this}},{key:"fillStages",value:function e(t,i){var a=this;var n=this.currentStage>0;var r={};this.stages=new Map;t.forEach((function(e){e.isFilled=n;e.backgroundColor=a.backgroundColor;e.fillingColor=i;e.events={onMouseEnter:a.onStageMouseHover.bind(a),onMouseLeave:a.onStageMouseLeave.bind(a),onClick:a.onStageClick.bind(a)};var t=s.create(e);if(t){a.stages.set(t.getId(),t)}if(t.isSuccess()){k.color=t.getColor()}if(t.isFinal()){r.isFilled=n;if(t.getId()===a.currentStage){r.name=t.getName();r.color=t.getColor()}}else if(n&&t.getId()===a.currentStage){n=false}}));if(this.getFailStages().length<=0){k.name=r.name=this.getSuccessStage().getName()}this.addFinalStage(r)}},{key:"addFinalStage",value:function e(t){this.stages.set(k.id,new s(v(v(v({},{backgroundColor:this.backgroundColor,events:{onMouseEnter:this.onStageMouseHover.bind(this),onMouseLeave:this.onStageMouseLeave.bind(this),onClick:this.onFinalStageClick.bind(this)}}),k),t)))}},{key:"getFinalStage",value:function e(){return this.getStageById(k.id)}},{key:"getStages",value:function e(){return this.stages}},{key:"getFirstFailStage",value:function e(){var t=null;this.stages.forEach((function(e){if(e.isFail()&&!t){t=e}}));return t}},{key:"getFailStages",value:function e(){var t=[];this.stages.forEach((function(e){if(e.isFail()){t.push(e)}}));return t}},{key:"getSuccessStage",value:function e(){var t=null;this.stages.forEach((function(e){if(e.isSuccess()){t=e}}));return t}},{key:"getStageById",value:function e(t){return this.stages.get(t)}},{key:"render",value:function e(){var t=this.renderContainer();this.getStages().forEach((function(e){if(e.isFinal()){return}t.appendChild(e.render())}));this.addBackLightUpToStage();return t}},{key:"renderContainer",value:function e(){if(this.container){t.Dom.clean(this.container);return this.container}this.container=t.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['<div class="ui-stageflow-container"></div>'])));return this.container}},{key:"onStageMouseHover",value:function e(t){if(!this.isActive){return}var i=f(this.stages),a;try{for(i.s();!(a=i.n()).done;){var n=babelHelpers.slicedToArray(a.value,2),s=n[0],r=n[1];r.addBackLight(t.getColor());if(s===t.getId()){break}}}catch(e){i.e(e)}finally{i.f()}}},{key:"onStageMouseLeave",value:function e(t){if(!this.isActive){return}var i=f(this.stages),a;try{for(i.s();!(a=i.n()).done;){var n=babelHelpers.slicedToArray(a.value,2),s=n[0],r=n[1];r.removeBackLight();if(s===t.getId()){break}}}catch(e){i.e(e)}finally{i.f()}}},{key:"onStageClick",value:function e(i){if(!this.isActive){return}if(i.getId()!==this.currentStage&&t.Type.isFunction(this.onStageChange)){this.onStageChange(i)}var a=this.getSemanticSelectorPopup();if(a.isShown()){a.close()}}},{key:"onFinalStageClick",value:function e(t){if(!this.isActive){return}if(this.getFailStages().length<=0){this.onStageClick(this.getSuccessStage())}else{var i=this.getSemanticSelectorPopup();i.show();var a=this.getStageById(this.currentStage);this.isActive=false;if(!a.isFinal()){var n=this.getStageById(k.id);if(n){this.addBackLightUpToStage(n.getId(),n.getColor())}}}}},{key:"addBackLightUpToStage",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!t){t=this.currentStage}var a=this.getStageById(t);if(a&&!i){i=a.getColor()}var n=!!t;this.stages.forEach((function(e){e.isFilled=n;if(e.isFilled){e.addBackLight(i?i:e.getColor())}else{e.removeBackLight()}if(!e.isFinal()&&n&&e.getId()===t){n=false}}))}},{key:"getSemanticSelectorPopup",value:function e(){var a=this;var n=i.PopupManager.getPopupById(p);if(!n){var s=this.getFailStageName();n=i.PopupManager.create({id:p,autoHide:true,closeByEsc:true,closeIcon:true,maxWidth:420,content:t.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['<div class="ui-stageflow-popup-title">',"</div>"])),this.labels.finalStagePopupTitle),buttons:[new BX.UI.Button({color:BX.UI.Button.Color.SUCCESS,text:this.getSuccessStage().getName(),onclick:function e(){a.isActive=true;a.onStageClick(a.getSuccessStage())}}),s?new BX.UI.Button({color:BX.UI.Button.Color.DANGER,text:s,onclick:function e(){n.close();var t=a.getFinalStageSelectorPopup();t.show();a.isActive=false}}):null],events:{onClose:function e(){a.setCurrentStageId(a.currentStage);a.isActive=true}}})}return n}},{key:"getFinalStageSemanticSelector",value:function e(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(!this.finalStageSemanticSelector){this.finalStageSemanticSelector=t.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['<div class="ui-stageflow-stage-selector-option ui-stageflow-stage-selector-option-fail" onclick="','"></div>'])),this.onSemanticSelectorClick.bind(this))}if(t.Type.isBoolean(i)){var a=null;var n=this.getFailStageName();if(i||!n){this.finalStageSemanticSelector.classList.add("ui-stageflow-stage-selector-option-success");this.finalStageSemanticSelector.classList.remove("ui-stageflow-stage-selector-option-fail");this.finalStageSemanticSelector.innerText=this.getSuccessStage().getName();a=this.getSuccessStage()}else{this.finalStageSemanticSelector.classList.add("ui-stageflow-stage-selector-option-fail");this.finalStageSemanticSelector.classList.remove("ui-stageflow-stage-selector-option-success");this.finalStageSemanticSelector.innerText=n;a=this.getFirstFailStage()}var s=this.getFinalStage();if(s&&a){s.setColor(a.getColor()).setName(a.getName())}this.addBackLightUpToStage(s.getId(),s.getColor())}return this.finalStageSemanticSelector}},{key:"getFinalStageSelectorPopup",value:function e(){var a=this;var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var s={};var r=t.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['<div class="ui-stageflow-final-fail-stage-list-wrapper"></div>'])));if(!n){var l=this.getFailStages();if(l.length>1){var o=true;l.forEach((function(e){r.appendChild(t.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['<div class="ui-stageflow-final-fail-stage-list-section">\n\t\t\t\t\t\t<input data-stage-id="','" id="ui-stageflow-final-fail-stage-','" name="ui-stageflow-final-fail-stage-input" class="crm-list-fail-deal-button" type="radio" ','>\n\t\t\t\t\t\t<label for="ui-stageflow-final-fail-stage-','">',"</label>\n\t\t\t\t\t</div>"])),e.getId(),e.getId(),o?'checked="checked"':"",e.getId(),e.getName()));o=false}))}}s.content=t.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['<div class="ui-stageflow-stage-selector-block">\n\t\t\t<span>'," </span>\n\t\t\t","\n\t\t</div>"])),this.labels.finalStageSelectorTitle,this.getFinalStageSemanticSelector(n));var f=i.PopupManager.getPopupById(C);if(!f){f=i.PopupManager.create({id:C,autoHide:false,closeByEsc:true,closeIcon:true,width:420,titleBar:true,buttons:[new BX.UI.SaveButton({onclick:function e(){f.close();var t=a.getSelectedFinalStage();if(t){a.onStageClick(t)}}}),new BX.UI.CancelButton({onclick:function e(){f.close()}})],events:{onClose:function e(){a.setCurrentStageId(a.currentStage);a.isActive=true}}})}f.setContent(r);f.setTitleBar(s);return f}},{key:"onSemanticSelectorClick",value:function e(){var t=this;var a=this.getFailStageName();var n=i.MenuManager.create({id:"ui-stageflow-final-stage-semantic-selector",bindElement:this.getFinalStageSemanticSelector(),items:[{text:this.getSuccessStage().getName(),onclick:function e(){t.getFinalStageSelectorPopup(true);n.close()}},a?{text:a,onclick:function e(){t.getFinalStageSelectorPopup(false);n.close()}}:null]});n.show()}},{key:"getSelectedFinalStage",value:function e(){var i=this.getFinalStageSemanticSelector();if(i.classList.contains("ui-stageflow-stage-selector-option-success")){return this.getSuccessStage()}else{var a=this.getFailStages();if(a.length>1){var n=document.getElementById(C);if(n){var s=n.querySelector("input:checked");if(s){var r=this.getStageById(t.Text.toInteger(s.dataset.stageId));if(r){return r}}}}return this.getFirstFailStage()}}},{key:"getFailStageName",value:function e(){var t=this.getFailStages().length;if(t<=0){return null}else if(t===1){return this.getFirstFailStage().getName()}else{return this.labels.finalStagePopupFail}}}]);return e}();var y={Chart:b,Stage:s};e.StageFlow=y})(this.BX.UI=this.BX.UI||{},BX,BX.Main); //# sourceMappingURL=stageflow.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.24 |
proxy
|
phpinfo
|
Settings