File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/bizproc/install/js/bizproc/fieldtype.min.js
Back
if(!BX.getClass("BX.Bizproc.FieldType"))(function(e){"use strict";e.namespace("BX.Bizproc");var t=function(e){return e.Multiple===true};var r=function(t){if(!e.type.isArray(t)){return[t]}return t};var i=function(e){return e?e.replace(/(\s\[-?[0-9]+\])$/,""):""};var o=function(e){return e.Options?e.Options:{}};var a=function(t){let r="";if(!e.Type.isUndefined(t.Placeholder)){r=String(t.Placeholder)}return r};var n={renderControl:function(t,r,i,o,a){if(!a||a==="public"){return this.renderControlPublic(t,r,i,o)}if(a==="designer"){return this.renderControlDesigner(t,r,i,o)}return e.create("div",{text:"incorrect render mode"})},renderControlPublic:function(i,o,a,n){var c,s=this.getRenderFunctionName(o),l=true;if(e.type.isString(i)){i=i.split("@")}if(s){if(t(o)&&o.Type!=="select"){var p=[],u=this;r(n).forEach((function(e){p.push(u[s](o,a,e))}));if(p.length<=0){p.push(u[s](o,a))}c=this.wrapMultipleControls(o,a,p)}else{c=e.create("div",{children:[this[s](o,a,n)]})}}else{c=e.create("div",{text:"..."});e.ajax.post("/bitrix/tools/bizproc_get_field.php",{DocumentType:i,Field:{Field:a,Form:"sfa_form"},Value:n||"",Type:o,Als:0,rnd:Math.random(),Mode:"",Func:"",sessid:e.bitrix_sessid(),RenderMode:"public"},function(e){if(e){c.innerHTML=e;this.initControl(c,o)}}.bind(this));if(o["Type"]==="user"){l=false}}if(l&&c){this.initControl(c,o)}return c},renderControlDesigner:function(t,r,i,o){var a=e.create("div",{text:"..."});e.ajax.post("/bitrix/tools/bizproc_get_field.php",{DocumentType:t,Field:{Field:i,Form:"sfa_form"},Value:o||"",Type:r,Als:1,rnd:Math.random(),Mode:"",Func:"",sessid:e.bitrix_sessid(),RenderMode:"designer"},(function(t){if(t){a.innerHTML=t;if(typeof e.Bizproc.Selector!=="undefined"){e.Bizproc.Selector.initSelectors(a)}}}));return a},formatValuePrintable:function(t,r){var o;switch(t["Type"]){case"bool":case"UF:boolean":o=e.message(r==="Y"?"BIZPROC_JS_BP_FIELD_TYPE_YES":"BIZPROC_JS_BP_FIELD_TYPE_NO");break;case"select":case"internalselect":var a=t["Options"]||{};if(e.type.isArray(r)){o=[];r.forEach((function(e){o.push(a[e])}));o=o.join(", ")}else{o=a[r]}break;case"date":case"UF:date":case"datetime":o=i(r);break;case"text":case"int":case"double":case"string":o=r;break;case"user":o=[];var n,c,s,l,p=e.Type.isArray(r)?r:r.split(",");for(n=0;n<p.length;++n){s=e.util.trim(p[n]);if(l=s.match(/(.*)\[([A-Z]{0,2}\d+)\]/)){c=e.util.trim(l[1]);o.push(c)}else{o.push(s)}}o=o.join(", ");break;default:if(e.type.isString(r)){o=r}else{o="(?)"}break}return o},getRenderFunctionName:function(e){var t;switch(e["Type"]){case"B":case"bool":case"UF:boolean":t="createBoolNode";break;case"date":case"UF:date":case"datetime":case"S:Date":case"S:DateTime":t="createDateNode";break;case"L":case"select":case"internalselect":t="createSelectNode";break;case"T":case"text":t="createTextNode";break;case"N":case"int":case"double":t="createNumericNode";break;case"S":case"string":t="createStringNode";break;case"F":case"file":t="createFileNode";break}return t},wrapMultipleControls:function(t,r,i){var o=e.create("div",{children:i});var a=e.create("a",{attrs:{className:"bizproc-type-control-clone-btn"},text:e.message("BIZPROC_JS_BP_FIELD_TYPE_ADD"),events:{click:function(e){e.preventDefault();n.cloneControl(t,r,this.parentNode)}}});o.appendChild(e.create("div",{children:[a]}));return o},cloneControl:function(t,r,i){var o=this.getRenderFunctionName(t);if(o){var a=this[o](t,r);if(a&&i.parentNode){var n=e.create("div",{children:[a]});this.initControl(n,t);i.parentNode.insertBefore(n,i)}}},createControlOptions:function(t,r){var i=o(t);var a="";for(var n in i){if(String(n)!==String(i[n])){a+="["+n+"]"+i[n]}else{a+=i[n]}a+="\n"}var c=e.util.getRandomString(3);var s=e.create("textarea",{attrs:{id:"bizproc_fieldtype_select_form_options_"+c}});s.innerHTML=e.util.htmlspecialchars(a);var l=this;var p=e.create("button",{attrs:{type:"button"},text:e.Loc.getMessage("BIZPROC_JS_BP_FIELD_TYPE_SELECT_OPTIONS3"),events:{click:function(){r(l.parseSelectFormOptions(c))}}});var u=e.create("div");u.appendChild(s);u.appendChild(e.create("br"));u.innerHTML+=e.Loc.getMessage("BIZPROC_JS_BP_FIELD_TYPE_SELECT_OPTIONS1");u.appendChild(e.create("br"));u.innerHTML+=e.Loc.getMessage("BIZPROC_JS_BP_FIELD_TYPE_SELECT_OPTIONS2");u.appendChild(e.create("br"));u.appendChild(p);return u},parseSelectFormOptions:function(t){var r={};var i=document.getElementById("bizproc_fieldtype_select_form_options_"+t).value;if(!i){return r}var o=i.split(/[\r\n]+/);var a=/\[([^\]]+)].+/;for(var n in o){var c=e.util.trim(o[n]);if(c.length>0){var s=c.match(a);if(s){var l=c.indexOf("]");r[s[1]]=c.substr(l+1)}else{r[c]=c}}}return r},createBoolNode:function(r,i,o){var a=e.message("BIZPROC_JS_BP_FIELD_TYPE_YES");var n=e.message("BIZPROC_JS_BP_FIELD_TYPE_NO");a=a.charAt(0).toUpperCase()+a.slice(1);n=n.charAt(0).toUpperCase()+n.slice(1);var c=e.create("select",{attrs:{className:"bizproc-type-control bizproc-type-control-bool"+(t(r)?" bizproc-type-control-multiple":"")},props:{name:i+(t(r)?"[]":"")},children:[e.create("option",{props:{value:""},text:e.message("BIZPROC_JS_BP_FIELD_TYPE_NOT_SELECTED")})]});var s=e.create("option",{props:{value:"Y"},text:a});if(o==="Y"||o===1||o==="1"){s.setAttribute("selected","selected")}var l=e.create("option",{props:{value:"N"},text:n});if(o==="N"||o===0||o==="0"){l.setAttribute("selected","selected")}c.appendChild(s);c.appendChild(l);return c},createDateNode:function(r,o,n){var c=r["Type"];if(c==="UF:date"||c==="S:Date"){c="date"}if(c==="S:DateTime"){c="datetime"}var s=e.create("input",{attrs:{className:"bizproc-type-control bizproc-type-control-"+c+(t(r)?" bizproc-type-control-multiple":""),"data-role":"inline-selector-target","data-selector-type":c,placeholder:a(r)},props:{type:"text",name:o+(t(r)?"[]":""),value:i(n)}});var l=e.Bizproc.Automation&&e.Bizproc.Automation.Designer.getRobotSettingsDialog();if(!l){var p=e.create("img",{attrs:{src:"/bitrix/js/main/core/images/calendar-icon.gif",className:"calendar-icon",border:"0"},events:{click:function(t){t.preventDefault();e.calendar({node:this,field:s,bTime:c==="datetime",bHideTime:c==="date"})}}});var u;if(r["Settings"]&&r["Settings"]["timezones"]){u=e.create("select",{props:{name:"tz_"+(o+(t(r)?"[]":""))},attrs:{className:"bizproc-type-control-date-lc"}});r["Settings"]["timezones"].forEach((function(t){var r=e.create("option",{props:{value:t.value},text:t.text});if(t.value==="current"){r.setAttribute("selected","selected")}u.appendChild(r)}))}return e.create("div",{children:[s,p,u]})}return s},createNumericNode:function(r,i,o){return e.create("input",{attrs:{className:"bizproc-type-control bizproc-type-control-int"+(t(r)?" bizproc-type-control-multiple":""),"data-role":"inline-selector-target",placeholder:a(r)},props:{type:"text",name:i+(t(r)?"[]":""),value:o||""}})},createStringNode:function(r,i,o){return e.create("input",{attrs:{className:"bizproc-type-control bizproc-type-control-string"+(t(r)?" bizproc-type-control-multiple":""),"data-role":"inline-selector-target",placeholder:a(r)},props:{type:"text",name:i+(t(r)?"[]":""),value:o||""}})},createFileNode:function(r,i,o){var a=e.Bizproc.Automation&&e.Bizproc.Automation.Designer.getRobotSettingsDialog();if(!a){var n=e.create("input",{props:{type:"file",name:i+(t(r)?"[]":""),value:o||""},events:{change:function(){this.nextSibling.textContent=e.Bizproc.FieldType.File.parseLabel(this.value)}}});var c=e.create("span",{children:[e.create("span",{attrs:{className:"webform-small-button"},text:e.message("BIZPROC_JS_BP_FIELD_TYPE_CHOOSE_FILE")})]});return e.create("div",{children:[c,n,e.create("span",{attrs:{className:"bizproc-type-control-file-label"}})],attrs:{className:"bizproc-type-control bizproc-type-control-file"+(t(r)?" bizproc-type-control-multiple":"")}})}return e.create("input",{attrs:{className:"bizproc-type-control bizproc-type-control-file-selectable"+(t(r)?" bizproc-type-control-multiple":""),"data-role":"inline-selector-target","data-selector-type":"file"},props:{type:"text",name:i+(t(r)?"[]":""),value:o||""}})},createTextNode:function(r,i,o){return e.create("textarea",{attrs:{className:"bizproc-type-control bizproc-type-control-text"+(t(r)?" bizproc-type-control-multiple":""),"data-role":"inline-selector-target",rows:5,cols:40,placeholder:a(r)},props:{name:i+(t(r)?"[]":""),value:o||""}})},createSelectNode:function(r,i,o){var a=function(t,r){if(!t||!r){return false}if(e.type.isArray(r)){return e.util.in_array(t,r)}return t.toString()===r.toString()};var n,c=e.create("select",{attrs:{className:"bizproc-type-control bizproc-type-control-select"+(t(r)?" bizproc-type-control-multiple":"")},props:{name:i+(t(r)?"[]":"")}});var s=function(){return e.create("option",{props:{value:""},text:e.message("BIZPROC_JS_BP_FIELD_TYPE_NOT_SELECTED")})};if(t(r)){c.setAttribute("multiple","multiple");c.setAttribute("size","5")}n=s();if(e.Type.isNil(o)||o.length===0){n.setAttribute("selected","selected")}c.appendChild(n);if(e.type.isPlainObject(r["Options"])){for(var l in r["Options"]){if(!r["Options"].hasOwnProperty(l)){continue}n=e.create("option",{props:{value:l},text:e.Text.decode(r["Options"][l])});if(a(l,o)){n.setAttribute("selected","selected")}c.appendChild(n)}}else if(e.type.isArray(r["Options"])){for(var p=0;p<r["Options"].length;++p){n=e.create("option",{props:{value:p},text:e.Text.decode(r["Options"][p])});if(a(p,o)){n.setAttribute("selected","selected")}c.appendChild(n)}}return c},initControl:function(t,r){var i;if(i=e.Bizproc.Automation&&e.Bizproc.Automation.Designer.getRobotSettingsDialog()){i.template.initRobotSettingsControls(i.robot,t)}else if(i=e.Bizproc.Automation&&e.Bizproc.Automation.Designer.getTriggerSettingsDialog()){i.component.triggerManager.initSettingsDialogControls(t)}else if(r&&r["Type"]==="user"&&e.Bizproc.UserSelector){e.Bizproc.UserSelector.decorateNode(t.querySelector('[data-role="user-selector"]'))}},getDocumentFields:function(){const t=e.Bizproc.Automation&&e.Bizproc.Automation.Designer.component;if(t){return t.data["DOCUMENT_FIELDS"]}if(e.Bizproc.Automation&&e.Bizproc.Automation.API.documentFields){return e.Bizproc.Automation.API.documentFields}return[]},getDocumentUserGroups:function(){if(e.Bizproc.Automation&&e.Bizproc.Automation.API.documentUserGroups){return e.Bizproc.Automation.API.documentUserGroups}return[]}};n.File={parseLabel:function(e){var t;if(e.lastIndexOf("\\")){t=e.lastIndexOf("\\")+1}else{t=e.lastIndexOf("/")+1}return e.slice(t)}};e.Bizproc.FieldType=n})(window.BX||window.top.BX); //# sourceMappingURL=fieldtype.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings