widget-crm-form
Advanced tools
Comparing version 5.1.17 to 5.1.18
@@ -1,1 +0,1 @@ | ||
"use strict";(self.webpackChunkwidget_crm_form=self.webpackChunkwidget_crm_form||[]).push([[621],{7621:function(t,e,n){var i,o,c;n.r(e),o=new CustomEvent("cs"),document.addEventListener("scroll",(function(t){var e=t.target;window.clearTimeout(i),i=setTimeout((function(){e.dispatchEvent(o)}),10)})),function(){var t,e=new CustomEvent("cr");window.addEventListener("resize",(function(n){var i=n.target;clearTimeout(t),t=setTimeout((function(){i.dispatchEvent(e)}),300)}))}(),function(t){(document.querySelectorAll("[data-form-id]").length||document.querySelectorAll("[data-form-items]").length||document.querySelectorAll("[data-reviews]").length)&&n.e(507).then(n.bind(n,7507)).then((function(t){t.init()})),t.crmFormsPopupSelect=function(t){n.e(507).then(n.bind(n,7507)).then((function(e){e.init(),e.default.initPopupSelect(t)}))},t.crmFormsPopup=function(t){n.e(507).then(n.bind(n,7507)).then((function(e){e.init(),e.default.initPopup(t)}))},t.crmFormsStatic=function(t,e){n.e(507).then(n.bind(n,7507)).then((function(n){n.init(),n.default.initFormComponent(t,e,"static")}))},t.addFonts="back-office"===window.EpicentrK.project?function(){var t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap",document.head.appendChild(t)}:function(){console.warn("Метод недоступний addFonts для проекту EpicentrK")}}(c||(c={})),window.EpicentrK=Object.assign(window.EpicentrK,c)}}]); | ||
"use strict";(self.webpackChunkwidget_crm_form=self.webpackChunkwidget_crm_form||[]).push([[621],{7621:function(t,e,n){var i,o,c;n.r(e),o=new CustomEvent("cs"),document.addEventListener("scroll",(function(t){var e=t.target;window.clearTimeout(i),i=setTimeout((function(){e.dispatchEvent(o)}),10)})),function(){var t,e=new CustomEvent("cr");window.addEventListener("resize",(function(n){var i=n.target;clearTimeout(t),t=setTimeout((function(){i.dispatchEvent(e)}),300)}))}(),function(t){(document.querySelectorAll("[data-form-id]").length||document.querySelectorAll("[data-form-items]").length||document.querySelectorAll("[data-reviews]").length)&&n.e(830).then(n.bind(n,5830)).then((function(t){t.init()})),t.crmFormsPopupSelect=function(t){n.e(830).then(n.bind(n,5830)).then((function(e){e.init(),e.default.initPopupSelect(t)}))},t.crmFormsPopup=function(t){n.e(830).then(n.bind(n,5830)).then((function(e){e.init(),e.default.initPopup(t)}))},t.crmFormsStatic=function(t,e){n.e(830).then(n.bind(n,5830)).then((function(n){n.init(),n.default.initFormComponent(t,e,"static")}))},t.addFonts="back-office"===window.EpicentrK.project?function(){var t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap",document.head.appendChild(t)}:function(){console.warn("Метод недоступний addFonts для проекту EpicentrK")}}(c||(c={})),window.EpicentrK=Object.assign(window.EpicentrK,c)}}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";(self.webpackChunkwidget_crm_form=self.webpackChunkwidget_crm_form||[]).push([[687],{6687:function(e,t,s){s.r(t),s.d(t,{default:function(){return x}});var r=function(){var e=this;return(0,e._self._c)("crm-form-nuxt",{class:e.$style.crm,attrs:{id:e.id,items:e.items,type:e.type}})};r._withStripped=!0;var i=function(){var e=this,t=e._self._c;return"select"===e.type&&e.popup?t("ui-popup",{class:[e.$style.crm,e.$style.popup],attrs:{crm:!0,body:!0},on:{close:function(t){return e.$emit("close")}}},[e.isPopupSelected?t("div",[t("span",{class:e.$style.back,on:{click:e.btnBackClick}},[e._v("Назад")]),t("crm-form",{key:e.selectedPopupId,class:[e.$style.form,e.$style.pt],attrs:{id:e.selectedPopupId},on:{close:function(t){return e.$emit("close")}}})],1):t("crm-form-subject",{class:e.$style.form,attrs:{items:e.items},on:{input:e.update}})],1):"popup"===e.type&&e.popup?t("ui-popup",{class:[e.$style.crm,e.$style.popup],attrs:{crm:!0,body:!0},on:{close:function(t){return e.$emit("close")}}},[t("crm-form",{key:e.$i18n.locale,class:e.$style.form,attrs:{id:e.id},on:{close:function(t){return e.$emit("close")}}})],1):"static"===e.type?t("div",{class:e.$style.crm},[t("crm-form",{key:e.$i18n.locale,class:e.$style.form,attrs:{id:e.id}})],1):e._e()};i._withStripped=!0;var l={props:{id:Number,items:Array,type:String},data:()=>({popup:!0,selectedPopupId:null}),computed:{isPopupSelected(){return Boolean(this.selectedPopupId)}},methods:{update(e){this.selectedPopupId=e.id},btnBackClick(){this.selectedPopupId=null}}},a={back:"epicentrk_iJRJ",form:"epicentrk_TvBV",crm:"epicentrk_tXrm",popup:"epicentrk_Dajs",pt:"epicentrk_duvo"},n=s(1900);var o,c=(0,n.Z)(l,i,[],!1,(function(e){this.$style=a.locals||a}),null,null).exports,u=function(){var e=this,t=e._self._c;return e.fields?t("div",{class:e.$style.form},[t("transition",{attrs:{name:"fade"}},[e.success?t("div",{class:e.$style.thank},[t("div",{class:e.$style.thank__title},[e._v(e._s(e.$t("messages.thank")))]),e.thank?t("div",{class:e.$style.thank__message},[e._v(e._s(e.thank))]):e._e(),t("ui-button",{class:e.$style.btn,nativeOn:{click:function(t){return e.close.apply(null,arguments)}}},[e._v(e._s(e.$t("button.close")))])],1):e._e()]),t("transition",{attrs:{name:"fade"}},[e.error?t("div",{class:e.$style.error},[t("div",{class:e.$style.error__title},[e._v(e._s(e.$t("messages.error")))]),t("div",{class:e.$style.thank__message},[e._v(e._s(e.error))]),t("ui-button",{class:e.$style.btn,attrs:{type:"red"},nativeOn:{click:function(t){return e.close.apply(null,arguments)}}},[e._v(e._s(e.$t("button.close")))])],1):e._e()]),t("transition",{attrs:{name:"fade"}},[e.load?t("ui-loader"):e._e()],1),e.title?t("header",{class:e.$style.form__title},[e._v(e._s(e.title))]):e._e(),t("div",{class:e.$style.form__list},e._l([...e.fields],(function(s,r){return t("div",{class:e.$style.form__item},[s.title?t("header",{class:e.$style.form__label},[e._v(e._s(s.title))]):e._e(),t(s.component,{key:r,tag:"component",attrs:{params:s},on:{input:function(e){s.error=null},list:function(t){return e.setList(t,s)},upload:function(t){return e.setFile(t,s)},delete:function(t){return e.deleteFile(t,s)},"clear-list":function(e){s.request.offset=0},request:function(e){s.request.offset+=s.request.limit}},model:{value:s.value,callback:function(t){e.$set(s,"value",t)},expression:"item.value"}},["checkbox"===s.type?t("span",[e._v(e._s(e.$t("privacy.text"))),t("a",{class:e.$style.link,attrs:{href:e.termsLink||`https://epicentrk.ua${e.$localeUrl("/info/terms-of-use/")}`,target:"_blank",title:e.$t("privacy.title")}},[e._v(e._s(e.$t("privacy.link")))])]):e._e()])],1)})),0),t("ui-button",{class:[e.$style.form__send,e.disabled&&e.$style.disabled],attrs:{disabled:e.load,type:e.disabled?"disabled":"blue"},nativeOn:{click:function(t){e.$forms().send(e.fields,e.send)}}},[e._v(e._s(e.$t("button.send")))])],1):e._e()};u._withStripped=!0;var p={ua:"Ваше ім'я",ru:"Ваше имя"};try{if("admin.epicentrm.com.ua"===(null===(o=null===window||void 0===window?void 0:window.location)||void 0===o?void 0:o.host))p={ua:"Ваша компанія",ru:"Ваша компания"};else p={ua:"Ваше ім'я",ru:"Ваше имя"}}catch(e){p={ua:"Ваше ім'я",ru:"Ваше имя"}}var d=function(){this.contacts=[{code:"name",label:p,component:"ui-form-input-animate",crmType:"contact",type:"text",error:null,value:"",regex:["empty"]},{code:"phone",label:{ua:"Ваш номер телефону",ru:"Ваш номер телефона"},component:"ui-form-input-animate",crmType:"contact",type:"tel",mask:"+380#########",error:null,value:"",regex:["tel","empty"]},{code:"email",label:{ua:"Ваш Email",ru:"Ваш Email"},component:"ui-form-input-animate",crmType:"contact",type:"email",error:null,value:"",regex:["email"]}],this.footer=[{type:"checkbox",component:"ui-form-checkbox",error:null,value:!1,regex:["check"]}],this.line={placeholder:{ua:"Введіть, будь ласка, інформацію",ru:"Введіть, будь ласка, інформацію"},component:"ui-form-input",type:"text",error:null,value:""},this.str={placeholder:{ua:"Введіть, будь ласка, інформацію",ru:"Введіть, будь ласка, інформацію"},component:"ui-form-input",type:"textarea",error:null,value:""},this.boolean={component:"ui-form-radio",error:null,value:"",grid:"row",items:[{label:{ua:"ні",ru:"нет"},value:0},{label:{ua:"так",ru:"да"},value:1}]},this.rating3={component:"ui-form-impression",error:null,items:[{label:{ua:"Погано, не сподобалось",ru:"Плохо, не понравилось"},icon:"emoji-1",value:1},{label:{ua:"Так собі, можна і краще",ru:"Так себе, можно и лучше"},icon:"emoji-2",value:2},{label:{ua:"Чудово, все сподобалось",ru:"Прекрасно, все понравилось"},icon:"emoji-3",value:3}],value:""},this.rating3a={component:"ui-form-impression",error:null,items:[{label:{ua:"Дуже складно та вкрай не зручно",ru:"Очень сложно и очень не удобно"},icon:"emoji-1",value:1},{label:{ua:"Так собі, можна і краще",ru:"Так себе, можно и лучше"},icon:"emoji-4",value:2},{label:{ua:"Дуже просто і зручно",ru:"Очень просто и удобно"},icon:"emoji-5",value:3}],value:""},this.rating5={component:"ui-form-rating",error:null,value:""},this.rating10={component:"ui-form-assessment",error:null,value:""},this.list={placeholder:{ua:"Зробіть вибір",ru:"Сделайте выбор"},component:"ui-form-select",error:null,value:"",search:{value:"",component:"ui-form-input",type:"search",placeholder:{ua:"Пошук",ru:"Поиск"}}},this.file={label:{file:{ua:"Додати файл",ru:"Добавить файл"},files:{ua:"Додати файли",ru:"Добавить файлы"}},component:"ui-form-upload",error:null,value:"",size:83886080,loadFiles:[],regex:["upload"],types:["image","pdf","doc","sheet"]}};const m=axios.create({method:"post",baseURL:"https://crm.epicentrk.ua/local/modules/crmgenesis.omnis/api/epicentrk/questionnaire",headers:{Authorization:"Bearer N0NZF0WUTKbthP4iv93XLkFXDu9MUOz9y8wkkFmo","Content-Type":"application/json; charset=UTF-8"}}),_=[];var f={props:{id:Number,contacts:Array,termsLink:String},data:()=>({load:!1,success:!1,error:null}),computed:{...mapGetters({forms:"crm/forms"}),fields(){return this.forms[this.id]?.fields},title(){return this.forms[this.id]?.title},thank(){return this.forms[this.id]?.thank},disabled(){return!this.$forms().validate(this.fields)}},created(){this.fields?.length||(this.load=!0,this.get())},methods:{...mapMutations({setForm:"crm/setForm"}),clear(){for(const e in this.fields)switch(this.fields[e].crmType){case"contact":break;case"upload":this.fields[e].loadFiles=[];break;default:this.fields[e].value=""}},async send(){const e=new FormData;this.load=!0,e.append("id",this.id);for(const t of this.fields)if(t.crmType)switch(t.crmType){case"upload":for(const s in t.loadFiles)e.append(t.files[s].code,t.loadFiles[s].value);break;case"list":t.value&&e.append(t.code,t.value.id);break;default:t.value&&e.append(t.code,"string"==typeof t.value?encodeURI(t.value).trim():t.value)}try{const{data:t}=await m({url:"/set.php",data:e,headers:{"Content-Type":"application/x-www-form-urlencoded"}});if(t.error)return this.error=this.$lang("попробуйте позже{lang}спробуйте пізніше"),this.load=!1,void(this.success=!0);this.success=!0,this.load=!1,this.clear()}catch(e){this.$sentry.captureException(e),this.error=this.$lang("попробуйте позже{lang}спробуйте пізніше"),this.load=!1,this.success=!0}},async get(){try{const{data:e}=await m({url:"/get.php",data:{id:this.id,lang:this.$i18n.locale}}),t=[],s=[..._];this.load=!1;for(const r of e.result.questionList){r.code=`answerList[${r.id}]`;const e={parent:`parent_${this._uid}_${r.id}`,title:r.name,id:r.id,crmType:r.type,code:r.code};switch(r.type){case"str":case"line":default:break;case"list":e.request={id:r.idList,lang:this.$i18n.locale,offset:0,limit:50}}"file"!==r.type&&(new d)[r.type]?(r.answerRequired&&(e.regex=["empty"]),t.push({...e,...(new d)[r.type]})):s.push(r)}if(s.length){s.sort(((e,t)=>e.answerRequired<t.answerRequired?1:-1));const e={min:0,max:0};for(const t of s)e.files=e.files||[],e.files.push(t),e.max++,t.answerRequired&&e.min++;t.push({crmType:"upload",title:e.files[0].name,...e,...(new d).file})}this.setForm({id:this.id,title:e.result.geetingMessage,thank:e.result.thankMessage,fields:[...this.contacts||(new d).contacts,...t,...(new d).footer]})}catch(e){this.$sentry.captureException(e)}},async setList(e,t){try{if(e.clear)return void(t.items=[]);const s=e.search,{data:r}=await m({url:"/getList.php",data:{search:s,...t.request}});if(r.error)return void(t.blockedLoad=!0);t.items=e.search?r.result:[...t.items||[],...r.result],!("autocomplete"in t)&&t.items.length>20&&(t.autocomplete=!0),e.cb()}catch(e){this.$sentry.captureException(e)}},setFile(e,t){t.loadFiles.push(e)},deleteFile(e,t){t.loadFiles.splice(e,1)},close(){this.error=null,this.success=!1,this.$emit("close")}}},h={form:"epicentrk__Yzc",form__title:"epicentrk_akIL",form__list:"epicentrk_yxdf",form__item:"epicentrk_jxNY",form__send:"epicentrk_moKR",disabled:"epicentrk_Tt_z",link:"epicentrk_QS6o",form__label:"epicentrk_zp4y",error:"epicentrk_YeYp",thank:"epicentrk_EeKN",error__title:"epicentrk_Y_fb",thank__title:"epicentrk__WlD",error__message:"epicentrk__dKB",thank__message:"epicentrk_eOqT",btn:"epicentrk_xojd"};var v=(0,n.Z)(f,u,[],!1,(function(e){this.$style=h.locals||h}),null,null).exports,y=function(){var e=this,t=e._self._c;return t("div",{class:e.$style.subject},[t("header",{class:e.$style.subject__title},[e._v("Зворотній зв'язок")]),t("div",{class:e.$style.subject__wrapper},[t("h3",{class:e.$style.subject__subtitle},[e._v("Інфоцентр")]),t("p",{class:e.$style.subject__label},[e._v("Тут можна знайти відповіді на найпоширеніші запитання")]),t("ui-button",{class:e.$style.btn,attrs:{tag:"a",href:e.link}},[e._v("Перейти в інфоцентр")])],1),t("div",{class:e.$style.subject__wrapper},[t("h3",{class:e.$style.subject__subtitle},[e._v("Служба підтримки")]),t("p",{class:e.$style.subject__label},[e._v("Оберіть тематику звернення")]),t("ui-form-select",{attrs:{params:e.select},on:{input:function(t){return e.$emit("input",t)}},model:{value:e.select.value,callback:function(t){e.$set(e.select,"value",t)},expression:"select.value"}})],1)])};y._withStripped=!0;var k={props:{items:Array},data(){return{select:{placeholder:{ua:"Зробіть вибір",ru:"Сделайте выбор"},search:{value:""},error:null,value:"",items:this.items}}},computed:{link:()=>"admin.epicentrm.com.ua"===location.host?"https://supportm.epicentrk.ua/":"/ua/faq/"}},b={subject:"epicentrk_MdYK",subject__title:"epicentrk_lvrd",subject__wrapper:"epicentrk_VdjI",subject__subtitle:"epicentrk_zK5K",subject__label:"epicentrk_ezOs",btn:"epicentrk_CjqP"};var $=(0,n.Z)(k,y,[],!1,(function(e){this.$style=b.locals||b}),null,null).exports;Vue.component("CrmFormSubject",$),Vue.component("CrmForm",v);var g={components:{crmFormNuxt:c},props:{id:[Number,Array],items:Array,type:String}},w={form:"epicentrk_cavJ",crm:"epicentrk_hKb5",popup:"epicentrk_mPmh",pt:"epicentrk_KnAa","focus-visible":"epicentrk_aVgC"};var x=(0,n.Z)(g,r,[],!1,(function(e){this.$style=w.locals||w}),null,null).exports}}]); | ||
"use strict";(self.webpackChunkwidget_crm_form=self.webpackChunkwidget_crm_form||[]).push([[687],{6687:function(e,t,s){s.r(t),s.d(t,{default:function(){return w}});var r=function(){var e=this;return(0,e._self._c)("crm-form-nuxt",{class:e.$style.crm,attrs:{id:e.id,items:e.items,type:e.type}})};r._withStripped=!0;var n=function(){var e=this,t=e._self._c;return"select"===e.type&&e.popup?t("ui-popup",{class:[e.$style.crm,e.$style.popup],attrs:{crm:!0,body:!0},on:{close:function(t){return e.$emit("close")}}},[e.isPopupSelected?t("div",[t("span",{class:e.$style.back,on:{click:e.btnBackClick}},[e._v("Назад")]),t("crm-form",{key:e.selectedPopupId,class:[e.$style.form,e.$style.pt],attrs:{id:e.selectedPopupId},on:{close:function(t){return e.$emit("close")}}})],1):t("crm-form-subject",{class:e.$style.form,attrs:{items:e.items},on:{input:e.update}})],1):"popup"===e.type&&e.popup?t("ui-popup",{class:[e.$style.crm,e.$style.popup],attrs:{crm:!0,body:!0},on:{close:function(t){return e.$emit("close")}}},[t("crm-form",{key:e.$i18n.locale,class:e.$style.form,attrs:{id:e.id},on:{close:function(t){return e.$emit("close")}}})],1):"static"===e.type?t("div",{class:e.$style.crm},[t("crm-form",{key:e.$i18n.locale,class:e.$style.form,attrs:{id:e.id}})],1):e._e()};n._withStripped=!0;var i={props:{id:Number,items:Array,type:String},data:()=>({popup:!0,selectedPopupId:null}),computed:{isPopupSelected(){return Boolean(this.selectedPopupId)}},methods:{update(e){this.selectedPopupId=e.id},btnBackClick(){this.selectedPopupId=null}}},o={back:"epicentr-nuxt-components-crm-index__back",form:"epicentr-nuxt-components-crm-index__form",crm:"epicentr-nuxt-components-crm-index__crm",popup:"epicentr-nuxt-components-crm-index__popup",pt:"epicentr-nuxt-components-crm-index__pt"},l=s(1900);var c,a=(0,l.Z)(i,n,[],!1,(function(e){this.$style=o.locals||o}),null,null).exports,u=function(){var e=this,t=e._self._c;return e.fields?t("div",{class:e.$style.form},[t("transition",{attrs:{name:"fade"}},[e.success?t("div",{class:e.$style.thank},[t("div",{class:e.$style.thank__title},[e._v(e._s(e.$t("messages.thank")))]),e.thank?t("div",{class:e.$style.thank__message},[e._v(e._s(e.thank))]):e._e(),t("ui-button",{class:e.$style.btn,nativeOn:{click:function(t){return e.close.apply(null,arguments)}}},[e._v(e._s(e.$t("button.close")))])],1):e._e()]),t("transition",{attrs:{name:"fade"}},[e.error?t("div",{class:e.$style.error},[t("div",{class:e.$style.error__title},[e._v(e._s(e.$t("messages.error")))]),t("div",{class:e.$style.thank__message},[e._v(e._s(e.error))]),t("ui-button",{class:e.$style.btn,attrs:{type:"red"},nativeOn:{click:function(t){return e.close.apply(null,arguments)}}},[e._v(e._s(e.$t("button.close")))])],1):e._e()]),t("transition",{attrs:{name:"fade"}},[e.load?t("ui-loader"):e._e()],1),e.title?t("header",{class:e.$style.form__title},[e._v(e._s(e.title))]):e._e(),t("div",{class:e.$style.form__list},e._l([...e.fields],(function(s,r){return t("div",{class:e.$style.form__item},[s.title?t("header",{class:e.$style.form__label},[e._v(e._s(s.title))]):e._e(),t(s.component,{key:r,tag:"component",attrs:{params:s},on:{input:function(e){s.error=null},list:function(t){return e.setList(t,s)},upload:function(t){return e.setFile(t,s)},delete:function(t){return e.deleteFile(t,s)},"clear-list":function(e){s.request.offset=0},request:function(e){s.request.offset+=s.request.limit}},model:{value:s.value,callback:function(t){e.$set(s,"value",t)},expression:"item.value"}},["checkbox"===s.type?t("span",[e._v(e._s(e.$t("privacy.text"))),t("a",{class:e.$style.link,attrs:{href:e.termsLink||`https://epicentrk.ua${e.$localeUrl("/info/terms-of-use/")}`,target:"_blank",title:e.$t("privacy.title")}},[e._v(e._s(e.$t("privacy.link")))])]):e._e()])],1)})),0),t("ui-button",{class:[e.$style.form__send,e.disabled&&e.$style.disabled],attrs:{disabled:e.load,type:e.disabled?"disabled":"blue"},nativeOn:{click:function(t){e.$forms().send(e.fields,e.send)}}},[e._v(e._s(e.$t("button.send")))])],1):e._e()};u._withStripped=!0;var p={ua:"Ваше ім'я",ru:"Ваше имя"};try{if("admin.epicentrm.com.ua"===(null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.host))p={ua:"Ваша компанія",ru:"Ваша компания"};else p={ua:"Ваше ім'я",ru:"Ваше имя"}}catch(e){p={ua:"Ваше ім'я",ru:"Ваше имя"}}var m=function(){this.contacts=[{code:"name",label:p,component:"ui-form-input-animate",crmType:"contact",type:"text",error:null,value:"",regex:["empty"]},{code:"phone",label:{ua:"Ваш номер телефону",ru:"Ваш номер телефона"},component:"ui-form-input-animate",crmType:"contact",type:"tel",mask:"+380#########",error:null,value:"",regex:["tel","empty"]},{code:"email",label:{ua:"Ваш Email",ru:"Ваш Email"},component:"ui-form-input-animate",crmType:"contact",type:"email",error:null,value:"",regex:["email"]}],this.footer=[{type:"checkbox",component:"ui-form-checkbox",error:null,value:!1,regex:["check"]}],this.line={placeholder:{ua:"Введіть, будь ласка, інформацію",ru:"Введіть, будь ласка, інформацію"},component:"ui-form-input",type:"text",error:null,value:""},this.str={placeholder:{ua:"Введіть, будь ласка, інформацію",ru:"Введіть, будь ласка, інформацію"},component:"ui-form-input",type:"textarea",error:null,value:""},this.boolean={component:"ui-form-radio",error:null,value:"",grid:"row",items:[{label:{ua:"ні",ru:"нет"},value:0},{label:{ua:"так",ru:"да"},value:1}]},this.rating3={component:"ui-form-impression",error:null,items:[{label:{ua:"Погано, не сподобалось",ru:"Плохо, не понравилось"},icon:"emoji-1",value:1},{label:{ua:"Так собі, можна і краще",ru:"Так себе, можно и лучше"},icon:"emoji-2",value:2},{label:{ua:"Чудово, все сподобалось",ru:"Прекрасно, все понравилось"},icon:"emoji-3",value:3}],value:""},this.rating3a={component:"ui-form-impression",error:null,items:[{label:{ua:"Дуже складно та вкрай не зручно",ru:"Очень сложно и очень не удобно"},icon:"emoji-1",value:1},{label:{ua:"Так собі, можна і краще",ru:"Так себе, можно и лучше"},icon:"emoji-4",value:2},{label:{ua:"Дуже просто і зручно",ru:"Очень просто и удобно"},icon:"emoji-5",value:3}],value:""},this.rating5={component:"ui-form-rating",error:null,value:""},this.rating10={component:"ui-form-assessment",error:null,value:""},this.list={placeholder:{ua:"Зробіть вибір",ru:"Сделайте выбор"},component:"ui-form-select",error:null,value:"",search:{value:"",component:"ui-form-input",type:"search",placeholder:{ua:"Пошук",ru:"Поиск"}}},this.file={label:{file:{ua:"Додати файл",ru:"Добавить файл"},files:{ua:"Додати файли",ru:"Добавить файлы"}},component:"ui-form-upload",error:null,value:"",size:83886080,loadFiles:[],regex:["upload"],types:["image","pdf","doc","sheet"]}};const d=axios.create({method:"post",baseURL:"https://crm.epicentrk.ua/local/modules/crmgenesis.omnis/api/epicentrk/questionnaire",headers:{Authorization:"Bearer N0NZF0WUTKbthP4iv93XLkFXDu9MUOz9y8wkkFmo","Content-Type":"application/json; charset=UTF-8"}}),_=[];var f={props:{id:Number,contacts:Array,termsLink:String},data:()=>({load:!1,success:!1,error:null}),computed:{...mapGetters({forms:"crm/forms"}),fields(){return this.forms[this.id]?.fields},title(){return this.forms[this.id]?.title},thank(){return this.forms[this.id]?.thank},disabled(){return!this.$forms().validate(this.fields)}},created(){this.fields?.length||(this.load=!0,this.get())},methods:{...mapMutations({setForm:"crm/setForm"}),clear(){for(const e in this.fields)switch(this.fields[e].crmType){case"contact":break;case"upload":this.fields[e].loadFiles=[];break;default:this.fields[e].value=""}},async send(){const e=new FormData;this.load=!0,e.append("id",this.id);for(const t of this.fields)if(t.crmType)switch(t.crmType){case"upload":for(const s in t.loadFiles)e.append(t.files[s].code,t.loadFiles[s].value);break;case"list":t.value&&e.append(t.code,t.value.id);break;default:t.value&&e.append(t.code,"string"==typeof t.value?encodeURI(t.value).trim():t.value)}try{const{data:t}=await d({url:"/set.php",data:e,headers:{"Content-Type":"application/x-www-form-urlencoded"}});if(t.error)return this.error=this.$lang("попробуйте позже{lang}спробуйте пізніше"),this.load=!1,void(this.success=!0);this.success=!0,this.load=!1,this.clear()}catch(e){this.$sentry.captureException(e),this.error=this.$lang("попробуйте позже{lang}спробуйте пізніше"),this.load=!1,this.success=!0}},async get(){try{const{data:e}=await d({url:"/get.php",data:{id:this.id,lang:this.$i18n.locale}}),t=[],s=[..._];this.load=!1;for(const r of e.result.questionList){r.code=`answerList[${r.id}]`;const e={parent:`parent_${this._uid}_${r.id}`,title:r.name,id:r.id,crmType:r.type,code:r.code};switch(r.type){case"str":case"line":default:break;case"list":e.request={id:r.idList,lang:this.$i18n.locale,offset:0,limit:50}}"file"!==r.type&&(new m)[r.type]?(r.answerRequired&&(e.regex=["empty"]),t.push({...e,...(new m)[r.type]})):s.push(r)}if(s.length){s.sort(((e,t)=>e.answerRequired<t.answerRequired?1:-1));const e={min:0,max:0};for(const t of s)e.files=e.files||[],e.files.push(t),e.max++,t.answerRequired&&e.min++;t.push({crmType:"upload",title:e.files[0].name,...e,...(new m).file})}this.setForm({id:this.id,title:e.result.geetingMessage,thank:e.result.thankMessage,fields:[...this.contacts||(new m).contacts,...t,...(new m).footer]})}catch(e){this.$sentry.captureException(e)}},async setList(e,t){try{if(e.clear)return void(t.items=[]);const s=e.search,{data:r}=await d({url:"/getList.php",data:{search:s,...t.request}});if(r.error)return void(t.blockedLoad=!0);t.items=e.search?r.result:[...t.items||[],...r.result],!("autocomplete"in t)&&t.items.length>20&&(t.autocomplete=!0),e.cb()}catch(e){this.$sentry.captureException(e)}},setFile(e,t){t.loadFiles.push(e)},deleteFile(e,t){t.loadFiles.splice(e,1)},close(){this.error=null,this.success=!1,this.$emit("close")}}},h={form:"epicentr-nuxt-components-crm-form-index__form",form__title:"epicentr-nuxt-components-crm-form-index__form__title",form__list:"epicentr-nuxt-components-crm-form-index__form__list",form__item:"epicentr-nuxt-components-crm-form-index__form__item",form__send:"epicentr-nuxt-components-crm-form-index__form__send",disabled:"epicentr-nuxt-components-crm-form-index__disabled",link:"epicentr-nuxt-components-crm-form-index__link",form__label:"epicentr-nuxt-components-crm-form-index__form__label",error:"epicentr-nuxt-components-crm-form-index__error",thank:"epicentr-nuxt-components-crm-form-index__thank",error__title:"epicentr-nuxt-components-crm-form-index__error__title",thank__title:"epicentr-nuxt-components-crm-form-index__thank__title",error__message:"epicentr-nuxt-components-crm-form-index__error__message",thank__message:"epicentr-nuxt-components-crm-form-index__thank__message",btn:"epicentr-nuxt-components-crm-form-index__btn"};var v=(0,l.Z)(f,u,[],!1,(function(e){this.$style=h.locals||h}),null,null).exports,y=function(){var e=this,t=e._self._c;return t("div",{class:e.$style.subject},[t("header",{class:e.$style.subject__title},[e._v("Зворотній зв'язок")]),t("div",{class:e.$style.subject__wrapper},[t("h3",{class:e.$style.subject__subtitle},[e._v("Інфоцентр")]),t("p",{class:e.$style.subject__label},[e._v("Тут можна знайти відповіді на найпоширеніші запитання")]),t("ui-button",{class:e.$style.btn,attrs:{tag:"a",href:e.link}},[e._v("Перейти в інфоцентр")])],1),t("div",{class:e.$style.subject__wrapper},[t("h3",{class:e.$style.subject__subtitle},[e._v("Служба підтримки")]),t("p",{class:e.$style.subject__label},[e._v("Оберіть тематику звернення")]),t("ui-form-select",{attrs:{params:e.select},on:{input:function(t){return e.$emit("input",t)}},model:{value:e.select.value,callback:function(t){e.$set(e.select,"value",t)},expression:"select.value"}})],1)])};y._withStripped=!0;var b={props:{items:Array},data(){return{select:{placeholder:{ua:"Зробіть вибір",ru:"Сделайте выбор"},search:{value:""},error:null,value:"",items:this.items}}},computed:{link:()=>"admin.epicentrm.com.ua"===location.host?"https://supportm.epicentrk.ua/":"/ua/faq/"}},x={subject:"epicentr-nuxt-components-crm-form-subject__subject",subject__title:"epicentr-nuxt-components-crm-form-subject__subject__title",subject__wrapper:"epicentr-nuxt-components-crm-form-subject__subject__wrapper",subject__subtitle:"epicentr-nuxt-components-crm-form-subject__subject__subtitle",subject__label:"epicentr-nuxt-components-crm-form-subject__subject__label",btn:"epicentr-nuxt-components-crm-form-subject__btn"};var $=(0,l.Z)(b,y,[],!1,(function(e){this.$style=x.locals||x}),null,null).exports;Vue.component("CrmFormSubject",$),Vue.component("CrmForm",v);var k={components:{crmFormNuxt:a},props:{id:[Number,Array],items:Array,type:String}},g={form:"epicentr-src-vue-apps-crm-form__form",crm:"epicentr-src-vue-apps-crm-form__crm",popup:"epicentr-src-vue-apps-crm-form__popup",pt:"epicentr-src-vue-apps-crm-form__pt","focus-visible":"epicentr-src-vue-apps-crm-form__focus-visible"};var w=(0,l.Z)(k,r,[],!1,(function(e){this.$style=g.locals||g}),null,null).exports}}]); |
{ | ||
"name": "widget-crm-form", | ||
"version": "5.1.17", | ||
"version": "5.1.18", | ||
"description": "epicentrk", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1617357
1697