portalcash-shared 1.3.76 → 1.3.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/components/operations/DetailsCard.vue.js +1 -1
  2. package/dist/components/operations/DetailsCard.vue.js.br +0 -0
  3. package/dist/components/operations/DetailsCard.vue.js.gz +0 -0
  4. package/dist/components/operations/DetailsCard.vue.js.map +1 -1
  5. package/dist/components/ui/CustomInput.vue.js +1 -1
  6. package/dist/components/ui/CustomInput.vue2.js +1 -1
  7. package/dist/components/ui/CustomInput.vue2.js.br +0 -0
  8. package/dist/components/ui/CustomInput.vue2.js.gz +0 -0
  9. package/dist/components/ui/CustomInput.vue2.js.map +1 -1
  10. package/dist/components/ui/CustomSelectCountry.vue.js +1 -1
  11. package/dist/components/ui/CustomSelectCountry.vue2.js +1 -1
  12. package/dist/components/ui/CustomSelectCountry.vue2.js.br +0 -0
  13. package/dist/components/ui/CustomSelectCountry.vue2.js.gz +0 -0
  14. package/dist/components/ui/CustomSelectCountry.vue2.js.map +1 -1
  15. package/dist/components/ui/UploadFileDialog.vue.js +1 -1
  16. package/dist/components/ui/UploadFileDialog.vue.js.br +0 -0
  17. package/dist/components/ui/UploadFileDialog.vue.js.gz +0 -0
  18. package/dist/components/ui/UploadFileDialog.vue.js.map +1 -1
  19. package/dist/index.d.ts +11 -61
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.br +0 -0
  22. package/dist/index.js.gz +0 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/style.css.br +0 -0
  26. package/dist/style.css.gz +0 -0
  27. package/package.json +1 -1
  28. package/dist/components/operations/PaymentDocument.vue.js +0 -1
  29. package/dist/components/operations/PaymentDocument.vue.js.br +0 -0
  30. package/dist/components/operations/PaymentDocument.vue.js.gz +0 -0
  31. package/dist/components/operations/PaymentDocument.vue.js.map +0 -1
  32. package/dist/components/operations/PaymentDocument.vue2.js +0 -1
  33. package/dist/components/operations/PaymentDocument.vue2.js.map +0 -1
  34. package/dist/components/ui/CustomFileUpload.vue.js +0 -1
  35. package/dist/components/ui/CustomFileUpload.vue.js.br +0 -0
  36. package/dist/components/ui/CustomFileUpload.vue.js.gz +0 -0
  37. package/dist/components/ui/CustomFileUpload.vue.js.map +0 -1
@@ -1 +1 @@
1
- import t from"../ui/CustomInput.vue.js";import e from"primevue/inputnumber";import a from"primevue/divider";import{defineComponent as r,defineAsyncComponent as i,ref as n,computed as d,onMounted as o,openBlock as s,createElementBlock as p,createElementVNode as l,createTextVNode as u,toDisplayString as c,createVNode as x,unref as m,normalizeClass as y,createCommentVNode as b,Fragment as k,createBlock as f}from"vue";import{useCurrencyFormatter as C}from"../../composables/useFormatPrice.js";import{rutFormatter as v}from"../../utils/rutFormatter.js";const g={class:"card"},w={class:"flex flex-col gap-0.5 text-sm bg-white border border-dark-secondary rounded-md p-3 shadow-2xs dark:bg-background-alt dark:border-dark-border"},T={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},h={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},j={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},D={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},V={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},F={class:"flex justify-between text-text-primary dark:text-text-primary-dark mt-0.5"},P={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},A={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},I={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},N={key:0,class:"flex justify-between text-text-primary dark:text-text-primary-dark"},B={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},E={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},M={key:0},U={key:0,class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},L={class:"text-sm flex-1"},R={style:{width:"140px",height:"35px"}},S={key:1,class:"flex justify-between text-text-primary dark:text-text-primary-dark"},$={key:2,class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},z={style:{width:"140px",height:"35px"}},H={key:3,class:"flex justify-between text-text-primary dark:text-text-primary-dark"},O={key:1},_={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},q={style:{color:"#34a649"}},G={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},J={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-2 mb-2"},K={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},Q={class:"text-sm flex-1 mt-2",style:{color:"#ea6b58"}},W={style:{width:"140px",height:"35px"}},X={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center font-700",style:{color:"#ea6b58"}},Y={style:{width:"140px",height:"35px"}},Z={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-3 mb-",style:{color:"#ea6b58"}},tt={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},et={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},at={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},rt={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},it={style:{color:"#34a649"}},nt={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},dt={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},ot={style:{width:"140px",height:"35px"}},st={key:5,class:"flex justify-between"},pt=/* @__PURE__ */r({__name:"DetailsCard",props:{data:{type:Object,default:()=>{}},banksList:{type:Array,default:()=>[]},isAnalist:{type:Boolean,default:!1}},setup(r){const pt=i(()=>import("./PaymentDocument.vue2.js")),lt=i(()=>import("../ui/CustomButton.vue.js")),ut=i(()=>import("../ui/CustomSelect.vue.js")),{formatPrice:ct}=C(),xt=r,mt=n(null),yt=n(!1),bt=n(xt.data),kt=n(0),ft=n(""),Ct=n("");function vt(t){let e=["font-700 "];return"Aprobado"===t?e.push("text-icon-success"):"Rechazado"===t?e.push("text-text-error"):"Devolución"===t&&e.push("text-accent-sky-60"),e}function gt(t){const e=["text-[10px]","w-[95px]","inline-flex","justify-between","items-center","border","px-2","py-1","rounded-md","bg-surface-tertiary","border-section-title","dark:border-dark-border"];return"Pendiente"===t.status.description?e.push("!text-primary-dark-border","border-border-upload-excel!","bg-dark-secondary!"):"En Corrección"===t.status.description?e.push("text-text-primary!","border-neutral-gray-80!","bg-surface-tertiary!"):"Corregido"===t.status.description?"Aprobado"===t.statusType.description?e.push("text-text-primary!","border-forest-maid!","bg-background-success-minimal!"):"Rechazado"===t.statusType.description?e.push("text-text-primary!","border-helper-text!","bg-background-error-minimal!"):"Devolución"===t.statusType.description&&e.push("text-text-primary!","border-border-focus!","bg-background-info-minimal!"):"Validado"===t.status.description?e.push("text-text-primary!","border-icon-warning!","bg-background-warning-minimal!"):"En Pago Unitario"===t.status.description?e.push("text-text-primary!","border-uniform!","bg-background-info-minimal!"):8===t.status.id?e.push("text-text-primary!","border-forest-maid!","bg-background-success-minimal!"):9===t.status.id&&e.push("text-text-primary!","border-helper-text!","bg-background-error-minimal!"),e}const wt=d(()=>"Validado"===xt.data.status.description||"Rechazado"===xt.data.statusType.description||"En Corrección"===xt.data.status.description);return o(()=>{kt.value=bt.value.amount,ft.value=bt.value.bankCrediCorp.description,Ct.value=bt.value.bankCrediCorp.accountNumber,xt.data.amount=bt.value.operationDetails[0].amount,xt.data.bankCrediCorp.id=bt.value.operationDetails[0].bankCrediCorp.id,xt.data.bankCrediCorp.accountNumber=bt.value.operationDetails[0].bankCrediCorp.accountNumber}),(i,n)=>{const d=a,o=e,C=t;return s(),p("div",g,[l("div",w,[l("p",T,[n[9]||(n[9]=u(" Fecha / Hora:",-1)),l("b",null,c(r.data.dateTime),1)]),l("p",h,[n[10]||(n[10]=u(" Folio/Correlativo: ",-1)),l("b",null,c(r.data.folio),1)]),x(d),l("p",j,[n[11]||(n[11]=u(" Tipo de Transacción: ",-1)),l("b",null,c(r.data.transactionType.description),1)]),l("p",D,[n[12]||(n[12]=u(" Moneda: ",-1)),l("b",null,c(r.data.currencyType.description),1)]),l("p",V,[n[13]||(n[13]=u(" Forma de Abono: ",-1)),l("b",null,c(r.data.paymentMethod),1)]),l("p",F,[n[14]||(n[14]=u(" Abono Cuenta ",-1)),n[15]||(n[15]=l("br",null,null,-1)),n[16]||(n[16]=u(" Propia o de Tercero: ",-1)),l("b",null,c(r.data.thirdPartyPayment?"Tercero":"Cuenta Propia"),1)]),l("p",P,[n[17]||(n[17]=u(" Secuencia: ",-1)),l("b",null,c(r.data.secuency.description),1)]),l("p",A,[n[18]||(n[18]=u(" Documento ",-1)),n[19]||(n[19]=l("br",null,null,-1)),n[20]||(n[20]=u(" Adjunto: ",-1)),x(m(lt),{class:"text-[14px]",icon:"fa solid fa-paperclip",iconClass:"text-[16px]",variant:"link",label:"Ver documento",onClick:n[0]||(n[0]=t=>{return e=r.data,mt.value=e,void(yt.value=!0);var e})})]),l("p",I,[n[21]||(n[21]=l("span",{class:""},"Estado de Operación:",-1)),l("span",{class:y([gt(r.data),"whitespace-nowrap"])},c(r.data.status.description),3)]),"Corregido"===r.data.status.description?(s(),p("p",N,[n[22]||(n[22]=l("span",{class:""},"Tipo de Corrección:",-1)),l("span",{class:y([vt(r.data.statusType.description),"whitespace-nowrap"])},c(r.data.statusType.description),3)])):b("",!0),x(d),l("p",B,[n[23]||(n[23]=u(" Rut Cliente: ",-1)),l("b",null,c(m(v)(r.data.clientData.rut)),1)]),l("p",E,[n[24]||(n[24]=u(" Nombre Cliente: ",-1)),l("b",null,c(r.data.clientData.name),1)]),"Corregido"!=r.data.status.description?(s(),p(k,{key:1},[1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?(s(),p("div",M,[r.isAnalist&&"En Corrección"!=r.data.status.description?(s(),p("div",U,[l("span",L,"Monto en "+c(r.data.currencyType.description)+":",1),l("div",R,[x(o,{inputClass:" w-[140px] h-[35px]",disabled:wt.value,modelValue:r.data.amount,"onUpdate:modelValue":n[1]||(n[1]=t=>r.data.amount=t),inputId:1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?"integeronly":"minmaxfraction",minFractionDigits:1===r.data.currencyType.id?0:2,maxFractionDigits:5,fluid:""},null,8,["disabled","modelValue","inputId","minFractionDigits"])])])):(s(),p("p",S,[u(" Monto en "+c(r.data.currencyType.description)+": ",1),l("b",null,c(1===r.data.operationType||2===r.data.operationType?m(ct)(r.data.amount,"$"):m(ct)(r.data.amount,"$",2)),1)])),r.isAnalist&&"En Corrección"!=r.data.status.description?(s(),p("div",$,[u(" Banco "+c(4===r.data.operationType||6===r.data.operationType?"Pagador":"Credicorp")+": ",1),l("div",null,[l("div",z,[x(m(ut),{disabled:wt.value,class:"w-35 h-8.75",selectClass:"items-center mt-2 text-sm !w-[140px] h-[35px]",modelValue:r.data.bankCrediCorp.id,"onUpdate:modelValue":n[2]||(n[2]=t=>r.data.bankCrediCorp.id=t),optionLabel:"description",optionValue:"id",placeholder:"Seleccione",options:r.banksList},null,8,["disabled","modelValue","options"])])])])):(s(),p("p",H,[n[25]||(n[25]=u(" Banco Credicorp: ",-1)),l("b",null,c(r.data.bankCrediCorp.description),1)]))])):(s(),p("div",O,[l("p",_,[u(' items-center"> Monto en '+c(r.data.currencyType.description)+": ",1),l("b",q,c(4===r.data.operationType||6===r.data.operationType?m(ct)(r.data.amount,"",2):m(ct)(r.data.amount,"$")),1)]),l("p",G,[n[26]||(n[26]=u(" Banco Pagador: ",-1)),l("b",null,c(r.data.bankCrediCorp.description),1)])])),l("p",J,[u(c(1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?"Cuenta Credicorp":"Cuenta Pagadora")+": ",1),l("b",null,c(r.data.bankCrediCorp.accountNumber),1)])],64)):1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?(s(),p(k,{key:2},[l("div",K,[l("b",Q,"Monto Inicial en "+c(r.data.currencyType.description)+":",1),l("div",W,[x(o,{inputClass:" w-[140px] h-[35px]",disabled:wt.value,modelValue:r.data.amount,"onUpdate:modelValue":n[3]||(n[3]=t=>r.data.amount=t),inputId:1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?"integeronly":"minmaxfraction",minFractionDigits:1===r.data.currencyType.id?0:2,maxFractionDigits:5,fluid:""},null,8,["disabled","modelValue","inputId","minFractionDigits"])])]),l("div",X,[n[27]||(n[27]=l("p",null,"Banco Credicorp Inicial:",-1)),l("div",Y,[x(m(ut),{disabled:wt.value,class:"w-35 h-8.75",selectClass:"items-center mt-2 text-sm !w-[140px] h-[35px]",modelValue:r.data.bankCrediCorp.id,"onUpdate:modelValue":n[4]||(n[4]=t=>r.data.bankCrediCorp.id=t),optionLabel:"description",optionValue:"id",placeholder:"Seleccione",options:r.banksList,onChange:n[5]||(n[5]=t=>function(t){let e=xt.banksList.find(e=>e.id===t);e&&(xt.data.bankCrediCorp.id=e.id,xt.data.bankCrediCorp.description=e.description,xt.data.bankCrediCorp.accountNumber=e.accountNumber)}(r.data.bankCrediCorp.id))},null,8,["disabled","modelValue","options"])])]),l("p",Z,[n[28]||(n[28]=l("b",null," Cuenta Credicorp Inicial:",-1)),l("b",null,c(r.data.bankCrediCorp.accountNumber),1)]),l("p",tt,[l("b",null,"Monto Final en "+c(r.data.currencyType.description)+": ",1),l("b",null,c(4===r.data.operationType||6===r.data.operationType?m(ct)(kt.value,"",2):m(ct)(kt.value,"")),1)]),l("p",et,[n[29]||(n[29]=l("b",null,"Banco Credicorp Final:",-1)),l("b",null,c(ft.value),1)]),l("p",at,[n[30]||(n[30]=l("b",null,"Cuenta Credicorp Final:",-1)),l("b",null,c(Ct.value),1)])],64)):(s(),p(k,{key:3},[l("p",rt,[u(" Monto En "+c(r.data.currencyType.description)+": ",1),l("b",it,c(1===r.data.operationType||2===r.data.operationType?m(ct)(r.data.amount,"$"):m(ct)(r.data.amount,"$",2)),1)]),l("b",nt,[n[31]||(n[31]=u(" Banco Pagador: ",-1)),l("p",null,c(r.data.bankCrediCorp.description),1)]),l("b",dt,[n[32]||(n[32]=u(" Cuenta Pagadora: ",-1)),l("p",null,c(r.data.bankCrediCorp.accountNumber),1)])],64)),r.isAnalist&&"En Corrección"!=r.data.status.description?(s(),p("div",{key:4,class:y(["flex justify-between text-text-primary dark:text-text-primary-dark items-center","Corregido"===r.data.status.description?"mb-1":""])},[n[33]||(n[33]=l("span",{class:"text-sm flex-1"},"Referencia:",-1)),l("div",ot,[x(C,{modelValue:r.data.reference,"onUpdate:modelValue":n[6]||(n[6]=t=>r.data.reference=t),inputClass:"w-[162px] h-[35px]",inputId:1===r.data.currencyType.id||2===r.data.currencyType.id?"integeronly":"minmaxfraction",minFractionDigits:1===r.data.currencyType.id||2===r.data.currencyType.id?0:2,maxFractionDigits:5,fluid:""},null,8,["modelValue","inputId","minFractionDigits"])])],2)):(s(),p("p",st,[n[34]||(n[34]=u(" Referencia: ",-1)),l("b",null,c(r.data.reference),1)]))]),yt.value?(s(),f(m(pt),{key:0,visible:yt.value,paymentData:mt.value,"onUpdate:visible":n[7]||(n[7]=t=>yt.value=!1),onHandleSaveDocument:n[8]||(n[8]=t=>yt.value=!1)},null,8,["visible","paymentData"])):b("",!0)])}}});export{pt as default};
1
+ import t from"../ui/CustomInput.vue.js";import e from"primevue/inputnumber";import a from"primevue/divider";import{defineComponent as r,defineAsyncComponent as i,ref as n,computed as d,onMounted as o,openBlock as s,createElementBlock as p,createElementVNode as l,createTextVNode as c,toDisplayString as u,createVNode as x,unref as m,normalizeClass as y,createCommentVNode as b,Fragment as k}from"vue";import{useCurrencyFormatter as f}from"../../composables/useFormatPrice.js";import{rutFormatter as C}from"../../utils/rutFormatter.js";const g={class:"card"},w={class:"flex flex-col gap-0.5 text-sm bg-white border border-dark-secondary rounded-md p-3 shadow-2xs dark:bg-background-alt dark:border-dark-border"},T={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},h={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},v={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},j={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},V={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},D={class:"flex justify-between text-text-primary dark:text-text-primary-dark mt-0.5"},F={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},P={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},A={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},I={key:0,class:"flex justify-between text-text-primary dark:text-text-primary-dark"},N={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},B={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},E={key:0},M={key:0,class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},L={class:"text-sm flex-1"},R={style:{width:"140px",height:"35px"}},U={key:1,class:"flex justify-between text-text-primary dark:text-text-primary-dark"},$={key:2,class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},S={style:{width:"140px",height:"35px"}},z={key:3,class:"flex justify-between text-text-primary dark:text-text-primary-dark"},O={key:1},_={class:"flex justify-between text-text-primary dark:text-text-primary-dark"},H={style:{color:"#34a649"}},q={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},G={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-2 mb-2"},J={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},K={class:"text-sm flex-1 mt-2",style:{color:"#ea6b58"}},Q={style:{width:"140px",height:"35px"}},W={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center font-700",style:{color:"#ea6b58"}},X={style:{width:"140px",height:"35px"}},Y={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-3 mb-",style:{color:"#ea6b58"}},Z={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},tt={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},et={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},at={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},rt={style:{color:"#34a649"}},it={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},nt={class:"flex justify-between text-text-primary dark:text-text-primary-dark items-center"},dt={style:{width:"140px",height:"35px"}},ot={key:5,class:"flex justify-between"},st=/* @__PURE__ */r({__name:"DetailsCard",props:{data:{type:Object,default:()=>{}},banksList:{type:Array,default:()=>[]},isAnalist:{type:Boolean,default:!1}},setup(r){const st=i(()=>import("../ui/CustomButton.vue.js")),pt=i(()=>import("../ui/CustomSelect.vue.js")),{formatPrice:lt}=f(),ct=r,ut=n(null),xt=n(!1),mt=n(ct.data),yt=n(0),bt=n(""),kt=n("");function ft(t){let e=["font-700 "];return"Aprobado"===t?e.push("text-icon-success"):"Rechazado"===t?e.push("text-text-error"):"Devolución"===t&&e.push("text-accent-sky-60"),e}function Ct(t){const e=["text-[10px]","w-[95px]","inline-flex","justify-between","items-center","border","px-2","py-1","rounded-md","bg-surface-tertiary","border-section-title","dark:border-dark-border"];return"Pendiente"===t.status.description?e.push("!text-primary-dark-border","border-border-upload-excel!","bg-dark-secondary!"):"En Corrección"===t.status.description?e.push("text-text-primary!","border-neutral-gray-80!","bg-surface-tertiary!"):"Corregido"===t.status.description?"Aprobado"===t.statusType.description?e.push("text-text-primary!","border-forest-maid!","bg-background-success-minimal!"):"Rechazado"===t.statusType.description?e.push("text-text-primary!","border-helper-text!","bg-background-error-minimal!"):"Devolución"===t.statusType.description&&e.push("text-text-primary!","border-border-focus!","bg-background-info-minimal!"):"Validado"===t.status.description?e.push("text-text-primary!","border-icon-warning!","bg-background-warning-minimal!"):"En Pago Unitario"===t.status.description?e.push("text-text-primary!","border-uniform!","bg-background-info-minimal!"):8===t.status.id?e.push("text-text-primary!","border-forest-maid!","bg-background-success-minimal!"):9===t.status.id&&e.push("text-text-primary!","border-helper-text!","bg-background-error-minimal!"),e}const gt=d(()=>"Validado"===ct.data.status.description||"Rechazado"===ct.data.statusType.description||"En Corrección"===ct.data.status.description);return o(()=>{yt.value=mt.value.amount,bt.value=mt.value.bankCrediCorp.description,kt.value=mt.value.bankCrediCorp.accountNumber,ct.data.amount=mt.value.operationDetails[0].amount,ct.data.bankCrediCorp.id=mt.value.operationDetails[0].bankCrediCorp.id,ct.data.bankCrediCorp.accountNumber=mt.value.operationDetails[0].bankCrediCorp.accountNumber}),(i,n)=>{const d=a,o=e,f=t;return s(),p("div",g,[l("div",w,[l("p",T,[n[7]||(n[7]=c(" Fecha / Hora:",-1)),l("b",null,u(r.data.dateTime),1)]),l("p",h,[n[8]||(n[8]=c(" Folio/Correlativo: ",-1)),l("b",null,u(r.data.folio),1)]),x(d),l("p",v,[n[9]||(n[9]=c(" Tipo de Transacción: ",-1)),l("b",null,u(r.data.transactionType.description),1)]),l("p",j,[n[10]||(n[10]=c(" Moneda: ",-1)),l("b",null,u(r.data.currencyType.description),1)]),l("p",V,[n[11]||(n[11]=c(" Forma de Abono: ",-1)),l("b",null,u(r.data.paymentMethod),1)]),l("p",D,[n[12]||(n[12]=c(" Abono Cuenta ",-1)),n[13]||(n[13]=l("br",null,null,-1)),n[14]||(n[14]=c(" Propia o de Tercero: ",-1)),l("b",null,u(r.data.thirdPartyPayment?"Tercero":"Cuenta Propia"),1)]),l("p",F,[n[15]||(n[15]=c(" Secuencia: ",-1)),l("b",null,u(r.data.secuency.description),1)]),l("p",P,[n[16]||(n[16]=c(" Documento ",-1)),n[17]||(n[17]=l("br",null,null,-1)),n[18]||(n[18]=c(" Adjunto: ",-1)),x(m(st),{class:"text-[14px]",icon:"fa solid fa-paperclip",iconClass:"text-[16px]",variant:"link",label:"Ver documento",onClick:n[0]||(n[0]=t=>{return e=r.data,ut.value=e,void(xt.value=!0);var e})})]),l("p",A,[n[19]||(n[19]=l("span",{class:""},"Estado de Operación:",-1)),l("span",{class:y([Ct(r.data),"whitespace-nowrap"])},u(r.data.status.description),3)]),"Corregido"===r.data.status.description?(s(),p("p",I,[n[20]||(n[20]=l("span",{class:""},"Tipo de Corrección:",-1)),l("span",{class:y([ft(r.data.statusType.description),"whitespace-nowrap"])},u(r.data.statusType.description),3)])):b("",!0),x(d),l("p",N,[n[21]||(n[21]=c(" Rut Cliente: ",-1)),l("b",null,u(m(C)(r.data.clientData.rut)),1)]),l("p",B,[n[22]||(n[22]=c(" Nombre Cliente: ",-1)),l("b",null,u(r.data.clientData.name),1)]),"Corregido"!=r.data.status.description?(s(),p(k,{key:1},[1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?(s(),p("div",E,[r.isAnalist&&"En Corrección"!=r.data.status.description?(s(),p("div",M,[l("span",L,"Monto en "+u(r.data.currencyType.description)+":",1),l("div",R,[x(o,{inputClass:" w-[140px] h-[35px]",disabled:gt.value,modelValue:r.data.amount,"onUpdate:modelValue":n[1]||(n[1]=t=>r.data.amount=t),inputId:1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?"integeronly":"minmaxfraction",minFractionDigits:1===r.data.currencyType.id?0:2,maxFractionDigits:5,fluid:""},null,8,["disabled","modelValue","inputId","minFractionDigits"])])])):(s(),p("p",U,[c(" Monto en "+u(r.data.currencyType.description)+": ",1),l("b",null,u(1===r.data.operationType||2===r.data.operationType?m(lt)(r.data.amount,"$"):m(lt)(r.data.amount,"$",2)),1)])),r.isAnalist&&"En Corrección"!=r.data.status.description?(s(),p("div",$,[c(" Banco "+u(4===r.data.operationType||6===r.data.operationType?"Pagador":"Credicorp")+": ",1),l("div",null,[l("div",S,[x(m(pt),{disabled:gt.value,class:"w-35 h-8.75",selectClass:"items-center mt-2 text-sm !w-[140px] h-[35px]",modelValue:r.data.bankCrediCorp.id,"onUpdate:modelValue":n[2]||(n[2]=t=>r.data.bankCrediCorp.id=t),optionLabel:"description",optionValue:"id",placeholder:"Seleccione",options:r.banksList},null,8,["disabled","modelValue","options"])])])])):(s(),p("p",z,[n[23]||(n[23]=c(" Banco Credicorp: ",-1)),l("b",null,u(r.data.bankCrediCorp.description),1)]))])):(s(),p("div",O,[l("p",_,[c(' items-center"> Monto en '+u(r.data.currencyType.description)+": ",1),l("b",H,u(4===r.data.operationType||6===r.data.operationType?m(lt)(r.data.amount,"",2):m(lt)(r.data.amount,"$")),1)]),l("p",q,[n[24]||(n[24]=c(" Banco Pagador: ",-1)),l("b",null,u(r.data.bankCrediCorp.description),1)])])),l("p",G,[c(u(1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?"Cuenta Credicorp":"Cuenta Pagadora")+": ",1),l("b",null,u(r.data.bankCrediCorp.accountNumber),1)])],64)):1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?(s(),p(k,{key:2},[l("div",J,[l("b",K,"Monto Inicial en "+u(r.data.currencyType.description)+":",1),l("div",Q,[x(o,{inputClass:" w-[140px] h-[35px]",disabled:gt.value,modelValue:r.data.amount,"onUpdate:modelValue":n[3]||(n[3]=t=>r.data.amount=t),inputId:1===r.data.operationType||3===r.data.operationType||5===r.data.operationType?"integeronly":"minmaxfraction",minFractionDigits:1===r.data.currencyType.id?0:2,maxFractionDigits:5,fluid:""},null,8,["disabled","modelValue","inputId","minFractionDigits"])])]),l("div",W,[n[25]||(n[25]=l("p",null,"Banco Credicorp Inicial:",-1)),l("div",X,[x(m(pt),{disabled:gt.value,class:"w-35 h-8.75",selectClass:"items-center mt-2 text-sm !w-[140px] h-[35px]",modelValue:r.data.bankCrediCorp.id,"onUpdate:modelValue":n[4]||(n[4]=t=>r.data.bankCrediCorp.id=t),optionLabel:"description",optionValue:"id",placeholder:"Seleccione",options:r.banksList,onChange:n[5]||(n[5]=t=>function(t){let e=ct.banksList.find(e=>e.id===t);e&&(ct.data.bankCrediCorp.id=e.id,ct.data.bankCrediCorp.description=e.description,ct.data.bankCrediCorp.accountNumber=e.accountNumber)}(r.data.bankCrediCorp.id))},null,8,["disabled","modelValue","options"])])]),l("p",Y,[n[26]||(n[26]=l("b",null," Cuenta Credicorp Inicial:",-1)),l("b",null,u(r.data.bankCrediCorp.accountNumber),1)]),l("p",Z,[l("b",null,"Monto Final en "+u(r.data.currencyType.description)+": ",1),l("b",null,u(4===r.data.operationType||6===r.data.operationType?m(lt)(yt.value,"",2):m(lt)(yt.value,"")),1)]),l("p",tt,[n[27]||(n[27]=l("b",null,"Banco Credicorp Final:",-1)),l("b",null,u(bt.value),1)]),l("p",et,[n[28]||(n[28]=l("b",null,"Cuenta Credicorp Final:",-1)),l("b",null,u(kt.value),1)])],64)):(s(),p(k,{key:3},[l("p",at,[c(" Monto En "+u(r.data.currencyType.description)+": ",1),l("b",rt,u(1===r.data.operationType||2===r.data.operationType?m(lt)(r.data.amount,"$"):m(lt)(r.data.amount,"$",2)),1)]),l("b",it,[n[29]||(n[29]=c(" Banco Pagador: ",-1)),l("p",null,u(r.data.bankCrediCorp.description),1)]),l("b",nt,[n[30]||(n[30]=c(" Cuenta Pagadora: ",-1)),l("p",null,u(r.data.bankCrediCorp.accountNumber),1)])],64)),r.isAnalist&&"En Corrección"!=r.data.status.description?(s(),p("div",{key:4,class:y(["flex justify-between text-text-primary dark:text-text-primary-dark items-center","Corregido"===r.data.status.description?"mb-1":""])},[n[31]||(n[31]=l("span",{class:"text-sm flex-1"},"Referencia:",-1)),l("div",dt,[x(f,{modelValue:r.data.reference,"onUpdate:modelValue":n[6]||(n[6]=t=>r.data.reference=t),inputClass:"w-[162px] h-[35px]",inputId:1===r.data.currencyType.id||2===r.data.currencyType.id?"integeronly":"minmaxfraction",minFractionDigits:1===r.data.currencyType.id||2===r.data.currencyType.id?0:2,maxFractionDigits:5,fluid:""},null,8,["modelValue","inputId","minFractionDigits"])])],2)):(s(),p("p",ot,[n[32]||(n[32]=c(" Referencia: ",-1)),l("b",null,u(r.data.reference),1)]))])])}}});export{st as default};
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsCard.vue.js","sources":["../../../src/components/operations/DetailsCard.vue"],"sourcesContent":["<template>\n <div class=\"card\">\n <div\n class=\"flex flex-col gap-0.5 text-sm bg-white border border-dark-secondary rounded-md p-3 shadow-2xs dark:bg-background-alt dark:border-dark-border\"\n >\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Fecha / Hora:<b>{{ data.dateTime }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Folio/Correlativo: <b>{{ data.folio }}</b>\n </p>\n <Divider />\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Tipo de Transacción: <b>{{ data.transactionType.description }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Moneda: <b>{{ data.currencyType.description }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Forma de Abono: <b>{{ data.paymentMethod }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark mt-0.5\"\n >\n Abono Cuenta <br />\n Propia o de Tercero:\n <b>{{ data.thirdPartyPayment ? \"Tercero\" : \"Cuenta Propia\" }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Secuencia: <b>{{ data.secuency.description }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Documento <br />\n Adjunto:\n <CustomButton\n class=\"text-[14px]\"\n icon=\"fa solid fa-paperclip\"\n iconClass=\"text-[16px]\"\n variant=\"link\"\n label=\"Ver documento\"\n @click=\"showPaymentDocument(data)\"\n />\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n <span class=\" \">Estado de Operación:</span>\n <span :class=\"getStatusClasses(data)\" class=\"whitespace-nowrap\">\n {{ data.status.description }}\n </span>\n </p>\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n v-if=\"data.status.description === 'Corregido'\"\n >\n <span class=\" \">Tipo de Corrección:</span>\n <span\n :class=\"getStatusTypeClasses(data.statusType.description)\"\n class=\"whitespace-nowrap\"\n >\n {{ data.statusType.description }}\n </span>\n </p>\n\n <Divider />\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Rut Cliente: <b>{{ rutFormatter(data.clientData.rut) }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Nombre Cliente: <b>{{ data.clientData.name }}</b>\n </p>\n\n <template v-if=\"data.status.description != 'Corregido'\">\n <div\n v-if=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n \"\n >\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n v-if=\"isAnalist && data.status.description != 'En Corrección'\"\n >\n <span class=\"text-sm flex-1\"\n >Monto en {{ data.currencyType.description }}:</span\n >\n <div style=\"width: 140px; height: 35px\">\n <InputNumber\n inputClass=\" w-[140px] h-[35px]\"\n :disabled=\"disabledInput\"\n v-model=\"data.amount\"\n :inputId=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n ? 'integeronly'\n : 'minmaxfraction'\n \"\n :minFractionDigits=\"data.currencyType.id === 1 ? 0 : 2\"\n :maxFractionDigits=\"5\"\n fluid\n />\n </div>\n </div>\n <p\n v-else\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Monto en {{ data.currencyType.description }}:\n <b>{{\n data.operationType === 1 || data.operationType === 2\n ? formatPrice(data.amount, \"$\")\n : formatPrice(data.amount, \"$\", 2)\n }}</b>\n </p>\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n v-if=\"isAnalist && data.status.description != 'En Corrección'\"\n >\n Banco\n {{\n data.operationType === 4 || data.operationType === 6\n ? \"Pagador\"\n : \"Credicorp\"\n }}:\n <div>\n <div style=\"width: 140px; height: 35px\">\n <CustomSelect\n :disabled=\"disabledInput\"\n class=\"w-35 h-8.75\"\n selectClass=\"items-center mt-2 text-sm !w-[140px] h-[35px]\"\n v-model=\"data.bankCrediCorp.id\"\n optionLabel=\"description\"\n optionValue=\"id\"\n placeholder=\"Seleccione\"\n :options=\"banksList\"\n />\n </div>\n </div>\n </div>\n <p\n v-else\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Banco Credicorp: <b>{{ data.bankCrediCorp.description }}</b>\n </p>\n </div>\n <div v-else>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n items-center\"> Monto en {{ data.currencyType.description }}:\n <b\n :style=\"{\n color: '#34a649',\n }\"\n >{{\n data.operationType === 4 || data.operationType === 6\n ? formatPrice(data.amount, \"\", 2)\n : formatPrice(data.amount, \"$\")\n }}</b\n >\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Banco Pagador:\n <b>{{ data.bankCrediCorp.description }}</b>\n </p>\n </div>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-2 mb-2\"\n >\n {{\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n ? \"Cuenta Credicorp\"\n : \"Cuenta Pagadora\"\n }}:\n <b>{{ data.bankCrediCorp.accountNumber }} </b>\n </p>\n </template>\n <template\n v-else-if=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n \"\n >\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b class=\"text-sm flex-1 mt-2\" style=\"color: #ea6b58\"\n >Monto Inicial en {{ data.currencyType.description }}:</b\n >\n <div style=\"width: 140px; height: 35px\">\n <InputNumber\n inputClass=\" w-[140px] h-[35px]\"\n :disabled=\"disabledInput\"\n v-model=\"data.amount\"\n :inputId=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n ? 'integeronly'\n : 'minmaxfraction'\n \"\n :minFractionDigits=\"data.currencyType.id === 1 ? 0 : 2\"\n :maxFractionDigits=\"5\"\n fluid\n />\n </div>\n </div>\n\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center font-700\"\n style=\"color: #ea6b58\"\n >\n <p>Banco Credicorp Inicial:</p>\n <div style=\"width: 140px; height: 35px\">\n <CustomSelect\n :disabled=\"disabledInput\"\n class=\"w-35 h-8.75\"\n selectClass=\"items-center mt-2 text-sm !w-[140px] h-[35px]\"\n v-model=\"data.bankCrediCorp.id\"\n optionLabel=\"description\"\n optionValue=\"id\"\n placeholder=\"Seleccione\"\n :options=\"banksList\"\n @change=\"changeBankCrediCorp(data.bankCrediCorp.id)\"\n />\n </div>\n </div>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-3 mb-\"\n style=\"color: #ea6b58\"\n >\n <b> Cuenta Credicorp Inicial:</b>\n <b>{{ data.bankCrediCorp.accountNumber }} </b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b>Monto Final en {{ data.currencyType.description }}: </b>\n <b\n >{{\n data.operationType === 4 || data.operationType === 6\n ? formatPrice(amountFinal, \"\", 2)\n : formatPrice(amountFinal, \"\")\n }}\n </b>\n </p>\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b>Banco Credicorp Final:</b>\n <b>{{ bankFinal }} </b>\n </p>\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b>Cuenta Credicorp Final:</b>\n <b>{{ accountFinal }} </b>\n </p>\n </template>\n <template v-else>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Monto En {{ data.currencyType.description }}:\n <b style=\"color: #34a649\"\n >{{\n data.operationType === 1 || data.operationType === 2\n ? formatPrice(data.amount, \"$\")\n : formatPrice(data.amount, \"$\", 2)\n }}\n </b>\n </p>\n <b\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Banco Pagador:\n <p>{{ data.bankCrediCorp.description }}</p>\n </b>\n <b\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Cuenta Pagadora:\n <p>{{ data.bankCrediCorp.accountNumber }}</p>\n </b>\n </template>\n <div\n v-if=\"isAnalist && data.status.description != 'En Corrección'\"\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n :class=\"data.status.description === 'Corregido' ? 'mb-1' : ''\"\n >\n <span class=\"text-sm flex-1\">Referencia:</span>\n <div style=\"width: 140px; height: 35px\">\n <!-- :disabled=\"disabledInput\" -->\n <CustomInput\n v-model=\"data.reference\"\n inputClass=\"w-[162px] h-[35px]\"\n :inputId=\"\n data.currencyType.id === 1 || data.currencyType.id === 2\n ? 'integeronly'\n : 'minmaxfraction'\n \"\n :minFractionDigits=\"\n data.currencyType.id === 1 || data.currencyType.id === 2 ? 0 : 2\n \"\n :maxFractionDigits=\"5\"\n fluid\n />\n </div>\n </div>\n <p v-else class=\"flex justify-between\">\n Referencia: <b>{{ data.reference }}</b>\n </p>\n </div>\n <PaymentDocument\n v-if=\"showPaymentDocumentModal\"\n :visible=\"showPaymentDocumentModal\"\n :paymentData=\"paymentDocumentData\"\n @update:visible=\"showPaymentDocumentModal = false\"\n @handleSaveDocument=\"showPaymentDocumentModal = false\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, computed, defineAsyncComponent } from \"vue\";\n\nconst PaymentDocument = defineAsyncComponent(\n () => import(\"./PaymentDocument.vue\")\n);\nconst CustomButton = defineAsyncComponent(\n () => import(\"../ui/CustomButton.vue\")\n);\nconst CustomSelect = defineAsyncComponent(\n () => import(\"../ui/CustomSelect.vue\")\n);\n\nimport { useCurrencyFormatter } from \"../../composables/useFormatPrice\";\nimport { rutFormatter } from \"@/utils/rutFormatter\";\n\nconst { formatPrice } = useCurrencyFormatter();\nconst props = defineProps({\n data: {\n type: Object,\n default: () => {},\n },\n banksList: {\n type: Array,\n default: () => [],\n },\n isAnalist: {\n type: Boolean,\n default: false,\n },\n});\n\nconst paymentDocumentData = ref<any>(null);\nconst showPaymentDocumentModal = ref(false);\nconst operationDetails = ref<any>(props.data);\nconst amountFinal = ref<number>(0);\nconst bankFinal = ref<string>(\"\");\nconst accountFinal = ref<string>(\"\");\n\nfunction init() {\n amountFinal.value = operationDetails.value.amount;\n bankFinal.value = operationDetails.value.bankCrediCorp.description;\n accountFinal.value = operationDetails.value.bankCrediCorp.accountNumber;\n props.data.amount = operationDetails.value.operationDetails[0].amount;\n props.data.bankCrediCorp.id =\n operationDetails.value.operationDetails[0].bankCrediCorp.id;\n props.data.bankCrediCorp.accountNumber =\n operationDetails.value.operationDetails[0].bankCrediCorp.accountNumber;\n}\n\nfunction getStatusTypeClasses(type: any): string[] {\n let baseClasses = [\"font-700 \"];\n if (type === \"Aprobado\") {\n baseClasses.push(\"text-icon-success\");\n } else if (type === \"Rechazado\") {\n baseClasses.push(\"text-text-error\");\n } else if (type === \"Devolución\") {\n baseClasses.push(\"text-accent-sky-60\");\n }\n return baseClasses;\n}\n\nfunction getStatusClasses(data: any): string[] {\n const baseClasses = [\n \"text-[10px]\",\n \"w-[95px]\",\n \"inline-flex\",\n \"justify-between\",\n \"items-center\",\n \"border\",\n \"px-2\",\n \"py-1\",\n \"rounded-md\",\n \"bg-surface-tertiary\",\n \"border-section-title\",\n \"dark:border-dark-border\",\n ];\n if (data.status.description === \"Pendiente\") {\n baseClasses.push(\n \"!text-primary-dark-border\",\n \"border-border-upload-excel!\",\n \"bg-dark-secondary!\"\n );\n } else if (data.status.description === \"En Corrección\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-neutral-gray-80!\",\n \"bg-surface-tertiary!\"\n );\n } else if (data.status.description === \"Corregido\") {\n if (data.statusType.description === \"Aprobado\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-forest-maid!\",\n \"bg-background-success-minimal!\"\n );\n } else if (data.statusType.description === \"Rechazado\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-helper-text!\",\n \"bg-background-error-minimal!\"\n );\n } else if (data.statusType.description === \"Devolución\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-border-focus!\",\n \"bg-background-info-minimal!\"\n );\n }\n } else if (data.status.description === \"Validado\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-icon-warning!\",\n \"bg-background-warning-minimal!\"\n );\n } else if (data.status.description === \"En Pago Unitario\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-uniform!\",\n \"bg-background-info-minimal!\"\n );\n } else if (data.status.id === 8) {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-forest-maid!\",\n \"bg-background-success-minimal!\"\n );\n } else if (data.status.id === 9) {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-helper-text!\",\n \"bg-background-error-minimal!\"\n );\n }\n return baseClasses;\n}\n\nfunction showPaymentDocument(data: any) {\n // TODO: se debe eliminar data porq lo q abre es una vista sin nada pero con una imagen dentro que lo entrega el backend\n paymentDocumentData.value = data;\n showPaymentDocumentModal.value = true;\n}\n\nfunction changeBankCrediCorp(bankId: number) {\n type Bank = { id: number; description: string; accountNumber: string };\n let row: Bank | undefined = props.banksList.find(\n (bank: any) => bank.id === bankId\n ) as Bank | undefined;\n if (row) {\n props.data.bankCrediCorp.id = row.id;\n props.data.bankCrediCorp.description = row.description;\n props.data.bankCrediCorp.accountNumber = row.accountNumber;\n }\n}\n\nconst disabledInput = computed(() => {\n return (\n props.data.status.description === \"Validado\" ||\n props.data.statusType.description === \"Rechazado\" ||\n props.data.status.description === \"En Corrección\"\n );\n});\n\nonMounted(() => {\n init();\n});\n</script>\n"],"names":["PaymentDocument","defineAsyncComponent","import","CustomButton","CustomSelect","formatPrice","useCurrencyFormatter","props","__props","paymentDocumentData","ref","showPaymentDocumentModal","operationDetails","data","amountFinal","bankFinal","accountFinal","getStatusTypeClasses","type","baseClasses","push","getStatusClasses","status","description","statusType","id","disabledInput","computed","onMounted","value","amount","bankCrediCorp","accountNumber","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_toDisplayString","dateTime","_hoisted_4","folio","_createVNode","_component_Divider","_hoisted_5","transactionType","_hoisted_6","currencyType","_hoisted_7","paymentMethod","_hoisted_8","thirdPartyPayment","_hoisted_9","secuency","_hoisted_10","_unref","class","icon","iconClass","variant","label","onClick","_cache","$event","showPaymentDocument","_hoisted_11","_normalizeClass","_hoisted_12","_hoisted_13","rutFormatter","clientData","rut","_hoisted_14","name","_Fragment","key","operationType","_hoisted_15","isAnalist","_hoisted_16","_hoisted_17","_hoisted_18","_component_InputNumber","inputClass","disabled","modelValue","inputId","minFractionDigits","maxFractionDigits","fluid","_hoisted_19","_createTextVNode","_hoisted_20","_hoisted_21","selectClass","optionLabel","optionValue","placeholder","options","banksList","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","onChange","bankId","row","find","bank","changeBankCrediCorp","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","_hoisted_40","_hoisted_41","_component_CustomInput","reference","_hoisted_42","_createBlock","visible","paymentData","onHandleSaveDocument"],"mappings":"iuHAoWA,MAAMA,GAAkBC,EACtB,IAAMC,OAAO,8BAETC,GAAeF,EACnB,IAAMC,OAAO,8BAETE,GAAeH,EACnB,IAAMC,OAAO,+BAMTG,YAAEA,IAAgBC,IAClBC,GAAQC,EAeRC,GAAsBC,EAAS,MAC/BC,GAA2BD,GAAI,GAC/BE,GAAmBF,EAASH,GAAMM,MAClCC,GAAcJ,EAAY,GAC1BK,GAAYL,EAAY,IACxBM,GAAeN,EAAY,IAajC,SAASO,GAAqBC,GAC5B,IAAIC,EAAc,CAAC,aAQnB,MAPa,aAATD,EACFC,EAAYC,KAAK,qBACC,cAATF,EACTC,EAAYC,KAAK,mBACC,eAATF,GACTC,EAAYC,KAAK,sBAEZD,CACT,CAEA,SAASE,GAAiBR,GACxB,MAAMM,EAAc,CAClB,cACA,WACA,cACA,kBACA,eACA,SACA,OACA,OACA,aACA,sBACA,uBACA,2BA2DF,MAzDgC,cAA5BN,EAAKS,OAAOC,YACdJ,EAAYC,KACV,4BACA,8BACA,sBAEmC,kBAA5BP,EAAKS,OAAOC,YACrBJ,EAAYC,KACV,qBACA,0BACA,wBAEmC,cAA5BP,EAAKS,OAAOC,YACe,aAAhCV,EAAKW,WAAWD,YAClBJ,EAAYC,KACV,qBACA,sBACA,kCAEuC,cAAhCP,EAAKW,WA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mD,CAAYhD,EAAAK,KAAKiB,OAAM,IAAA,IAAA,KAMpJM,EAKI,IALJwF,GAKI,iBAHH,oBAEC,IAAAxF,EAA2C,IAAA,KAAAG,EAArC/B,EAAAK,KAAKkB,cAAcR,aAAW,KAEtCa,EAKI,IALJyF,GAKI,iBAHH,sBAEC,IAAAzF,EAA6C,IAAA,KAAAG,EAAvC/B,EAAAK,KAAKkB,cAAcC,eAAa,WAIlCxB,EAAAuE,WAAoC,iBAAvBvE,EAAAK,KAAKS,OAAOC,iBADjCW,EAuBM,MAAA,OArBJuB,SAAM,kFACyB,cAAvBjD,OAAKc,OAAOC,YAAW,OAAA,OAE/BwC,EAAA,MAAAA,EAAA,IAAA3B,EAA+C,OAAA,CAAzCqB,MAAM,kBAAiB,eAAW,IACxCrB,EAgBM,MAhBN0F,GAgBM,CAdJnF,EAaEoF,EAAA,CAZSzC,WAAA9E,EAAAK,KAAKmH,UAAL,sBAAAjE,EAAA,KAAAA,EAAA,GAAAC,GAAAxD,EAAAK,KAAKmH,UAAShE,GACvBoB,WAAW,qBACVG,YAAwB/E,EAAAK,KAAKmC,aAAavB,IAAgC,IAApBjB,EAAAK,KAAKmC,aAAavB,kCAKxE+D,sBAAkChF,EAAAK,KAAKmC,aAAavB,IAAgC,IAApBjB,EAAAK,KAAKmC,aAAavB,GAAE,EAAA,EAGpFgE,kBAAmB,EACpBC,MAAA,iEAINzD,IAAAC,EAEI,IAFJ+F,GAEI,iBAFmC,iBACzB,IAAA7F,EAA2B,IAAA,KAAAG,EAArB/B,EAAAK,KAAKmH,WAAS,QAI5BrH,GAAAkB,WADRqG,EAME1E,EAAAxD,IAAA,OAJCmI,QAASxH,GAAAkB,MACTuG,YAAa3H,GAAAoB,MACb,kCAAgBlB,GAAAkB,OAAwB,GACxCwG,oCAAoB1H,GAAAkB,OAAwB"}
1
+ {"version":3,"file":"DetailsCard.vue.js","sources":["../../../src/components/operations/DetailsCard.vue"],"sourcesContent":["<template>\n <div class=\"card\">\n <div\n class=\"flex flex-col gap-0.5 text-sm bg-white border border-dark-secondary rounded-md p-3 shadow-2xs dark:bg-background-alt dark:border-dark-border\"\n >\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Fecha / Hora:<b>{{ data.dateTime }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Folio/Correlativo: <b>{{ data.folio }}</b>\n </p>\n <Divider />\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Tipo de Transacción: <b>{{ data.transactionType.description }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Moneda: <b>{{ data.currencyType.description }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Forma de Abono: <b>{{ data.paymentMethod }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark mt-0.5\"\n >\n Abono Cuenta <br />\n Propia o de Tercero:\n <b>{{ data.thirdPartyPayment ? \"Tercero\" : \"Cuenta Propia\" }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Secuencia: <b>{{ data.secuency.description }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Documento <br />\n Adjunto:\n <CustomButton\n class=\"text-[14px]\"\n icon=\"fa solid fa-paperclip\"\n iconClass=\"text-[16px]\"\n variant=\"link\"\n label=\"Ver documento\"\n @click=\"showPaymentDocument(data)\"\n />\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n <span class=\" \">Estado de Operación:</span>\n <span :class=\"getStatusClasses(data)\" class=\"whitespace-nowrap\">\n {{ data.status.description }}\n </span>\n </p>\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n v-if=\"data.status.description === 'Corregido'\"\n >\n <span class=\" \">Tipo de Corrección:</span>\n <span\n :class=\"getStatusTypeClasses(data.statusType.description)\"\n class=\"whitespace-nowrap\"\n >\n {{ data.statusType.description }}\n </span>\n </p>\n\n <Divider />\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Rut Cliente: <b>{{ rutFormatter(data.clientData.rut) }}</b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Nombre Cliente: <b>{{ data.clientData.name }}</b>\n </p>\n\n <template v-if=\"data.status.description != 'Corregido'\">\n <div\n v-if=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n \"\n >\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n v-if=\"isAnalist && data.status.description != 'En Corrección'\"\n >\n <span class=\"text-sm flex-1\"\n >Monto en {{ data.currencyType.description }}:</span\n >\n <div style=\"width: 140px; height: 35px\">\n <InputNumber\n inputClass=\" w-[140px] h-[35px]\"\n :disabled=\"disabledInput\"\n v-model=\"data.amount\"\n :inputId=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n ? 'integeronly'\n : 'minmaxfraction'\n \"\n :minFractionDigits=\"data.currencyType.id === 1 ? 0 : 2\"\n :maxFractionDigits=\"5\"\n fluid\n />\n </div>\n </div>\n <p\n v-else\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Monto en {{ data.currencyType.description }}:\n <b>{{\n data.operationType === 1 || data.operationType === 2\n ? formatPrice(data.amount, \"$\")\n : formatPrice(data.amount, \"$\", 2)\n }}</b>\n </p>\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n v-if=\"isAnalist && data.status.description != 'En Corrección'\"\n >\n Banco\n {{\n data.operationType === 4 || data.operationType === 6\n ? \"Pagador\"\n : \"Credicorp\"\n }}:\n <div>\n <div style=\"width: 140px; height: 35px\">\n <CustomSelect\n :disabled=\"disabledInput\"\n class=\"w-35 h-8.75\"\n selectClass=\"items-center mt-2 text-sm !w-[140px] h-[35px]\"\n v-model=\"data.bankCrediCorp.id\"\n optionLabel=\"description\"\n optionValue=\"id\"\n placeholder=\"Seleccione\"\n :options=\"banksList\"\n />\n </div>\n </div>\n </div>\n <p\n v-else\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n Banco Credicorp: <b>{{ data.bankCrediCorp.description }}</b>\n </p>\n </div>\n <div v-else>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark\"\n >\n items-center\"> Monto en {{ data.currencyType.description }}:\n <b\n :style=\"{\n color: '#34a649',\n }\"\n >{{\n data.operationType === 4 || data.operationType === 6\n ? formatPrice(data.amount, \"\", 2)\n : formatPrice(data.amount, \"$\")\n }}</b\n >\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Banco Pagador:\n <b>{{ data.bankCrediCorp.description }}</b>\n </p>\n </div>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-2 mb-2\"\n >\n {{\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n ? \"Cuenta Credicorp\"\n : \"Cuenta Pagadora\"\n }}:\n <b>{{ data.bankCrediCorp.accountNumber }} </b>\n </p>\n </template>\n <template\n v-else-if=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n \"\n >\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b class=\"text-sm flex-1 mt-2\" style=\"color: #ea6b58\"\n >Monto Inicial en {{ data.currencyType.description }}:</b\n >\n <div style=\"width: 140px; height: 35px\">\n <InputNumber\n inputClass=\" w-[140px] h-[35px]\"\n :disabled=\"disabledInput\"\n v-model=\"data.amount\"\n :inputId=\"\n data.operationType === 1 ||\n data.operationType === 3 ||\n data.operationType === 5\n ? 'integeronly'\n : 'minmaxfraction'\n \"\n :minFractionDigits=\"data.currencyType.id === 1 ? 0 : 2\"\n :maxFractionDigits=\"5\"\n fluid\n />\n </div>\n </div>\n\n <div\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center font-700\"\n style=\"color: #ea6b58\"\n >\n <p>Banco Credicorp Inicial:</p>\n <div style=\"width: 140px; height: 35px\">\n <CustomSelect\n :disabled=\"disabledInput\"\n class=\"w-35 h-8.75\"\n selectClass=\"items-center mt-2 text-sm !w-[140px] h-[35px]\"\n v-model=\"data.bankCrediCorp.id\"\n optionLabel=\"description\"\n optionValue=\"id\"\n placeholder=\"Seleccione\"\n :options=\"banksList\"\n @change=\"changeBankCrediCorp(data.bankCrediCorp.id)\"\n />\n </div>\n </div>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center mt-3 mb-\"\n style=\"color: #ea6b58\"\n >\n <b> Cuenta Credicorp Inicial:</b>\n <b>{{ data.bankCrediCorp.accountNumber }} </b>\n </p>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b>Monto Final en {{ data.currencyType.description }}: </b>\n <b\n >{{\n data.operationType === 4 || data.operationType === 6\n ? formatPrice(amountFinal, \"\", 2)\n : formatPrice(amountFinal, \"\")\n }}\n </b>\n </p>\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b>Banco Credicorp Final:</b>\n <b>{{ bankFinal }} </b>\n </p>\n\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n <b>Cuenta Credicorp Final:</b>\n <b>{{ accountFinal }} </b>\n </p>\n </template>\n <template v-else>\n <p\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Monto En {{ data.currencyType.description }}:\n <b style=\"color: #34a649\"\n >{{\n data.operationType === 1 || data.operationType === 2\n ? formatPrice(data.amount, \"$\")\n : formatPrice(data.amount, \"$\", 2)\n }}\n </b>\n </p>\n <b\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Banco Pagador:\n <p>{{ data.bankCrediCorp.description }}</p>\n </b>\n <b\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n >\n Cuenta Pagadora:\n <p>{{ data.bankCrediCorp.accountNumber }}</p>\n </b>\n </template>\n <div\n v-if=\"isAnalist && data.status.description != 'En Corrección'\"\n class=\"flex justify-between text-text-primary dark:text-text-primary-dark items-center\"\n :class=\"data.status.description === 'Corregido' ? 'mb-1' : ''\"\n >\n <span class=\"text-sm flex-1\">Referencia:</span>\n <div style=\"width: 140px; height: 35px\">\n <!-- :disabled=\"disabledInput\" -->\n <CustomInput\n v-model=\"data.reference\"\n inputClass=\"w-[162px] h-[35px]\"\n :inputId=\"\n data.currencyType.id === 1 || data.currencyType.id === 2\n ? 'integeronly'\n : 'minmaxfraction'\n \"\n :minFractionDigits=\"\n data.currencyType.id === 1 || data.currencyType.id === 2 ? 0 : 2\n \"\n :maxFractionDigits=\"5\"\n fluid\n />\n </div>\n </div>\n <p v-else class=\"flex justify-between\">\n Referencia: <b>{{ data.reference }}</b>\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, computed, defineAsyncComponent } from \"vue\";\n\nconst CustomButton = defineAsyncComponent(\n () => import(\"../ui/CustomButton.vue\"),\n);\nconst CustomSelect = defineAsyncComponent(\n () => import(\"../ui/CustomSelect.vue\"),\n);\n\nimport { useCurrencyFormatter } from \"../../composables/useFormatPrice\";\nimport { rutFormatter } from \"@/utils/rutFormatter\";\n\nconst { formatPrice } = useCurrencyFormatter();\nconst props = defineProps({\n data: {\n type: Object,\n default: () => {},\n },\n banksList: {\n type: Array,\n default: () => [],\n },\n isAnalist: {\n type: Boolean,\n default: false,\n },\n});\n\nconst paymentDocumentData = ref<any>(null);\nconst showPaymentDocumentModal = ref(false);\nconst operationDetails = ref<any>(props.data);\nconst amountFinal = ref<number>(0);\nconst bankFinal = ref<string>(\"\");\nconst accountFinal = ref<string>(\"\");\n\nfunction init() {\n amountFinal.value = operationDetails.value.amount;\n bankFinal.value = operationDetails.value.bankCrediCorp.description;\n accountFinal.value = operationDetails.value.bankCrediCorp.accountNumber;\n props.data.amount = operationDetails.value.operationDetails[0].amount;\n props.data.bankCrediCorp.id =\n operationDetails.value.operationDetails[0].bankCrediCorp.id;\n props.data.bankCrediCorp.accountNumber =\n operationDetails.value.operationDetails[0].bankCrediCorp.accountNumber;\n}\n\nfunction getStatusTypeClasses(type: any): string[] {\n let baseClasses = [\"font-700 \"];\n if (type === \"Aprobado\") {\n baseClasses.push(\"text-icon-success\");\n } else if (type === \"Rechazado\") {\n baseClasses.push(\"text-text-error\");\n } else if (type === \"Devolución\") {\n baseClasses.push(\"text-accent-sky-60\");\n }\n return baseClasses;\n}\n\nfunction getStatusClasses(data: any): string[] {\n const baseClasses = [\n \"text-[10px]\",\n \"w-[95px]\",\n \"inline-flex\",\n \"justify-between\",\n \"items-center\",\n \"border\",\n \"px-2\",\n \"py-1\",\n \"rounded-md\",\n \"bg-surface-tertiary\",\n \"border-section-title\",\n \"dark:border-dark-border\",\n ];\n if (data.status.description === \"Pendiente\") {\n baseClasses.push(\n \"!text-primary-dark-border\",\n \"border-border-upload-excel!\",\n \"bg-dark-secondary!\",\n );\n } else if (data.status.description === \"En Corrección\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-neutral-gray-80!\",\n \"bg-surface-tertiary!\",\n );\n } else if (data.status.description === \"Corregido\") {\n if (data.statusType.description === \"Aprobado\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-forest-maid!\",\n \"bg-background-success-minimal!\",\n );\n } else if (data.statusType.description === \"Rechazado\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-helper-text!\",\n \"bg-background-error-minimal!\",\n );\n } else if (data.statusType.description === \"Devolución\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-border-focus!\",\n \"bg-background-info-minimal!\",\n );\n }\n } else if (data.status.description === \"Validado\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-icon-warning!\",\n \"bg-background-warning-minimal!\",\n );\n } else if (data.status.description === \"En Pago Unitario\") {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-uniform!\",\n \"bg-background-info-minimal!\",\n );\n } else if (data.status.id === 8) {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-forest-maid!\",\n \"bg-background-success-minimal!\",\n );\n } else if (data.status.id === 9) {\n baseClasses.push(\n \"text-text-primary!\",\n \"border-helper-text!\",\n \"bg-background-error-minimal!\",\n );\n }\n return baseClasses;\n}\n\nfunction showPaymentDocument(data: any) {\n // TODO: se debe eliminar data porq lo q abre es una vista sin nada pero con una imagen dentro que lo entrega el backend\n paymentDocumentData.value = data;\n showPaymentDocumentModal.value = true;\n}\n\nfunction changeBankCrediCorp(bankId: number) {\n type Bank = { id: number; description: string; accountNumber: string };\n let row: Bank | undefined = props.banksList.find(\n (bank: any) => bank.id === bankId,\n ) as Bank | undefined;\n if (row) {\n props.data.bankCrediCorp.id = row.id;\n props.data.bankCrediCorp.description = row.description;\n props.data.bankCrediCorp.accountNumber = row.accountNumber;\n }\n}\n\nconst disabledInput = computed(() => {\n return (\n props.data.status.description === \"Validado\" ||\n props.data.statusType.description === \"Rechazado\" ||\n props.data.status.description === \"En Corrección\"\n );\n});\n\nonMounted(() => {\n init();\n});\n</script>\n"],"names":["CustomButton","defineAsyncComponent","import","CustomSelect","formatPrice","useCurrencyFormatter","props","__props","paymentDocumentData","ref","showPaymentDocumentModal","operationDetails","data","amountFinal","bankFinal","accountFinal","getStatusTypeClasses","type","baseClasses","push","getStatusClasses","status","description","statusType","id","disabledInput","computed","onMounted","value","amount","bankCrediCorp","accountNumber","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_toDisplayString","dateTime","_hoisted_4","folio","_createVNode","_component_Divider","_hoisted_5","transactionType","_hoisted_6","currencyType","_hoisted_7","paymentMethod","_hoisted_8","thirdPartyPayment","_hoisted_9","secuency","_hoisted_10","_unref","class","icon","iconClass","variant","label","onClick","_cache","$event","showPaymentDocument","_hoisted_11","_normalizeClass","_hoisted_12","_hoisted_13","rutFormatter","clientData","rut","_hoisted_14","name","_Fragment","key","operationType","_hoisted_15","isAnalist","_hoisted_16","_hoisted_17","_hoisted_18","_component_InputNumber","inputClass","disabled","modelValue","inputId","minFractionDigits","maxFractionDigits","fluid","_hoisted_19","_createTextVNode","_hoisted_20","_hoisted_21","selectClass","optionLabel","optionValue","placeholder","options","banksList","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","onChange","bankId","row","find","bank","changeBankCrediCorp","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","_hoisted_40","_hoisted_41","_component_CustomInput","reference","_hoisted_42"],"mappings":"+sHA6VA,MAAMA,GAAeC,EACnB,IAAMC,OAAO,8BAETC,GAAeF,EACnB,IAAMC,OAAO,+BAMTE,YAAEA,IAAgBC,IAClBC,GAAQC,EAeRC,GAAsBC,EAAS,MAC/BC,GAA2BD,GAAI,GAC/BE,GAAmBF,EAASH,GAAMM,MAClCC,GAAcJ,EAAY,GAC1BK,GAAYL,EAAY,IACxBM,GAAeN,EAAY,IAajC,SAASO,GAAqBC,GAC5B,IAAIC,EAAc,CAAC,aAQnB,MAPa,aAATD,EACFC,EAAYC,KAAK,qBACC,cAATF,EACTC,EAAYC,KAAK,mBACC,eAATF,GACTC,EAAYC,KAAK,sBAEZD,CACT,CAEA,SAASE,GAAiBR,GACxB,MAAMM,EAAc,CAClB,cACA,WACA,cACA,kBACA,eACA,SACA,OACA,OACA,aACA,sBACA,uBACA,2BA2DF,MAzDgC,cAA5BN,EAAKS,OAAOC,YACdJ,EAAYC,KACV,4BACA,8BACA,sBAEmC,kBAA5BP,EAAKS,OAAOC,YACrBJ,EAAYC,KACV,qBACA,0BACA,wBAEmC,cAA5BP,EAAKS,OAAOC,YACe,aAAhCV,EAAKW,WAAWD,YAClBJ,EAAYC,KACV,qBACA,sBACA,kCAEuC,cAAhCP,EA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AmD,CAAYhD,EAAAK,KAAKiB,OAAM,IAAA,IAAA,KAMpJM,EAKI,IALJwF,GAKI,iBAHH,oBAEC,IAAAxF,EAA2C,IAAA,KAAAG,EAArC/B,EAAAK,KAAKkB,cAAcR,aAAW,KAEtCa,EAKI,IALJyF,GAKI,iBAHH,sBAEC,IAAAzF,EAA6C,IAAA,KAAAG,EAAvC/B,EAAAK,KAAKkB,cAAcC,eAAa,WAIlCxB,EAAAuE,WAAoC,iBAAvBvE,EAAAK,KAAKS,OAAOC,iBADjCW,EAuBM,MAAA,OArBJuB,SAAM,kFACyB,cAAvBjD,OAAKc,OAAOC,YAAW,OAAA,OAE/BwC,EAAA,MAAAA,EAAA,IAAA3B,EAA+C,OAAA,CAAzCqB,MAAM,kBAAiB,eAAW,IACxCrB,EAgBM,MAhBN0F,GAgBM,CAdJnF,EAaEoF,EAAA,CAZSzC,WAAA9E,EAAAK,KAAKmH,UAAL,sBAAAjE,EAAA,KAAAA,EAAA,GAAAC,GAAAxD,EAAAK,KAAKmH,UAAShE,GACvBoB,WAAW,qBACVG,YAAwB/E,EAAAK,KAAKmC,aAAavB,IAAgC,IAApBjB,EAAAK,KAAKmC,aAAavB,kCAKxE+D,sBAAkChF,EAAAK,KAAKmC,aAAavB,IAAgC,IAApBjB,EAAAK,KAAKmC,aAAavB,GAAE,EAAA,EAGpFgE,kBAAmB,EACpBC,MAAA,iEAINzD,IAAAC,EAEI,IAFJ+F,GAEI,iBAFmC,iBACzB,IAAA7F,EAA2B,IAAA,KAAAG,EAArB/B,EAAAK,KAAKmH,WAAS"}
@@ -1 +1 @@
1
- import t from"./CustomInput.vue2.js";/* empty css */import o from"../../_virtual/_plugin-vue_export-helper.js";const p=/* @__PURE__ */o(t,[["__scopeId","data-v-18df4369"]]);export{p as default};
1
+ import t from"./CustomInput.vue2.js";/* empty css */import o from"../../_virtual/_plugin-vue_export-helper.js";const p=/* @__PURE__ */o(t,[["__scopeId","data-v-fa58f03f"]]);export{p as default};
@@ -1 +1 @@
1
- import e from"primevue/iconfield";import t from"primevue/inputtext";import a from"primevue/inputicon";import{defineComponent as l,ref as r,computed as n,watch as i,resolveComponent as o,openBlock as u,createElementBlock as c,createElementVNode as d,normalizeClass as s,createTextVNode as p,toDisplayString as m,createCommentVNode as f,createVNode as x,withCtx as y,createBlock as b,Transition as v}from"vue";const g={class:"relative flex flex-col"},h={key:0},k=["for"],L={key:0,class:"ml-1"},B={key:1,class:"text-text-secondary text-[12px] mt-1.5 font-500 leading-4 tracking-[-0.2px] dark:text-text-primary-dark!"},S={key:2,class:"h-4 mt-1 relative w-full"},N=["id"],w=["title"],C=/* @__PURE__ */l({__name:"CustomInput",props:{modelValue:{type:[String,Number],default:""},label:String,type:{type:String,default:"text"},placeholder:{type:String,default:""},disabled:Boolean,icon:{type:String,default:""},iconPosition:{type:String,default:"left",validator:e=>["left","right"].includes(e)},inputClass:{type:String,default:""},labelClass:{type:String,default:""},allowLabelWrap:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{type:String,default:""},minLength:{type:Number,default:0},maxLength:{type:Number,default:0},min:{type:[Number,String],default:null},max:{type:[Number,String],default:null},limitNumber:{type:Number,default:0},exactLengths:{type:Array,default:()=>[]},validationMode:{type:String,default:"onInput",validator:e=>["onInput","onBlur","manual"].includes(e)},helper:String,eye:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},checkInput:{type:Boolean,default:!1},showRequiredLabel:{type:Boolean,default:void 0},noErrorContainer:{type:Boolean,default:!1}},emits:["update:modelValue","blur-xs","blur","icon-click"],setup(l,{emit:C}){const V=l,$=C,P=r(V.modelValue?.toString?.()??""),D=r(!1),q=r(!1),I=r(""),_=n(()=>D.value?"text":V.type),M=n(()=>"text"===V.type?V.maxLength||(null!=V.max?Number(V.max):void 0):void 0),E=n(()=>"text"===V.type?V.minLength||(null!=V.min?Number(V.min):void 0):void 0),R=n(()=>Boolean(V.error||I.value)),W=n(()=>V.error?V.error:I.value?I.value:""),j=n(()=>V.label?`${V.label}-error`:void 0);function A(){I.value=function(e){const t=function(e){return V.required&&q.value&&0===e.length?"Este campo es obligatorio":""}(e);if(t)return t;const a=function(e){if("number"!==V.type)return"";const t=e.length;return V.limitNumber>0&&t>0&&t!==V.limitNumber?`Debe tener exactamente ${V.limitNumber} números`:""}(e);if(a)return a;const l=function(e){if(0===V.exactLengths.length)return"";const t=e.length;return t>0&&!V.exactLengths.includes(t)?`Debe tener exactamente ${V.exactLengths.join(" o ")} caracteres`:""}(e);if(l)return l;return function(e){const t=e.length,a=V.minLength>0?V.minLength:0,l=V.maxLength>0?V.maxLength:0;if(a>0&&l>0){if(t>0&&(t<a||t>l))return a===l?`Debe tener exactamente ${a} caracteres`:`Debe tener entre ${a} y ${l} caracteres`}else if(a>0){if(t>0&&t<a)return`Debe tener al menos ${a} caracteres`}else if(l>0&&t>l)return`Debe tener máximo ${l} caracteres`;return""}(e)||""}(P.value)}function O(){D.value=!D.value}function U(){P.value="",I.value="",q.value=!1,$("update:modelValue","")}return i(()=>V.modelValue,e=>{const t=null!=e?e.toString():"";P.value!==t&&(P.value=t)},{immediate:!0}),i(P,e=>{$("update:modelValue",e),"manual"!==V.validationMode&&("onBlur"!==V.validationMode||q.value)&&A()}),i(()=>V.error,e=>{e&&P.value&&(I.value="")}),(r,n)=>{const i=o("font-awesome-icon"),C=a,I=t,z=e;return u(),c("div",g,[l.label?(u(),c("div",h,[d("label",{for:l.label,class:s(["text-text-primary text-sm font-medium dark:text-text-primary-dark",[l.labelClass,l.allowLabelWrap?"":"label-wrapper"]])},[p(m(l.label)+" ",1),V.showRequiredLabel??l.required?(u(),c("span",L,[...n[3]||(n[3]=[p(" (Obligatorio)",-1),d("span",{class:"text-text-error"},"*",-1)])])):f("",!0)],10,k)])):f("",!0),x(z,{class:"relative w-full"},{default:y(()=>[l.icon&&"left"===l.iconPosition?(u(),b(C,{key:0,class:"left-icon"},{default:y(()=>[x(i,{icon:l.icon,class:"text-icon-left dark:text-text-primary-dark"},null,8,["icon"])]),_:1})):f("",!0),x(I,{modelValue:P.value,"onUpdate:modelValue":n[0]||(n[0]=e=>P.value=e),name:l.label,type:_.value,placeholder:l.placeholder,disabled:l.disabled,maxlength:M.value,minlength:E.value,onBlur:n[1]||(n[1]=e=>{return t=e,q.value=!0,"manual"!==V.validationMode&&A(),void(V.checkInput&&$("blur",t));var t}),class:s(["w-full cursor-pointer dark:bg-surface-primary! dark:placeholder-text-primary-dark dark:border-dark-border dark:text-text-primary-dark!",{"border-helper-text!":R.value,"pl-10":l.icon&&"left"===l.iconPosition,"pr-10":l.eye||l.clearable||l.icon&&"right"===l.iconPosition,[l.inputClass]:!0}]),"aria-invalid":R.value,"aria-describedby":j.value},null,8,["modelValue","name","type","placeholder","disabled","maxlength","minlength","class","aria-invalid","aria-describedby"]),l.icon&&"right"===l.iconPosition?(u(),c("button",{key:1,type:"button",class:"positionButton right-icon",onClick:n[2]||(n[2]=e=>r.$emit("icon-click"))},[x(i,{icon:l.icon,class:"text-icon-right dark:text-text-primary-dark"},null,8,["icon"])])):f("",!0),l.eye?(u(),c("button",{key:2,type:"button",onClick:O,class:s(["positionButton",{"right-12":l.icon&&"right"===l.iconPosition}])},[x(i,{icon:D.value?"fa-solid fa-eye-slash":"fa-solid fa-eye",class:"text-icon-right dark:text-text-primary-dark"},null,8,["icon"])],2)):f("",!0),l.clearable?(u(),c("button",{key:3,type:"button",onClick:U,class:s(["positionButton",{"right-12":l.icon&&"right"===l.iconPosition||l.eye}])},[x(i,{icon:"fa-solid fa-circle-xmark",class:"text-icon-right dark:text-text-primary-dark"})],2)):f("",!0)]),_:1}),l.helper?(u(),c("p",B,[x(i,{icon:"fa-solid fa-circle-info",class:s(["text-[11px] text-accent-sky-60 font-900 align-center leading-3",{"text-text-secondary":l.disabled}])},null,8,["class"]),p(" "+m(l.helper),1)])):f("",!0),V.noErrorContainer?f("",!0):(u(),c("div",S,[x(v,{name:"fade"},{default:y(()=>[W.value?(u(),c("p",{key:0,class:"absolute left-0 top-0 text-helper-text text-[10px] leading-3 flex items-center gap-1 w-full",id:j.value},[x(i,{icon:"fa-solid fa-circle-xmark",class:"text-helper-text shrink-0"}),d("span",{class:"truncate flex-1",title:W.value},m(W.value),9,w)],8,N)):f("",!0)]),_:1})]))])}}});export{C as default};
1
+ import e from"primevue/iconfield";import t from"primevue/inputtext";import a from"primevue/inputicon";import{defineComponent as l,ref as r,computed as n,watch as i,resolveComponent as o,openBlock as u,createElementBlock as c,createElementVNode as s,normalizeClass as d,createTextVNode as p,toDisplayString as m,createCommentVNode as f,createVNode as x,withCtx as y,createBlock as b,Transition as v}from"vue";const g={class:"relative flex flex-col"},h={key:0},k=["for"],L={key:0,class:"ml-1"},B={key:1,class:"text-text-secondary text-[12px] mt-1.5 font-500 leading-4 tracking-[-0.2px] dark:text-text-primary-dark!"},S={key:2,class:"h-4 mt-1 relative w-full"},N=["id"],w=["title"],C=/* @__PURE__ */l({__name:"CustomInput",props:{modelValue:{type:[String,Number],default:""},label:String,type:{type:String,default:"text"},placeholder:{type:String,default:""},disabled:Boolean,icon:{type:String,default:""},iconPosition:{type:String,default:"left",validator:e=>["left","right"].includes(e)},inputClass:{type:String,default:""},labelClass:{type:String,default:""},allowLabelWrap:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{type:String,default:""},minLength:{type:Number,default:0},maxLength:{type:Number,default:0},min:{type:[Number,String],default:null},max:{type:[Number,String],default:null},limitNumber:{type:Number,default:0},exactLengths:{type:Array,default:()=>[]},validationMode:{type:String,default:"onInput",validator:e=>["onInput","onBlur","manual"].includes(e)},helper:String,eye:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},checkInput:{type:Boolean,default:!1},showRequiredLabel:{type:Boolean,default:void 0},noErrorContainer:{type:Boolean,default:!1}},emits:["update:modelValue","blur-xs","blur","icon-click"],setup(l,{emit:C}){const P=l,V=C,$=r(P.modelValue?.toString?.()??""),D=r(!1),q=r(!1),I=r(""),_=n(()=>D.value?"text":P.type),M=n(()=>"text"===P.type?P.maxLength||(null!=P.max?Number(P.max):void 0):void 0),E=n(()=>"text"===P.type?P.minLength||(null!=P.min?Number(P.min):void 0):void 0),R=n(()=>Boolean(P.error||I.value)),W=n(()=>P.error?P.error:I.value?I.value:""),j=n(()=>P.label?`${P.label}-error`:void 0);function A(){I.value=function(e){const t=function(e){return P.required&&q.value&&0===e.length?"Este campo es obligatorio":""}(e);if(t)return t;const a=function(e){if("number"!==P.type)return"";const t=e.length;return P.limitNumber>0&&t>0&&t!==P.limitNumber?`Debe tener exactamente ${P.limitNumber} números`:""}(e);if(a)return a;const l=function(e){if(0===P.exactLengths.length)return"";const t=e.length;return t>0&&!P.exactLengths.includes(t)?`Debe tener exactamente ${P.exactLengths.join(" o ")} caracteres`:""}(e);if(l)return l;return function(e){const t=e.length,a=P.minLength>0?P.minLength:0,l=P.maxLength>0?P.maxLength:0;if(a>0&&l>0){if(t>0&&(t<a||t>l))return a===l?`Debe tener exactamente ${a} caracteres`:`Debe tener entre ${a} y ${l} caracteres`}else if(a>0){if(t>0&&t<a)return`Debe tener al menos ${a} caracteres`}else if(l>0&&t>l)return`Debe tener máximo ${l} caracteres`;return""}(e)||""}($.value)}function O(){D.value=!D.value}function U(){$.value="",I.value="",q.value=!1,V("update:modelValue","")}return i(()=>P.modelValue,e=>{const t=null!=e?e.toString():"";$.value!==t&&($.value=t)},{immediate:!0}),i($,e=>{V("update:modelValue",e),"manual"!==P.validationMode&&("onBlur"!==P.validationMode||q.value)&&A()}),i(()=>P.error,e=>{e&&$.value&&(I.value="")}),(r,n)=>{const i=o("font-awesome-icon"),C=a,I=t,z=e;return u(),c("div",g,[l.label?(u(),c("div",h,[s("label",{for:l.label,class:d(["text-text-primary text-sm font-medium dark:text-text-primary-dark",[l.labelClass,l.allowLabelWrap?"":"label-wrapper"]])},[p(m(l.label)+" ",1),P.showRequiredLabel??l.required?(u(),c("span",L,[...n[3]||(n[3]=[p(" (Obligatorio)",-1),s("span",{class:"text-text-error"},"*",-1)])])):f("",!0)],10,k)])):f("",!0),x(z,{iconPosition:l.iconPosition,class:"relative w-full"},{default:y(()=>[l.icon&&"left"===l.iconPosition?(u(),b(C,{key:0,class:"left-icon"},{default:y(()=>[x(i,{icon:l.icon,class:"text-icon-left dark:text-text-primary-dark"},null,8,["icon"])]),_:1})):f("",!0),x(I,{modelValue:$.value,"onUpdate:modelValue":n[0]||(n[0]=e=>$.value=e),name:l.label,type:_.value,placeholder:l.placeholder,disabled:l.disabled,maxlength:M.value,minlength:E.value,onBlur:n[1]||(n[1]=e=>{return t=e,q.value=!0,"manual"!==P.validationMode&&A(),void(P.checkInput&&V("blur",t));var t}),class:d(["w-full cursor-pointer dark:bg-surface-primary! dark:placeholder-text-primary-dark dark:border-dark-border dark:text-text-primary-dark!",{"border-helper-text!":R.value,"pl-10":l.icon&&"left"===l.iconPosition,"pr-10":l.eye||l.clearable||l.icon&&"right"===l.iconPosition,[l.inputClass]:!0}]),"aria-invalid":R.value,"aria-describedby":j.value},null,8,["modelValue","name","type","placeholder","disabled","maxlength","minlength","class","aria-invalid","aria-describedby"]),l.icon&&"right"===l.iconPosition?(u(),c("button",{key:1,type:"button",class:"positionButton right-icon",onClick:n[2]||(n[2]=e=>r.$emit("icon-click"))},[x(i,{icon:l.icon,class:"text-icon-right dark:text-text-primary-dark"},null,8,["icon"])])):f("",!0),l.eye?(u(),c("button",{key:2,type:"button",onClick:O,class:d(["positionButton",{"right-12":l.icon&&"right"===l.iconPosition}])},[x(i,{icon:D.value?"fa-solid fa-eye-slash":"fa-solid fa-eye",class:"text-icon-right dark:text-text-primary-dark"},null,8,["icon"])],2)):f("",!0),l.clearable?(u(),c("button",{key:3,type:"button",onClick:U,class:d(["positionButton",{"right-12":l.icon&&"right"===l.iconPosition||l.eye}])},[x(i,{icon:"fa-solid fa-circle-xmark",class:"text-icon-right dark:text-text-primary-dark"})],2)):f("",!0)]),_:1},8,["iconPosition"]),l.helper?(u(),c("p",B,[x(i,{icon:"fa-solid fa-circle-info",class:d(["text-[11px] text-accent-sky-60 font-900 align-center leading-3",{"text-text-secondary":l.disabled}])},null,8,["class"]),p(" "+m(l.helper),1)])):f("",!0),P.noErrorContainer?f("",!0):(u(),c("div",S,[x(v,{name:"fade"},{default:y(()=>[W.value?(u(),c("p",{key:0,class:"absolute left-0 top-0 text-helper-text text-[10px] leading-3 flex items-center gap-1 w-full",id:j.value},[x(i,{icon:"fa-solid fa-circle-xmark",class:"text-helper-text shrink-0"}),s("span",{class:"truncate flex-1",title:W.value},m(W.value),9,w)],8,N)):f("",!0)]),_:1})]))])}}});export{C as default};
@@ -1 +1 @@
1
- {"version":3,"file":"CustomInput.vue2.js","sources":["../../../src/components/ui/CustomInput.vue"],"sourcesContent":["<template>\n <div class=\"relative flex flex-col\">\n <div v-if=\"label\">\n <label\n :for=\"label\"\n class=\"text-text-primary text-sm font-medium dark:text-text-primary-dark\"\n :class=\"[labelClass, allowLabelWrap ? '' : 'label-wrapper']\"\n >\n {{ label }}\n <span v-if=\"props.showRequiredLabel ?? required\" class=\"ml-1\">\n (Obligatorio)<span class=\"text-text-error\">*</span>\n </span>\n </label>\n </div>\n <IconField class=\"relative w-full\">\n <!-- Icono a la izquierda -->\n <InputIcon v-if=\"icon && iconPosition === 'left'\" class=\"left-icon\">\n <font-awesome-icon\n :icon=\"icon\"\n class=\"text-icon-left dark:text-text-primary-dark\"\n />\n </InputIcon>\n\n <InputText\n v-model=\"model\"\n :name=\"label\"\n :type=\"inputType\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :maxlength=\"textMaxLength\"\n :minlength=\"textMinLength\"\n @blur=\"handleEmitBlur($event)\"\n class=\"w-full cursor-pointer dark:bg-surface-primary! dark:placeholder-text-primary-dark dark:border-dark-border dark:text-text-primary-dark!\"\n :class=\"{\n 'border-helper-text!': hasError,\n 'pl-10': icon && iconPosition === 'left',\n 'pr-10': eye || clearable || (icon && iconPosition === 'right'),\n [inputClass]: true,\n }\"\n :aria-invalid=\"hasError\"\n :aria-describedby=\"errorId\"\n />\n\n <button\n v-if=\"icon && iconPosition === 'right'\"\n type=\"button\"\n class=\"positionButton right-icon\"\n @click=\"$emit('icon-click')\"\n >\n <font-awesome-icon\n :icon=\"icon\"\n class=\"text-icon-right dark:text-text-primary-dark\"\n />\n </button>\n\n <button\n v-if=\"eye\"\n type=\"button\"\n @click=\"togglePassword\"\n class=\"positionButton\"\n :class=\"{ 'right-12': icon && iconPosition === 'right' }\"\n >\n <font-awesome-icon\n :icon=\"\n isPasswordVisible ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye'\n \"\n class=\"text-icon-right dark:text-text-primary-dark\"\n />\n </button>\n\n <button\n v-if=\"clearable\"\n type=\"button\"\n @click=\"clearInput\"\n class=\"positionButton\"\n :class=\"{ 'right-12': (icon && iconPosition === 'right') || eye }\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-xmark\"\n class=\"text-icon-right dark:text-text-primary-dark\"\n />\n </button>\n </IconField>\n <p\n v-if=\"helper\"\n class=\"text-text-secondary text-[12px] mt-1.5 font-500 leading-4 tracking-[-0.2px] dark:text-text-primary-dark!\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-info\"\n class=\"text-[11px] text-accent-sky-60 font-900 align-center leading-3\"\n :class=\"{ 'text-text-secondary': disabled }\"\n />\n {{ helper }}\n </p>\n\n <!-- Contenedor fijo para error/validación -->\n <div v-if=\"!props.noErrorContainer\" class=\"h-4 mt-1 relative w-full\">\n <transition name=\"fade\">\n <p\n v-if=\"displayError\"\n class=\"absolute left-0 top-0 text-helper-text text-[10px] leading-3 flex items-center gap-1 w-full\"\n :id=\"errorId\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-xmark\"\n class=\"text-helper-text shrink-0\"\n />\n <span class=\"truncate flex-1\" :title=\"displayError\">{{\n displayError\n }}</span>\n </p>\n </transition>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\n// ============================================================================\n// Props\n// ============================================================================\nconst props = defineProps({\n // Model\n modelValue: {\n type: [String, Number],\n default: \"\",\n },\n\n // Basic input props\n label: String,\n type: {\n type: String,\n default: \"text\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n disabled: Boolean,\n\n // Icon props\n icon: {\n type: String,\n default: \"\",\n },\n iconPosition: {\n type: String,\n default: \"left\",\n validator: (value: string) => [\"left\", \"right\"].includes(value),\n },\n\n // Style props\n inputClass: {\n type: String,\n default: \"\",\n },\n labelClass: {\n type: String,\n default: \"\",\n },\n allowLabelWrap: {\n type: Boolean,\n default: false,\n },\n\n // Validation props\n required: {\n type: Boolean,\n default: false,\n },\n error: {\n type: String,\n default: \"\",\n },\n minLength: {\n type: Number,\n default: 0,\n },\n maxLength: {\n type: Number,\n default: 0,\n },\n min: {\n type: [Number, String],\n default: null,\n },\n max: {\n type: [Number, String],\n default: null,\n },\n limitNumber: {\n type: Number,\n default: 0,\n },\n exactLengths: {\n type: Array as () => number[],\n default: () => [],\n },\n validationMode: {\n type: String,\n default: \"onInput\",\n validator: (value: string) =>\n [\"onInput\", \"onBlur\", \"manual\"].includes(value),\n },\n\n // Feature props\n helper: String,\n eye: {\n type: Boolean,\n default: false,\n },\n clearable: {\n type: Boolean,\n default: false,\n },\n checkInput: {\n type: Boolean,\n default: false,\n },\n showRequiredLabel: {\n type: Boolean,\n default: undefined,\n },\n noErrorContainer: {\n type: Boolean,\n default: false,\n },\n});\n\n// ============================================================================\n// Emits\n// ============================================================================\nconst emit = defineEmits([\n \"update:modelValue\",\n \"blur-xs\",\n \"blur\",\n \"icon-click\",\n]);\n\n// ============================================================================\n// State\n// ============================================================================\nconst model = ref(props.modelValue?.toString?.() ?? \"\");\nconst isPasswordVisible = ref(false);\nconst touched = ref(false);\nconst validationError = ref(\"\");\n\n// ============================================================================\n// Computed Properties\n// ============================================================================\nconst inputType = computed(() =>\n isPasswordVisible.value ? \"text\" : props.type,\n);\n\nconst textMaxLength = computed(() =>\n props.type === \"text\"\n ? props.maxLength || (props.max != null ? Number(props.max) : undefined)\n : undefined,\n);\n\nconst textMinLength = computed(() =>\n props.type === \"text\"\n ? props.minLength || (props.min != null ? Number(props.min) : undefined)\n : undefined,\n);\n\nconst hasError = computed(() => Boolean(props.error || validationError.value));\n\nconst displayError = computed(() => {\n // Prioridad: error externo > error de validación interna\n if (props.error) return props.error;\n if (validationError.value) return validationError.value;\n return \"\";\n});\n\nconst errorId = computed(() =>\n props.label ? `${props.label}-error` : undefined,\n);\n\n// ============================================================================\n// Validation Logic\n// ============================================================================\nfunction validateRequired(value: string): string {\n if (props.required && touched.value && value.length === 0) {\n return \"Este campo es obligatorio\";\n }\n return \"\";\n}\n\nfunction validateNumber(value: string): string {\n if (props.type !== \"number\") return \"\";\n\n const length = value.length;\n if (props.limitNumber > 0 && length > 0 && length !== props.limitNumber) {\n return `Debe tener exactamente ${props.limitNumber} números`;\n }\n return \"\";\n}\n\nfunction validateExactLength(value: string): string {\n if (props.exactLengths.length === 0) return \"\";\n\n const length = value.length;\n if (length > 0 && !props.exactLengths.includes(length)) {\n return `Debe tener exactamente ${props.exactLengths.join(\" o \")} caracteres`;\n }\n return \"\";\n}\n\nfunction validateMinMaxLength(value: string): string {\n const length = value.length;\n const min = props.minLength > 0 ? props.minLength : 0;\n const max = props.maxLength > 0 ? props.maxLength : 0;\n\n if (min > 0 && max > 0) {\n if (length > 0 && (length < min || length > max)) {\n if (min === max) {\n return `Debe tener exactamente ${min} caracteres`;\n }\n\n return `Debe tener entre ${min} y ${max} caracteres`;\n }\n } else if (min > 0) {\n if (length > 0 && length < min) {\n return `Debe tener al menos ${min} caracteres`;\n }\n } else if (max > 0) {\n if (length > max) {\n return `Debe tener máximo ${max} caracteres`;\n }\n }\n\n return \"\";\n}\n\nfunction getErrorForValue(value: string): string {\n // Validar en orden de prioridad\n const requiredError = validateRequired(value);\n if (requiredError) return requiredError;\n\n const numberError = validateNumber(value);\n if (numberError) return numberError;\n\n const exactLengthError = validateExactLength(value);\n if (exactLengthError) return exactLengthError;\n\n const minMaxError = validateMinMaxLength(value);\n if (minMaxError) return minMaxError;\n\n return \"\";\n}\n\nfunction runValidation(): void {\n validationError.value = getErrorForValue(model.value);\n}\n\n// ============================================================================\n// Methods\n// ============================================================================\nfunction togglePassword(): void {\n isPasswordVisible.value = !isPasswordVisible.value;\n}\n\nfunction clearInput(): void {\n model.value = \"\";\n validationError.value = \"\";\n touched.value = false;\n emit(\"update:modelValue\", \"\");\n}\n\nfunction handleEmitBlur(event: Event): void {\n touched.value = true;\n\n if (props.validationMode !== \"manual\") {\n runValidation();\n }\n\n if (props.checkInput) {\n emit(\"blur\", event);\n }\n}\n\n// ============================================================================\n// Watchers\n// ============================================================================\nwatch(\n () => props.modelValue,\n (newValue) => {\n const stringValue = newValue != null ? newValue.toString() : \"\";\n if (model.value !== stringValue) {\n model.value = stringValue;\n }\n },\n { immediate: true },\n);\n\nwatch(model, (newValue) => {\n emit(\"update:modelValue\", newValue);\n\n // Manejar validación según el modo\n if (props.validationMode === \"manual\") {\n // En modo manual no validar automáticamente\n return;\n }\n\n if (props.validationMode === \"onBlur\" && !touched.value) {\n // En modo onBlur solo validar después de tocar el campo\n return;\n }\n\n // Modo onInput o después de blur\n runValidation();\n});\n\n// Limpiar error externo cuando el usuario empieza a escribir\nwatch(\n () => props.error,\n (newError) => {\n if (newError && model.value) {\n // Si hay un error externo y el usuario tiene contenido,\n // limpiar la validación interna para mostrar solo el error externo\n validationError.value = \"\";\n }\n },\n);\n</script>\n\n<style scoped>\n@reference \"../../assets/main.css\";\n\n.p-select-label {\n display: flex !important;\n align-items: center !important;\n}\n\n.label-wrapper {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n}\n\n.text-text-primary {\n margin-right: 4px;\n}\n\n.positionButton {\n @apply absolute right-4 top-1/2 transform -translate-y-1/2;\n}\n\n.left-icon {\n @apply absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none z-10;\n color: var(--color-icon-left);\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.right-icon {\n @apply absolute right-4 top-1/2 transform -translate-y-1/2;\n}\n\n.right-12 {\n @apply right-12;\n}\n\n.p-inputtext.pl-10 {\n padding-left: 2.5rem !important;\n}\n\n.p-inputtext.pl-12 {\n padding-left: 2.5rem !important;\n}\n</style>\n"],"names":["props","__props","emit","__emit","model","ref","modelValue","toString","isPasswordVisible","touched","validationError","inputType","computed","value","type","textMaxLength","maxLength","max","Number","textMinLength","minLength","min","hasError","Boolean","error","displayError","errorId","label","runValidation","requiredError","required","length","validateRequired","numberError","limitNumber","validateNumber","exactLengthError","exactLengths","includes","join","validateExactLength","validateMinMaxLength","getErrorForValue","togglePassword","clearInput","watch","newValue","stringValue","immediate","validationMode","newError","_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","for","class","_normalizeClass","labelClass","allowLabelWrap","_createTextVNode","_toDisplayString","showRequiredLabel","_hoisted_4","_cache","_createVNode","_component_IconField","icon","iconPosition","_createBlock","_component_InputIcon","_component_font_awesome_icon","_component_InputText","$event","name","placeholder","disabled","maxlength","minlength","onBlur","handleEmitBlur","event","checkInput","eye","clearable","inputClass","onClick","$emit","helper","_hoisted_5","noErrorContainer","_hoisted_6","_Transition","id","title","_hoisted_8"],"mappings":"kvDA0HA,MAAMA,EAAQC,EA+GRC,EAAOC,EAUPC,EAAQC,EAAIL,EAAMM,YAAYC,cAAgB,IAC9CC,EAAoBH,GAAI,GACxBI,EAAUJ,GAAI,GACdK,EAAkBL,EAAI,IAKtBM,EAAYC,EAAS,IACzBJ,EAAkBK,MAAQ,OAASb,EAAMc,MAGrCC,EAAgBH,EAAS,IACd,SAAfZ,EAAMc,KACFd,EAAMgB,YAA2B,MAAbhB,EAAMiB,IAAcC,OAAOlB,EAAMiB,UAAO,QAC5D,GAGAE,EAAgBP,EAAS,IACd,SAAfZ,EAAMc,KACFd,EAAMoB,YAA2B,MAAbpB,EAAMqB,IAAcH,OAAOlB,EAAMqB,UAAO,QAC5D,GAGAC,EAAWV,EAAS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B,CAAA,WACCxD,kBAAQA,EAAAoE,cAA6BpE,EAAAmF,SAE5DlB,EAGEM,EAAA,CAFAJ,KAAK,2BACLX,MAAM,sEAKJxD,EAAAwF,QADRtC,IAAAC,EAUI,IAVJsC,EAUI,CANFxB,EAIEM,EAAA,CAHAJ,KAAK,0BACLX,MAAKC,EAAA,CAAC,iEAAgE,CAAA,sBACrCzD,EAAA4E,+BACjChB,EAAA,MACC5D,EAAAwF,QAAM,eAICzF,EAAM2F,2BAAlBxC,IAAAC,EAgBM,MAhBNwC,EAgBM,CAfJ1B,EAca2B,EAAA,CAdDlB,KAAK,QAAM,WACrB,IAYI,CAXIlD,EAAAZ,WADRuC,EAYI,IAAA,OAVFK,MAAM,8FACLqC,GAAIpE,EAAAb,QAELqD,EAGEM,EAAA,CAFAJ,KAAK,2BACLX,MAAM,8BAERF,EAES,OAAA,CAFHE,MAAM,kBAAmBsC,MAAOtE,EAAAZ,SACpCY,EAAAZ,OAAY,EAAAmF"}
1
+ {"version":3,"file":"CustomInput.vue2.js","sources":["../../../src/components/ui/CustomInput.vue"],"sourcesContent":["<template>\n <div class=\"relative flex flex-col\">\n <div v-if=\"label\">\n <label\n :for=\"label\"\n class=\"text-text-primary text-sm font-medium dark:text-text-primary-dark\"\n :class=\"[labelClass, allowLabelWrap ? '' : 'label-wrapper']\"\n >\n {{ label }}\n <span v-if=\"props.showRequiredLabel ?? required\" class=\"ml-1\">\n (Obligatorio)<span class=\"text-text-error\">*</span>\n </span>\n </label>\n </div>\n <IconField :iconPosition=\"iconPosition\" class=\"relative w-full\">\n <!-- Icono a la izquierda -->\n <InputIcon v-if=\"icon && iconPosition === 'left'\" class=\"left-icon\">\n <font-awesome-icon\n :icon=\"icon\"\n class=\"text-icon-left dark:text-text-primary-dark\"\n />\n </InputIcon>\n\n <InputText\n v-model=\"model\"\n :name=\"label\"\n :type=\"inputType\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :maxlength=\"textMaxLength\"\n :minlength=\"textMinLength\"\n @blur=\"handleEmitBlur($event)\"\n class=\"w-full cursor-pointer dark:bg-surface-primary! dark:placeholder-text-primary-dark dark:border-dark-border dark:text-text-primary-dark!\"\n :class=\"{\n 'border-helper-text!': hasError,\n 'pl-10': icon && iconPosition === 'left',\n 'pr-10': eye || clearable || (icon && iconPosition === 'right'),\n [inputClass]: true,\n }\"\n :aria-invalid=\"hasError\"\n :aria-describedby=\"errorId\"\n />\n\n <button\n v-if=\"icon && iconPosition === 'right'\"\n type=\"button\"\n class=\"positionButton right-icon\"\n @click=\"$emit('icon-click')\"\n >\n <font-awesome-icon\n :icon=\"icon\"\n class=\"text-icon-right dark:text-text-primary-dark\"\n />\n </button>\n\n <button\n v-if=\"eye\"\n type=\"button\"\n @click=\"togglePassword\"\n class=\"positionButton\"\n :class=\"{ 'right-12': icon && iconPosition === 'right' }\"\n >\n <font-awesome-icon\n :icon=\"\n isPasswordVisible ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye'\n \"\n class=\"text-icon-right dark:text-text-primary-dark\"\n />\n </button>\n\n <button\n v-if=\"clearable\"\n type=\"button\"\n @click=\"clearInput\"\n class=\"positionButton\"\n :class=\"{ 'right-12': (icon && iconPosition === 'right') || eye }\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-xmark\"\n class=\"text-icon-right dark:text-text-primary-dark\"\n />\n </button>\n </IconField>\n <p\n v-if=\"helper\"\n class=\"text-text-secondary text-[12px] mt-1.5 font-500 leading-4 tracking-[-0.2px] dark:text-text-primary-dark!\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-info\"\n class=\"text-[11px] text-accent-sky-60 font-900 align-center leading-3\"\n :class=\"{ 'text-text-secondary': disabled }\"\n />\n {{ helper }}\n </p>\n\n <!-- Contenedor fijo para error/validación -->\n <div v-if=\"!props.noErrorContainer\" class=\"h-4 mt-1 relative w-full\">\n <transition name=\"fade\">\n <p\n v-if=\"displayError\"\n class=\"absolute left-0 top-0 text-helper-text text-[10px] leading-3 flex items-center gap-1 w-full\"\n :id=\"errorId\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-xmark\"\n class=\"text-helper-text shrink-0\"\n />\n <span class=\"truncate flex-1\" :title=\"displayError\">{{\n displayError\n }}</span>\n </p>\n </transition>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\n// ============================================================================\n// Props\n// ============================================================================\nconst props = defineProps({\n // Model\n modelValue: {\n type: [String, Number],\n default: \"\",\n },\n\n // Basic input props\n label: String,\n type: {\n type: String,\n default: \"text\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n disabled: Boolean,\n\n // Icon props\n icon: {\n type: String,\n default: \"\",\n },\n iconPosition: {\n type: String,\n default: \"left\",\n validator: (value: string) => [\"left\", \"right\"].includes(value),\n },\n\n // Style props\n inputClass: {\n type: String,\n default: \"\",\n },\n labelClass: {\n type: String,\n default: \"\",\n },\n allowLabelWrap: {\n type: Boolean,\n default: false,\n },\n\n // Validation props\n required: {\n type: Boolean,\n default: false,\n },\n error: {\n type: String,\n default: \"\",\n },\n minLength: {\n type: Number,\n default: 0,\n },\n maxLength: {\n type: Number,\n default: 0,\n },\n min: {\n type: [Number, String],\n default: null,\n },\n max: {\n type: [Number, String],\n default: null,\n },\n limitNumber: {\n type: Number,\n default: 0,\n },\n exactLengths: {\n type: Array as () => number[],\n default: () => [],\n },\n validationMode: {\n type: String,\n default: \"onInput\",\n validator: (value: string) =>\n [\"onInput\", \"onBlur\", \"manual\"].includes(value),\n },\n\n // Feature props\n helper: String,\n eye: {\n type: Boolean,\n default: false,\n },\n clearable: {\n type: Boolean,\n default: false,\n },\n checkInput: {\n type: Boolean,\n default: false,\n },\n showRequiredLabel: {\n type: Boolean,\n default: undefined,\n },\n noErrorContainer: {\n type: Boolean,\n default: false,\n },\n});\n\n// ============================================================================\n// Emits\n// ============================================================================\nconst emit = defineEmits([\n \"update:modelValue\",\n \"blur-xs\",\n \"blur\",\n \"icon-click\",\n]);\n\n// ============================================================================\n// State\n// ============================================================================\nconst model = ref(props.modelValue?.toString?.() ?? \"\");\nconst isPasswordVisible = ref(false);\nconst touched = ref(false);\nconst validationError = ref(\"\");\n\n// ============================================================================\n// Computed Properties\n// ============================================================================\nconst inputType = computed(() =>\n isPasswordVisible.value ? \"text\" : props.type,\n);\n\nconst textMaxLength = computed(() =>\n props.type === \"text\"\n ? props.maxLength || (props.max != null ? Number(props.max) : undefined)\n : undefined,\n);\n\nconst textMinLength = computed(() =>\n props.type === \"text\"\n ? props.minLength || (props.min != null ? Number(props.min) : undefined)\n : undefined,\n);\n\nconst hasError = computed(() => Boolean(props.error || validationError.value));\n\nconst displayError = computed(() => {\n // Prioridad: error externo > error de validación interna\n if (props.error) return props.error;\n if (validationError.value) return validationError.value;\n return \"\";\n});\n\nconst errorId = computed(() =>\n props.label ? `${props.label}-error` : undefined,\n);\n\n// ============================================================================\n// Validation Logic\n// ============================================================================\nfunction validateRequired(value: string): string {\n if (props.required && touched.value && value.length === 0) {\n return \"Este campo es obligatorio\";\n }\n return \"\";\n}\n\nfunction validateNumber(value: string): string {\n if (props.type !== \"number\") return \"\";\n\n const length = value.length;\n if (props.limitNumber > 0 && length > 0 && length !== props.limitNumber) {\n return `Debe tener exactamente ${props.limitNumber} números`;\n }\n return \"\";\n}\n\nfunction validateExactLength(value: string): string {\n if (props.exactLengths.length === 0) return \"\";\n\n const length = value.length;\n if (length > 0 && !props.exactLengths.includes(length)) {\n return `Debe tener exactamente ${props.exactLengths.join(\" o \")} caracteres`;\n }\n return \"\";\n}\n\nfunction validateMinMaxLength(value: string): string {\n const length = value.length;\n const min = props.minLength > 0 ? props.minLength : 0;\n const max = props.maxLength > 0 ? props.maxLength : 0;\n\n if (min > 0 && max > 0) {\n if (length > 0 && (length < min || length > max)) {\n if (min === max) {\n return `Debe tener exactamente ${min} caracteres`;\n }\n\n return `Debe tener entre ${min} y ${max} caracteres`;\n }\n } else if (min > 0) {\n if (length > 0 && length < min) {\n return `Debe tener al menos ${min} caracteres`;\n }\n } else if (max > 0) {\n if (length > max) {\n return `Debe tener máximo ${max} caracteres`;\n }\n }\n\n return \"\";\n}\n\nfunction getErrorForValue(value: string): string {\n // Validar en orden de prioridad\n const requiredError = validateRequired(value);\n if (requiredError) return requiredError;\n\n const numberError = validateNumber(value);\n if (numberError) return numberError;\n\n const exactLengthError = validateExactLength(value);\n if (exactLengthError) return exactLengthError;\n\n const minMaxError = validateMinMaxLength(value);\n if (minMaxError) return minMaxError;\n\n return \"\";\n}\n\nfunction runValidation(): void {\n validationError.value = getErrorForValue(model.value);\n}\n\n// ============================================================================\n// Methods\n// ============================================================================\nfunction togglePassword(): void {\n isPasswordVisible.value = !isPasswordVisible.value;\n}\n\nfunction clearInput(): void {\n model.value = \"\";\n validationError.value = \"\";\n touched.value = false;\n emit(\"update:modelValue\", \"\");\n}\n\nfunction handleEmitBlur(event: Event): void {\n touched.value = true;\n\n if (props.validationMode !== \"manual\") {\n runValidation();\n }\n\n if (props.checkInput) {\n emit(\"blur\", event);\n }\n}\n\n// ============================================================================\n// Watchers\n// ============================================================================\nwatch(\n () => props.modelValue,\n (newValue) => {\n const stringValue = newValue != null ? newValue.toString() : \"\";\n if (model.value !== stringValue) {\n model.value = stringValue;\n }\n },\n { immediate: true },\n);\n\nwatch(model, (newValue) => {\n emit(\"update:modelValue\", newValue);\n\n // Manejar validación según el modo\n if (props.validationMode === \"manual\") {\n // En modo manual no validar automáticamente\n return;\n }\n\n if (props.validationMode === \"onBlur\" && !touched.value) {\n // En modo onBlur solo validar después de tocar el campo\n return;\n }\n\n // Modo onInput o después de blur\n runValidation();\n});\n\n// Limpiar error externo cuando el usuario empieza a escribir\nwatch(\n () => props.error,\n (newError) => {\n if (newError && model.value) {\n // Si hay un error externo y el usuario tiene contenido,\n // limpiar la validación interna para mostrar solo el error externo\n validationError.value = \"\";\n }\n },\n);\n</script>\n\n<style scoped>\n@reference \"../../assets/main.css\";\n\n.p-select-label {\n display: flex !important;\n align-items: center !important;\n}\n\n.label-wrapper {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n}\n\n.text-text-primary {\n margin-right: 4px;\n}\n\n.positionButton {\n @apply absolute right-4 top-0 bottom-0 flex items-center justify-center;\n}\n\n.left-icon {\n @apply absolute left-3 top-0 bottom-0 pointer-events-none z-10;\n color: var(--color-icon-left);\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.right-icon {\n @apply absolute right-4 top-0 bottom-0;\n}\n\n.right-12 {\n @apply right-12;\n}\n\n.p-inputtext.pl-10,\n.p-inputtext.pl-12 {\n padding-left: 2.5rem !important;\n}\n\n/* Specificity boost for dependencies */\n.p-iconfield > .p-inputtext.pl-10 {\n padding-left: 2.5rem !important;\n}\n</style>\n"],"names":["props","__props","emit","__emit","model","ref","modelValue","toString","isPasswordVisible","touched","validationError","inputType","computed","value","type","textMaxLength","maxLength","max","Number","textMinLength","minLength","min","hasError","Boolean","error","displayError","errorId","label","runValidation","requiredError","required","length","validateRequired","numberError","limitNumber","validateNumber","exactLengthError","exactLengths","includes","join","validateExactLength","validateMinMaxLength","getErrorForValue","togglePassword","clearInput","watch","newValue","stringValue","immediate","validationMode","newError","_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","for","class","_normalizeClass","labelClass","allowLabelWrap","_createTextVNode","_toDisplayString","showRequiredLabel","_hoisted_4","_cache","_createVNode","_component_IconField","iconPosition","icon","_createBlock","_component_InputIcon","_component_font_awesome_icon","_component_InputText","$event","name","placeholder","disabled","maxlength","minlength","onBlur","handleEmitBlur","event","checkInput","eye","clearable","inputClass","onClick","$emit","helper","_hoisted_5","noErrorContainer","_hoisted_6","_Transition","id","title","_hoisted_8"],"mappings":"kvDA0HA,MAAMA,EAAQC,EA+GRC,EAAOC,EAUPC,EAAQC,EAAIL,EAAMM,YAAYC,cAAgB,IAC9CC,EAAoBH,GAAI,GACxBI,EAAUJ,GAAI,GACdK,EAAkBL,EAAI,IAKtBM,EA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ACPZ,MAAM,4EAKFxD,EAAAmF,SADRhC,EAaS,SAAA,OAXPtC,KAAK,SACJyE,QAAO5C,EACRc,MAAKC,EAAA,CAAC,iBAAgB,CAAA,WACAzD,EAAAoE,MAAoB,UAAZpE,EAAAmE,kBAE9BF,EAKEM,EAAA,CAJCH,KAAmB7D,EAAAK,MAAiB,wBAAA,kBAGrC4C,MAAM,8EAKFxD,EAAAoF,eADRjC,EAWS,SAAA,OATPtC,KAAK,SACJyE,QAAO3C,EACRa,SAAM,iBAAgB,CAAA,WACCxD,kBAAQA,EAAAmE,cAA6BnE,EAAAmF,SAE5DlB,EAGEM,EAAA,CAFAH,KAAK,2BACLZ,MAAM,yFAKJxD,EAAAwF,QADRtC,IAAAC,EAUI,IAVJsC,EAUI,CANFxB,EAIEM,EAAA,CAHAH,KAAK,0BACLZ,MAAKC,EAAA,CAAC,iEAAgE,CAAA,sBACrCzD,EAAA4E,+BACjChB,EAAA,MACC5D,EAAAwF,QAAM,eAICzF,EAAM2F,2BAAlBxC,IAAAC,EAgBM,MAhBNwC,EAgBM,CAfJ1B,EAca2B,EAAA,CAdDlB,KAAK,QAAM,WACrB,IAYI,CAXIlD,EAAAZ,WADRuC,EAYI,IAAA,OAVFK,MAAM,8FACLqC,GAAIpE,EAAAb,QAELqD,EAGEM,EAAA,CAFAH,KAAK,2BACLZ,MAAM,8BAERF,EAES,OAAA,CAFHE,MAAM,kBAAmBsC,MAAOtE,EAAAZ,SACpCY,EAAAZ,OAAY,EAAAmF"}
@@ -1 +1 @@
1
- import t from"./CustomSelectCountry.vue2.js";/* empty css */import e from"../../_virtual/_plugin-vue_export-helper.js";const o=/* @__PURE__ */e(t,[["__scopeId","data-v-4aa4f360"]]);export{o as default};
1
+ import e from"./CustomSelectCountry.vue2.js";/* empty css */import t from"../../_virtual/_plugin-vue_export-helper.js";const o=/* @__PURE__ */t(e,[["__scopeId","data-v-ed892a7e"]]);export{o as default};
@@ -1 +1 @@
1
- import e from"primevue/select";import{defineComponent as l,useModel as a,ref as t,computed as o,watch as i,resolveComponent as n,openBlock as r,createElementBlock as d,createElementVNode as s,normalizeClass as u,createTextVNode as p,toDisplayString as c,createCommentVNode as f,createVNode as v,withCtx as m,createBlock as y,Transition as x,mergeModels as b}from"vue";const g={class:"w-full relative"},h={key:0},k=["for"],S={key:0,class:"ml-1"},C={key:0,class:"flex items-center"},V={key:0,class:"flex items-center"},w={class:"relative h-4 mt-1"},B=["id"],M={key:1,class:"absolute left-0 top-0 text-text-secondary text-[11px] leading-3 flex items-center gap-"},L=/* @__PURE__ */l({__name:"CustomSelectCountry",props:/* @__PURE__ */b({options:{type:Array,default:[]},optionLabel:{type:String,default:null},optionValue:{type:String,default:null},placeholder:{type:String,default:"Seleccione una opción"},selectClass:{type:String,default:""},labelClass:{type:String,default:""},size:{type:String,default:""},label:{type:String,required:!1,default:""},required:{type:Boolean,default:!0},filter:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},customOption:{type:Boolean,default:!1,required:!1},baseUrl:{type:String},error:{type:String,default:""},helper:{type:String,default:""},allowLabelWrap:{type:Boolean,default:!1},validationMode:{type:String,default:"onChange",validator:e=>["onChange","onBlur","manual"].includes(e)}},{modelValue:{},modelModifiers:{}}),emits:/* @__PURE__ */b(["change"],["update:modelValue"]),setup(l,{emit:b}){const L=a(l,"modelValue"),q=l,z=b,O=t(!1),_=t(""),E=o(()=>null!=L.value&&""!==L.value);function T(){_.value=q.required&&O.value&&!E.value?"Este campo es obligatorio":""}function U(){O.value=!0,"manual"!==q.validationMode&&T()}i(L,()=>{"manual"===q.validationMode||"onBlur"===q.validationMode&&!O.value?_.value="":"onChange"===q.validationMode&&T()});const W=o(()=>Boolean(q.error||_.value)),j=o(()=>q.error||_.value||void 0),A=o(()=>q.label?`${q.label}-error`:void 0);return(a,t)=>{const o=n("font-awesome-icon"),i=e;return r(),d("div",g,[l.label?(r(),d("div",h,[s("label",{for:l.label,class:u(["text-text-primary text-sm font-medium dark:text-dark-secondary",[l.labelClass,l.allowLabelWrap?"whitespace-normal":"whitespace-nowrap"]])},[p(c(l.label)+" ",1),l.required?(r(),d("span",S,[...t[2]||(t[2]=[p(" (Obligatorio)",-1),s("span",{class:"text-text-error"},"*",-1)])])):f("",!0)],10,k)])):f("",!0),v(i,{modelValue:L.value,"onUpdate:modelValue":t[0]||(t[0]=e=>L.value=e),options:l.options,optionLabel:l.optionLabel,placeholder:l.placeholder,size:l.size,optionValue:l.optionValue,filter:l.filter,disabled:l.disabled,class:u(["w-full dark:bg-surface-primary!",[l.selectClass,{"border-helper-text!":W.value}]]),"aria-invalid":W.value,"aria-describedby":A.value,onChange:t[1]||(t[1]=e=>{return l=e,O.value=!0,z("change",l),void("manual"!==q.validationMode&&T());var l}),onBlur:U},{value:m(e=>[l.customOption&&null!=e?.value?(r(),d("div",C,[s("div",null,c(e.value.name),1)])):f("",!0)]),option:m(e=>[l.customOption&&e?.option?(r(),d("div",V,["Sujeto a Evaluación"===e.option.blockType?(r(),y(o,{key:0,icon:"fa-solid fa-exclamation-triangle",class:"text-icon-warning dark:text-dark-secondary text-[11px]"})):f("",!0),s("div",{class:u(["ml-2 text-text-secondary text-[14px] font-400 leading-6",[{"ml-5":"Sin Restricción"===e.option.blockType}]])},c(e.option.name),3)])):f("",!0)]),_:1},8,["modelValue","options","optionLabel","placeholder","size","optionValue","filter","disabled","class","aria-invalid","aria-describedby"]),s("div",w,[v(x,{name:"fade"},{default:m(()=>[j.value?(r(),d("p",{key:0,class:"absolute left-0 top-0 text-helper-text text-[11px] leading-3 flex items-center gap-1",id:A.value},[v(o,{icon:"fa-solid fa-circle-xmark",class:"text-helper-text mr-1"}),p(" "+c(j.value),1)],8,B)):l.helper?(r(),d("p",M,[v(o,{icon:"fa-solid fa-circle-info",class:u(["text-[11px] text-accent-sky-60 font-900 align-center leading-3",{"text-text-secondary":l.disabled}])},null,8,["class"]),p(" "+c(l.helper),1)])):f("",!0)]),_:1})])])}}});export{L as default};
1
+ import e from"primevue/select";import{defineComponent as a,useModel as l,ref as t,computed as o,watch as i,resolveComponent as n,openBlock as r,createElementBlock as d,createElementVNode as s,normalizeClass as u,createTextVNode as p,toDisplayString as c,createCommentVNode as f,createVNode as v,withCtx as m,createBlock as y,Transition as x,mergeModels as b}from"vue";const g={class:"w-full relative"},h={key:0},k=["for"],S={key:0,class:"ml-1"},M={key:0,class:"flex items-center"},C={key:0,class:"flex items-center"},V={class:"relative h-4 mt-1"},w=["id"],B={key:1,class:"absolute left-0 top-0 text-text-secondary text-[11px] leading-3 flex items-center gap-"},L=/* @__PURE__ */a({__name:"CustomSelectCountry",props:/* @__PURE__ */b({options:{type:Array,default:[]},optionLabel:{type:String,default:null},optionValue:{type:String,default:null},placeholder:{type:String,default:"Seleccione una opción"},selectClass:{type:String,default:""},labelClass:{type:String,default:""},size:{type:String,default:""},label:{type:String,required:!1,default:""},required:{type:Boolean,default:!0},filter:{type:Boolean,default:!1},filterMatchMode:{type:String,default:"startsWith",validator:e=>["startsWith","contains","endsWith"].includes(e)},disabled:{type:Boolean,default:!1},customOption:{type:Boolean,default:!1,required:!1},baseUrl:{type:String},error:{type:String,default:""},helper:{type:String,default:""},allowLabelWrap:{type:Boolean,default:!1},validationMode:{type:String,default:"onChange",validator:e=>["onChange","onBlur","manual"].includes(e)}},{modelValue:{},modelModifiers:{}}),emits:/* @__PURE__ */b(["change"],["update:modelValue"]),setup(a,{emit:b}){const L=l(a,"modelValue"),q=a,W=b,z=t(!1),O=t(""),_=o(()=>null!=L.value&&""!==L.value);function E(){O.value=q.required&&z.value&&!_.value?"Este campo es obligatorio":""}function T(){z.value=!0,"manual"!==q.validationMode&&E()}i(L,()=>{"manual"===q.validationMode||"onBlur"===q.validationMode&&!z.value?O.value="":"onChange"===q.validationMode&&E()});const U=o(()=>Boolean(q.error||O.value)),j=o(()=>q.error||O.value||void 0),A=o(()=>q.label?`${q.label}-error`:void 0);return(l,t)=>{const o=n("font-awesome-icon"),i=e;return r(),d("div",g,[a.label?(r(),d("div",h,[s("label",{for:a.label,class:u(["text-text-primary text-sm font-medium dark:text-dark-secondary",[a.labelClass,a.allowLabelWrap?"whitespace-normal":"whitespace-nowrap"]])},[p(c(a.label)+" ",1),a.required?(r(),d("span",S,[...t[2]||(t[2]=[p(" (Obligatorio)",-1),s("span",{class:"text-text-error"},"*",-1)])])):f("",!0)],10,k)])):f("",!0),v(i,{modelValue:L.value,"onUpdate:modelValue":t[0]||(t[0]=e=>L.value=e),options:a.options,optionLabel:a.optionLabel,placeholder:a.placeholder,size:a.size,optionValue:a.optionValue,filter:a.filter,filterMatchMode:a.filterMatchMode,disabled:a.disabled,class:u(["w-full dark:bg-surface-primary!",[a.selectClass,{"border-helper-text!":U.value}]]),"aria-invalid":U.value,"aria-describedby":A.value,onChange:t[1]||(t[1]=e=>{return a=e,z.value=!0,W("change",a),void("manual"!==q.validationMode&&E());var a}),onBlur:T},{value:m(e=>[a.customOption&&null!=e?.value?(r(),d("div",M,[s("div",null,c(e.value.name),1)])):f("",!0)]),option:m(e=>[a.customOption&&e?.option?(r(),d("div",C,["Sujeto a Evaluación"===e.option.blockType?(r(),y(o,{key:0,icon:"fa-solid fa-exclamation-triangle",class:"text-icon-warning dark:text-dark-secondary text-[11px]"})):f("",!0),s("div",{class:u(["ml-2 text-text-secondary text-[14px] font-400 leading-6",[{"ml-5":"Sin Restricción"===e.option.blockType}]])},c(e.option.name),3)])):f("",!0)]),_:1},8,["modelValue","options","optionLabel","placeholder","size","optionValue","filter","filterMatchMode","disabled","class","aria-invalid","aria-describedby"]),s("div",V,[v(x,{name:"fade"},{default:m(()=>[j.value?(r(),d("p",{key:0,class:"absolute left-0 top-0 text-helper-text text-[11px] leading-3 flex items-center gap-1",id:A.value},[v(o,{icon:"fa-solid fa-circle-xmark",class:"text-helper-text mr-1"}),p(" "+c(j.value),1)],8,w)):a.helper?(r(),d("p",B,[v(o,{icon:"fa-solid fa-circle-info",class:u(["text-[11px] text-accent-sky-60 font-900 align-center leading-3",{"text-text-secondary":a.disabled}])},null,8,["class"]),p(" "+c(a.helper),1)])):f("",!0)]),_:1})])])}}});export{L as default};
@@ -1 +1 @@
1
- {"version":3,"file":"CustomSelectCountry.vue2.js","sources":["../../../src/components/ui/CustomSelectCountry.vue"],"sourcesContent":["<template>\n <div class=\"w-full relative\">\n <div v-if=\"label\">\n <label\n :for=\"label\"\n class=\"text-text-primary text-sm font-medium dark:text-dark-secondary\"\n :class=\"[\n labelClass,\n allowLabelWrap ? 'whitespace-normal' : 'whitespace-nowrap',\n ]\"\n >\n {{ label }}\n <span v-if=\"required\" class=\"ml-1\">\n (Obligatorio)<span class=\"text-text-error\">*</span>\n </span>\n </label>\n </div>\n\n <Select\n v-model=\"model\"\n :options=\"options\"\n :optionLabel=\"optionLabel\"\n :placeholder=\"placeholder\"\n :size=\"size\"\n :optionValue=\"optionValue\"\n :filter=\"filter\"\n :disabled=\"disabled\"\n class=\"w-full dark:bg-surface-primary!\"\n :class=\"[selectClass, { 'border-helper-text!': hasError }]\"\n :aria-invalid=\"hasError\"\n :aria-describedby=\"errorId\"\n @change=\"handleChange($event)\"\n @blur=\"handleBlur\"\n >\n <template #value=\"slotProps\">\n <div\n v-if=\"\n customOption &&\n slotProps?.value !== null &&\n slotProps?.value !== undefined\n \"\n class=\"flex items-center\"\n >\n <div>{{ slotProps.value.name }}</div>\n </div>\n </template>\n\n <template #option=\"slotProps\">\n <div v-if=\"customOption && slotProps?.option\" class=\"flex items-center\">\n <font-awesome-icon\n v-if=\"slotProps.option.blockType === 'Sujeto a Evaluación'\"\n icon=\"fa-solid fa-exclamation-triangle\"\n class=\"text-icon-warning dark:text-dark-secondary text-[11px]\"\n />\n <div\n class=\"ml-2 text-text-secondary text-[14px] font-400 leading-6\"\n :class=\"[\n { 'ml-5': slotProps.option.blockType === 'Sin Restricción' },\n ]\"\n >\n {{ slotProps.option.name }}\n </div>\n </div>\n </template>\n </Select>\n\n <!-- Contenedor fijo para el mensaje de error -->\n <div class=\"relative h-4 mt-1\">\n <transition name=\"fade\">\n <p\n v-if=\"displayError\"\n class=\"absolute left-0 top-0 text-helper-text text-[11px] leading-3 flex items-center gap-1\"\n :id=\"errorId\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-xmark\"\n class=\"text-helper-text mr-1\"\n />\n {{ displayError }}\n </p>\n <p\n v-else-if=\"helper\"\n class=\"absolute left-0 top-0 text-text-secondary text-[11px] leading-3 flex items-center gap-\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-info\"\n class=\"text-[11px] text-accent-sky-60 font-900 align-center leading-3\"\n :class=\"{ 'text-text-secondary': disabled }\"\n />\n {{ helper }}\n </p>\n </transition>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch } from \"vue\";\n\ntype CountryOption =\n | {\n name: string;\n blockType?: string;\n [key: string]: any;\n }\n | string\n | number\n | null;\n\nconst model = defineModel<CountryOption>();\n\nconst props = defineProps({\n options: {\n type: Array,\n default: [],\n },\n optionLabel: {\n type: String,\n default: null,\n },\n optionValue: {\n type: String,\n default: null,\n },\n placeholder: {\n type: String,\n default: \"Seleccione una opción\",\n },\n selectClass: {\n type: String,\n default: \"\",\n },\n labelClass: {\n type: String,\n default: \"\",\n },\n size: {\n type: String,\n default: \"\",\n },\n label: {\n type: String,\n required: false,\n default: \"\",\n },\n required: {\n type: Boolean,\n default: true,\n },\n filter: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n customOption: {\n type: Boolean,\n default: false,\n required: false,\n },\n baseUrl: {\n type: String,\n },\n error: {\n type: String,\n default: \"\",\n },\n helper: {\n type: String,\n default: \"\",\n },\n allowLabelWrap: {\n type: Boolean,\n default: false,\n },\n validationMode: {\n type: String as () => \"onChange\" | \"onBlur\" | \"manual\",\n default: \"onChange\",\n validator: (value: string) =>\n [\"onChange\", \"onBlur\", \"manual\"].includes(value),\n },\n});\n\nconst emits = defineEmits<{ (e: \"change\", event: any): void }>();\n\nconst touched = ref(false);\nconst validationError = ref(\"\");\n\nconst hasValue = computed(() => model.value != null && model.value !== \"\");\n\nfunction getErrorForValue(): string {\n if (props.required && touched.value && !hasValue.value) {\n return \"Este campo es obligatorio\";\n }\n return \"\";\n}\n\nfunction runValidation(): void {\n validationError.value = getErrorForValue();\n}\n\nfunction handleChange(event: any): void {\n touched.value = true;\n emits(\"change\", event);\n if (props.validationMode !== \"manual\") {\n runValidation();\n }\n}\n\nfunction handleBlur(): void {\n touched.value = true;\n if (props.validationMode !== \"manual\") {\n runValidation();\n }\n}\n\nwatch(model, () => {\n if (props.validationMode === \"manual\") {\n validationError.value = \"\";\n return;\n }\n if (props.validationMode === \"onBlur\" && !touched.value) {\n validationError.value = \"\";\n return;\n }\n if (props.validationMode === \"onChange\") {\n runValidation();\n }\n});\n\nconst hasError = computed<boolean>(() =>\n Boolean(props.error || validationError.value),\n);\nconst displayError = computed<string | undefined>(\n () => props.error || validationError.value || undefined,\n);\nconst errorId = computed<string | undefined>(() =>\n props.label ? `${props.label}-error` : undefined,\n);\n</script>\n\n<style scoped>\n.custom-select-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: #f3f4f6;\n color: #9ca3af;\n}\n\n.custom-select-disabled:hover {\n cursor: not-allowed;\n}\n\n/* Estilos específicos para el dropdown de PrimeVue cuando está disabled */\n:deep(.p-select.p-disabled) {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: #f3f4f6 !important;\n color: #9ca3af !important;\n}\n\n:deep(.p-select.p-disabled .p-select-label) {\n color: #9ca3af !important;\n}\n\n:deep(.p-select.p-disabled .p-select-dropdown) {\n cursor: not-allowed;\n}\n</style>\n"],"names":["model","_useModel","props","__props","emits","__emit","touched","ref","validationError","hasValue","computed","value","runValidation","required","handleBlur","validationMode","watch","hasError","Boolean","error","displayError","errorId","label","_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","for","class","labelClass","allowLabelWrap","_createTextVNode","_toDisplayString","_hoisted_4","_cache","_createVNode","_component_Select","$event","options","optionLabel","placeholder","size","optionValue","filter","disabled","_normalizeClass","selectClass","onChange","handleChange","event","onBlur","_withCtx","slotProps","customOption","_hoisted_5","name","option","_hoisted_6","blockType","_createBlock","_component_font_awesome_icon","icon","_hoisted_7","_Transition","id","helper","_hoisted_9"],"mappings":"wgDA6GA,MAAMA,EAAQC,kBAERC,EAAQC,EA0ERC,EAAQC,EAERC,EAAUC,GAAI,GACdC,EAAkBD,EAAI,IAEtBE,EAAWC,EAAS,IAAqB,MAAfV,EAAMW,OAAiC,KAAhBX,EAAMW,OAS7D,SAASC,IACPJ,EAAgBG,MAPZT,EAAMW,UAAYP,EAAQK,QAAUF,EAASE,MACxC,4BAEF,EAKT,CAUA,SAASG,IACPR,EAAQK,OAAQ,EACa,WAAzBT,EAAMa,gBACRH,GAEJ,CAEAI,EAAMhB,EAAO,KACkB,WAAzBE,EAAMa,gBAImB,WAAzBb,EAAMa,iBAAgCT,EAAQK,MAHhDH,EAAgBG,MAAQ,GAOG,aAAzBT,EAAMa,gBACRH,MAIJ,MAAMK,EAAWP,EAAkB,IACjCQ,QAAQhB,EAAMiB,OAASX,EAAgBG,QAEnCS,EAAeV,EACnB,IAAMR,EAAMiB,OAASX,EAAgBG,YAAS,GAE1CU,EAAUX,EAA6B,IAC3CR,EAAMoB,MAAQ,GAAGpB,EAAMoB,mBAAgB,oDA9OvC,OAAAC,IAAAC,EA4FM,MA5FNC,EA4FM,CA3FOtB,EAAAmB,WAAXE,EAcM,MAAAE,EAAA,CAbJC,EAYQ,QAAA,CAXLC,IAAKzB,EAAAmB,MACNO,SAAM,iEAAgE,CAClD1B,EAAA2B,WAAsB3B,EAAA4B,eAAc,oBAAA,yBAKrDC,EAAAC,EAAA9B,EAAAmB,OAAQ,IACX,GAAYnB,EAAAU,UAAZU,IAAAC,EAEO,OAFPU,EAEO,IAAAC,EAAA,KAAAA,EAAA,GAAA,GAF4B,kBACpB,GAAAR,EAAsC,OAAA,CAAhCE,MAAM,mBAAkB,KAAC,oCAKlDO,EA8CS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AUI,CANF/B,EAIEyB,EAAA,CAHAC,KAAK,0BACLjC,MAAKiB,EAAA,CAAC,iEAAgE,CAAA,sBACrC3C,EAAA0C,+BACjCb,EAAA,MACC7B,EAAA+D,QAAM"}
1
+ {"version":3,"file":"CustomSelectCountry.vue2.js","sources":["../../../src/components/ui/CustomSelectCountry.vue"],"sourcesContent":["<template>\n <div class=\"w-full relative\">\n <div v-if=\"label\">\n <label\n :for=\"label\"\n class=\"text-text-primary text-sm font-medium dark:text-dark-secondary\"\n :class=\"[\n labelClass,\n allowLabelWrap ? 'whitespace-normal' : 'whitespace-nowrap',\n ]\"\n >\n {{ label }}\n <span v-if=\"required\" class=\"ml-1\">\n (Obligatorio)<span class=\"text-text-error\">*</span>\n </span>\n </label>\n </div>\n\n <Select\n v-model=\"model\"\n :options=\"options\"\n :optionLabel=\"optionLabel\"\n :placeholder=\"placeholder\"\n :size=\"size\"\n :optionValue=\"optionValue\"\n :filter=\"filter\"\n :filterMatchMode=\"filterMatchMode\"\n :disabled=\"disabled\"\n class=\"w-full dark:bg-surface-primary!\"\n :class=\"[selectClass, { 'border-helper-text!': hasError }]\"\n :aria-invalid=\"hasError\"\n :aria-describedby=\"errorId\"\n @change=\"handleChange($event)\"\n @blur=\"handleBlur\"\n >\n <template #value=\"slotProps\">\n <div\n v-if=\"\n customOption &&\n slotProps?.value !== null &&\n slotProps?.value !== undefined\n \"\n class=\"flex items-center\"\n >\n <div>{{ slotProps.value.name }}</div>\n </div>\n </template>\n\n <template #option=\"slotProps\">\n <div v-if=\"customOption && slotProps?.option\" class=\"flex items-center\">\n <font-awesome-icon\n v-if=\"slotProps.option.blockType === 'Sujeto a Evaluación'\"\n icon=\"fa-solid fa-exclamation-triangle\"\n class=\"text-icon-warning dark:text-dark-secondary text-[11px]\"\n />\n <div\n class=\"ml-2 text-text-secondary text-[14px] font-400 leading-6\"\n :class=\"[\n { 'ml-5': slotProps.option.blockType === 'Sin Restricción' },\n ]\"\n >\n {{ slotProps.option.name }}\n </div>\n </div>\n </template>\n </Select>\n\n <!-- Contenedor fijo para el mensaje de error -->\n <div class=\"relative h-4 mt-1\">\n <transition name=\"fade\">\n <p\n v-if=\"displayError\"\n class=\"absolute left-0 top-0 text-helper-text text-[11px] leading-3 flex items-center gap-1\"\n :id=\"errorId\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-xmark\"\n class=\"text-helper-text mr-1\"\n />\n {{ displayError }}\n </p>\n <p\n v-else-if=\"helper\"\n class=\"absolute left-0 top-0 text-text-secondary text-[11px] leading-3 flex items-center gap-\"\n >\n <font-awesome-icon\n icon=\"fa-solid fa-circle-info\"\n class=\"text-[11px] text-accent-sky-60 font-900 align-center leading-3\"\n :class=\"{ 'text-text-secondary': disabled }\"\n />\n {{ helper }}\n </p>\n </transition>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch } from \"vue\";\n\ntype CountryOption =\n | {\n name: string;\n blockType?: string;\n [key: string]: any;\n }\n | string\n | number\n | null;\n\nconst model = defineModel<CountryOption>();\n\nconst props = defineProps({\n options: {\n type: Array,\n default: [],\n },\n optionLabel: {\n type: String,\n default: null,\n },\n optionValue: {\n type: String,\n default: null,\n },\n placeholder: {\n type: String,\n default: \"Seleccione una opción\",\n },\n selectClass: {\n type: String,\n default: \"\",\n },\n labelClass: {\n type: String,\n default: \"\",\n },\n size: {\n type: String,\n default: \"\",\n },\n label: {\n type: String,\n required: false,\n default: \"\",\n },\n required: {\n type: Boolean,\n default: true,\n },\n filter: {\n type: Boolean,\n default: false,\n },\n filterMatchMode: {\n type: String as () => \"startsWith\" | \"contains\" | \"endsWith\",\n default: \"startsWith\",\n validator: (value: string) => [\"startsWith\", \"contains\", \"endsWith\"].includes(value),\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n customOption: {\n type: Boolean,\n default: false,\n required: false,\n },\n baseUrl: {\n type: String,\n },\n error: {\n type: String,\n default: \"\",\n },\n helper: {\n type: String,\n default: \"\",\n },\n allowLabelWrap: {\n type: Boolean,\n default: false,\n },\n validationMode: {\n type: String as () => \"onChange\" | \"onBlur\" | \"manual\",\n default: \"onChange\",\n validator: (value: string) =>\n [\"onChange\", \"onBlur\", \"manual\"].includes(value),\n },\n});\n\nconst emits = defineEmits<{ (e: \"change\", event: any): void }>();\n\nconst touched = ref(false);\nconst validationError = ref(\"\");\n\nconst hasValue = computed(() => model.value != null && model.value !== \"\");\n\nfunction getErrorForValue(): string {\n if (props.required && touched.value && !hasValue.value) {\n return \"Este campo es obligatorio\";\n }\n return \"\";\n}\n\nfunction runValidation(): void {\n validationError.value = getErrorForValue();\n}\n\nfunction handleChange(event: any): void {\n touched.value = true;\n emits(\"change\", event);\n if (props.validationMode !== \"manual\") {\n runValidation();\n }\n}\n\nfunction handleBlur(): void {\n touched.value = true;\n if (props.validationMode !== \"manual\") {\n runValidation();\n }\n}\n\nwatch(model, () => {\n if (props.validationMode === \"manual\") {\n validationError.value = \"\";\n return;\n }\n if (props.validationMode === \"onBlur\" && !touched.value) {\n validationError.value = \"\";\n return;\n }\n if (props.validationMode === \"onChange\") {\n runValidation();\n }\n});\n\nconst hasError = computed<boolean>(() =>\n Boolean(props.error || validationError.value),\n);\nconst displayError = computed<string | undefined>(\n () => props.error || validationError.value || undefined,\n);\nconst errorId = computed<string | undefined>(() =>\n props.label ? `${props.label}-error` : undefined,\n);\n</script>\n\n<style scoped>\n.custom-select-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: #f3f4f6;\n color: #9ca3af;\n}\n\n.custom-select-disabled:hover {\n cursor: not-allowed;\n}\n\n/* Estilos específicos para el dropdown de PrimeVue cuando está disabled */\n:deep(.p-select.p-disabled) {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: #f3f4f6 !important;\n color: #9ca3af !important;\n}\n\n:deep(.p-select.p-disabled .p-select-label) {\n color: #9ca3af !important;\n}\n\n:deep(.p-select.p-disabled .p-select-dropdown) {\n cursor: not-allowed;\n}\n</style>\n"],"names":["model","_useModel","props","__props","emits","__emit","touched","ref","validationError","hasValue","computed","value","runValidation","required","handleBlur","validationMode","watch","hasError","Boolean","error","displayError","errorId","label","_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","for","class","labelClass","allowLabelWrap","_createTextVNode","_toDisplayString","_hoisted_4","_cache","_createVNode","_component_Select","$event","options","optionLabel","placeholder","size","optionValue","filter","filterMatchMode","disabled","_normalizeClass","selectClass","onChange","handleChange","event","onBlur","_withCtx","slotProps","customOption","_hoisted_5","name","option","_hoisted_6","blockType","_createBlock","_component_font_awesome_icon","icon","_hoisted_7","_Transition","id","helper","_hoisted_9"],"mappings":"ynDA8GA,MAAMA,EAAQC,kBAERC,EAAQC,EA+ERC,EAAQC,EAERC,EAAUC,GAAI,GACdC,EAAkBD,EAAI,IAEtBE,EAAWC,EAAS,IAAqB,MAAfV,EAAMW,OAAiC,KAAhBX,EAAMW,OAS7D,SAASC,IACPJ,EAAgBG,MAPZT,EAAMW,UAAYP,EAAQK,QAAUF,EAASE,MACxC,4BAEF,EAKT,CAUA,SAASG,IACPR,EAAQK,OAAQ,EACa,WAAzBT,EAAMa,gBACRH,GAEJ,CAEAI,EAAMhB,EAAO,KACkB,WAAzBE,EAAMa,gBAImB,WAAzBb,EAAMa,iBAAgCT,EAAQK,MAHhDH,EAAgBG,MAAQ,GAOG,aAAzBT,EAAMa,gBACRH,MAIJ,MAAMK,EAAWP,EAAkB,IACjCQ,QAAQhB,EAAMiB,OAASX,EAAgBG,QAEnCS,EAAeV,EACnB,IAAMR,EAAMiB,OAASX,EAAgBG,YAAS,GAE1CU,EAAUX,EAA6B,IAC3CR,EAAMoB,MAAQ,GAAGpB,EAAMoB,mBAAgB,oDApPvC,OAAAC,IAAAC,EA6FM,MA7FNC,EA6FM,CA5FOtB,EAAAmB,WAAXE,EAcM,MAAAE,EAAA,CAbJC,EAYQ,QAAA,CAXLC,IAAKzB,EAAAmB,MACNO,SAAM,iEAAgE,CAClD1B,EAAA2B,WAAsB3B,EAAA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5B,EAuBa6B,EAAA,CAvBDR,KAAK,QAAM,WACrB,IAUI,CATIrC,EAAAT,WADRa,EAUI,IAAA,OARFK,MAAM,uFACLqC,GAAI7C,EAAAV,QAELyB,EAGE0B,EAAA,CAFAC,KAAK,2BACLlC,MAAM,0BACNG,EAAA,MACCZ,EAAAT,OAAY,UAGJR,EAAAgE,QADb5C,IAAAC,EAUI,IAVJ4C,EAUI,CANFhC,EAIE0B,EAAA,CAHAC,KAAK,0BACLlC,MAAKkB,EAAA,CAAC,iEAAgE,CAAA,sBACrC5C,EAAA2C,+BACjCd,EAAA,MACC7B,EAAAgE,QAAM"}
@@ -1 +1 @@
1
- import e from"./CustomDialog.vue.js";import l from"./CustomButton.vue.js";import t from"./CustomFileUpload.vue.js";import{defineComponent as a,ref as i,openBlock as o,createBlock as n,withCtx as u,createElementVNode as d,createVNode as s,toDisplayString as r}from"vue";const p={class:"text-2xl text-text-primary dark:text-text-primary-dark"},v={class:"w-full flex items-center justify-between"},b=/* @__PURE__ */a({__name:"UploadFileDialog",props:{title:String,visible:Boolean,disabled:Boolean,uploadButtonLabel:{type:String,default:"Subir archivo"}},emits:["update:visible","onFileSelected","onUploadFile","onExcelUpload"],setup(a,{emit:b}){const c=b,m=i(!1),f=i(!1),x=i([]),F=i([]);function U(e){m.value=e.length>0,x.value=e,f.value=!1,c("onFileSelected",e)}function C(e){f.value=!0,F.value=e}function S(){f.value?c("onExcelUpload",F.value):c("onUploadFile",x.value),c("update:visible",!1)}return(i,b)=>{const c=t,f=l,x=e;return o(),n(x,{visible:a.visible,"onUpdate:visible":b[1]||(b[1]=e=>i.$emit("update:visible",e)),closable:!0},{header:u(()=>[d("span",p,r(a.title),1)]),content:u(()=>[s(c,{mode:"advanced",onOnFileSelected:U,onHandleLoadData:C})]),footer:u(()=>[d("div",v,[s(f,{variant:"primary_outlined",label:"Cancelar",onClick:b[0]||(b[0]=e=>i.$emit("update:visible",!1))}),s(f,{label:a.uploadButtonLabel,disabled:!m.value||a.disabled,onClick:S},null,8,["label","disabled"])])]),_:1},8,["visible"])}}});export{b as default};
1
+ import e from"./CustomDialog.vue.js";import l from"./CustomButton.vue.js";import{defineComponent as t,ref as a,resolveComponent as i,openBlock as o,createBlock as n,withCtx as u,createElementVNode as d,createVNode as s,toDisplayString as r}from"vue";const p={class:"text-2xl text-text-primary dark:text-text-primary-dark"},v={class:"w-full flex items-center justify-between"},b=/* @__PURE__ */t({__name:"UploadFileDialog",props:{title:String,visible:Boolean,disabled:Boolean,uploadButtonLabel:{type:String,default:"Subir archivo"}},emits:["update:visible","onFileSelected","onUploadFile","onExcelUpload"],setup(t,{emit:b}){const c=b,m=a(!1),f=a(!1),x=a([]),F=a([]);function U(e){m.value=e.length>0,x.value=e,f.value=!1,c("onFileSelected",e)}function C(e){f.value=!0,F.value=e}function S(){f.value?c("onExcelUpload",F.value):c("onUploadFile",x.value),c("update:visible",!1)}return(a,b)=>{const c=i("CustomFileUpload"),f=l,x=e;return o(),n(x,{visible:t.visible,"onUpdate:visible":b[1]||(b[1]=e=>a.$emit("update:visible",e)),closable:!0},{header:u(()=>[d("span",p,r(t.title),1)]),content:u(()=>[s(c,{mode:"advanced",onOnFileSelected:U,onHandleLoadData:C})]),footer:u(()=>[d("div",v,[s(f,{variant:"primary_outlined",label:"Cancelar",onClick:b[0]||(b[0]=e=>a.$emit("update:visible",!1))}),s(f,{label:t.uploadButtonLabel,disabled:!m.value||t.disabled,onClick:S},null,8,["label","disabled"])])]),_:1},8,["visible"])}}});export{b as default};
@@ -1 +1 @@
1
- {"version":3,"file":"UploadFileDialog.vue.js","sources":["../../../src/components/ui/UploadFileDialog.vue"],"sourcesContent":["<template>\n <CustomDialog\n :visible=\"visible\"\n @update:visible=\"$emit('update:visible', $event)\"\n :closable=\"true\"\n >\n <template #header>\n <span class=\"text-2xl text-text-primary dark:text-text-primary-dark\">\n {{ title }}\n </span>\n </template>\n\n <template #content>\n <CustomFileUpload\n mode=\"advanced\"\n @onFileSelected=\"onFileSelected\"\n @handleLoadData=\"onExcelUpload\"\n />\n </template>\n\n <template #footer>\n <div class=\"w-full flex items-center justify-between\">\n <CustomButton\n variant=\"primary_outlined\"\n label=\"Cancelar\"\n @click=\"$emit('update:visible', false)\"\n />\n\n <CustomButton\n :label=\"uploadButtonLabel\"\n :disabled=\"!canUploadFile || disabled\"\n @click=\"handleUploadClick\"\n />\n </div>\n </template>\n </CustomDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\n\nconst props = defineProps({\n title: String,\n visible: Boolean,\n disabled: Boolean,\n uploadButtonLabel: { type: String, default: \"Subir archivo\" },\n});\n\nconst emit = defineEmits([\n \"update:visible\",\n \"onFileSelected\",\n \"onUploadFile\", // archivo normal\n \"onExcelUpload\", // excel convertido a JSON\n]);\n\nconst canUploadFile = ref(false);\nconst uploadingExcel = ref(false);\n\nconst currentFile = ref<File[]>([]);\nconst jsonToUpload = ref<any[]>([]);\n\n// Cuando se selecciona archivo (Excel o cualquier otro)\nfunction onFileSelected(files: File[]) {\n canUploadFile.value = files.length > 0;\n currentFile.value = files;\n uploadingExcel.value = false; // reset por si antes hubo excel\n emit(\"onFileSelected\", files);\n}\n\n// Cuando el FileUpload procesa un Excel\nfunction onExcelUpload(json: any[]) {\n uploadingExcel.value = true;\n jsonToUpload.value = json;\n}\n\n// -------- FLUJO UNIFICADO DEL BOTÓN ----------\nfunction handleUploadClick() {\n if (uploadingExcel.value) {\n // Excel → enviar JSON\n emit(\"onExcelUpload\", jsonToUpload.value);\n } else {\n // Archivo normal\n emit(\"onUploadFile\", currentFile.value);\n }\n\n emit(\"update:visible\", false);\n}\n</script>\n"],"names":["emit","__emit","canUploadFile","ref","uploadingExcel","currentFile","jsonToUpload","onFileSelected","files","value","length","onExcelUpload","json","handleUploadClick","_createBlock","_component_CustomDialog","visible","__props","_cache","$event","$emit","closable","header","_createElementVNode","_hoisted_1","_toDisplayString","title","content","_createVNode","_component_CustomFileUpload","mode","onOnFileSelected","onHandleLoadData","footer","_hoisted_2","_component_CustomButton","variant","label","onClick","uploadButtonLabel","disabled"],"mappings":"koBAgDA,MAAMA,EAAOC,EAOPC,EAAgBC,GAAI,GACpBC,EAAiBD,GAAI,GAErBE,EAAcF,EAAY,IAC1BG,EAAeH,EAAW,IAGhC,SAASI,EAAeC,GACtBN,EAAcO,MAAQD,EAAME,OAAS,EACrCL,EAAYI,MAAQD,EACpBJ,EAAeK,OAAQ,EACvBT,EAAK,iBAAkBQ,EACzB,CAGA,SAASG,EAAcC,GACrBR,EAAeK,OAAQ,EACvBH,EAAaG,MAAQG,CACvB,CAGA,SAASC,IACHT,EAAeK,MAEjBT,EAAK,gBAAiBM,EAAaG,OAGnCT,EAAK,eAAgBK,EAAYI,OAGnCT,EAAK,kBAAkB,EACzB,4CArFEc,EAkCeC,EAAA,CAjCZC,QAASC,EAAAD,QACT,mBAAcE,EAAA,KAAAA,EAAA,GAAAC,GAAEC,EAAAA,MAAK,iBAAmBD,IACxCE,UAAU,IAEAC,SACT,IAEO,CAFPC,EAEO,OAFPC,EAEOC,EADFR,EAAAS,OAAK,KAIDC,UACT,IAIE,CAJFC,EAIEC,EAAA,CAHAC,KAAK,WACJC,iBAAgBxB,EAChByB,iBAAgBrB,MAIVsB,SACT,IAYM,CAZNV,EAYM,MAZNW,EAYM,CAXJN,EAIEO,EAAA,CAHAC,QAAQ,mBACRC,MAAM,WACLC,uBAAOlB,EAAAA,MAAK,kBAAA,MAGfQ,EAIEO,EAAA,CAHCE,MAAOpB,EAAAsB,kBACPC,UAAWtC,EAAAO,OAAiBQ,EAAAuB,SAC5BF,QAAOzB"}
1
+ {"version":3,"file":"UploadFileDialog.vue.js","sources":["../../../src/components/ui/UploadFileDialog.vue"],"sourcesContent":["<template>\n <CustomDialog\n :visible=\"visible\"\n @update:visible=\"$emit('update:visible', $event)\"\n :closable=\"true\"\n >\n <template #header>\n <span class=\"text-2xl text-text-primary dark:text-text-primary-dark\">\n {{ title }}\n </span>\n </template>\n\n <template #content>\n <CustomFileUpload\n mode=\"advanced\"\n @onFileSelected=\"onFileSelected\"\n @handleLoadData=\"onExcelUpload\"\n />\n </template>\n\n <template #footer>\n <div class=\"w-full flex items-center justify-between\">\n <CustomButton\n variant=\"primary_outlined\"\n label=\"Cancelar\"\n @click=\"$emit('update:visible', false)\"\n />\n\n <CustomButton\n :label=\"uploadButtonLabel\"\n :disabled=\"!canUploadFile || disabled\"\n @click=\"handleUploadClick\"\n />\n </div>\n </template>\n </CustomDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\n\nconst props = defineProps({\n title: String,\n visible: Boolean,\n disabled: Boolean,\n uploadButtonLabel: { type: String, default: \"Subir archivo\" },\n});\n\nconst emit = defineEmits([\n \"update:visible\",\n \"onFileSelected\",\n \"onUploadFile\", // archivo normal\n \"onExcelUpload\", // excel convertido a JSON\n]);\n\nconst canUploadFile = ref(false);\nconst uploadingExcel = ref(false);\n\nconst currentFile = ref<File[]>([]);\nconst jsonToUpload = ref<any[]>([]);\n\n// Cuando se selecciona archivo (Excel o cualquier otro)\nfunction onFileSelected(files: File[]) {\n canUploadFile.value = files.length > 0;\n currentFile.value = files;\n uploadingExcel.value = false; // reset por si antes hubo excel\n emit(\"onFileSelected\", files);\n}\n\n// Cuando el FileUpload procesa un Excel\nfunction onExcelUpload(json: any[]) {\n uploadingExcel.value = true;\n jsonToUpload.value = json;\n}\n\n// -------- FLUJO UNIFICADO DEL BOTÓN ----------\nfunction handleUploadClick() {\n if (uploadingExcel.value) {\n // Excel → enviar JSON\n emit(\"onExcelUpload\", jsonToUpload.value);\n } else {\n // Archivo normal\n emit(\"onUploadFile\", currentFile.value);\n }\n\n emit(\"update:visible\", false);\n}\n</script>\n"],"names":["emit","__emit","canUploadFile","ref","uploadingExcel","currentFile","jsonToUpload","onFileSelected","files","value","length","onExcelUpload","json","handleUploadClick","_createBlock","_component_CustomDialog","visible","__props","_cache","$event","$emit","closable","header","_createElementVNode","_hoisted_1","_toDisplayString","title","content","_createVNode","_component_CustomFileUpload","mode","onOnFileSelected","onHandleLoadData","footer","_hoisted_2","_component_CustomButton","variant","label","onClick","uploadButtonLabel","disabled"],"mappings":"+mBAgDA,MAAMA,EAAOC,EAOPC,EAAgBC,GAAI,GACpBC,EAAiBD,GAAI,GAErBE,EAAcF,EAAY,IAC1BG,EAAeH,EAAW,IAGhC,SAASI,EAAeC,GACtBN,EAAcO,MAAQD,EAAME,OAAS,EACrCL,EAAYI,MAAQD,EACpBJ,EAAeK,OAAQ,EACvBT,EAAK,iBAAkBQ,EACzB,CAGA,SAASG,EAAcC,GACrBR,EAAeK,OAAQ,EACvBH,EAAaG,MAAQG,CACvB,CAGA,SAASC,IACHT,EAAeK,MAEjBT,EAAK,gBAAiBM,EAAaG,OAGnCT,EAAK,eAAgBK,EAAYI,OAGnCT,EAAK,kBAAkB,EACzB,gEArFEc,EAkCeC,EAAA,CAjCZC,QAASC,EAAAD,QACT,mBAAcE,EAAA,KAAAA,EAAA,GAAAC,GAAEC,EAAAA,MAAK,iBAAmBD,IACxCE,UAAU,IAEAC,SACT,IAEO,CAFPC,EAEO,OAFPC,EAEOC,EADFR,EAAAS,OAAK,KAIDC,UACT,IAIE,CAJFC,EAIEC,EAAA,CAHAC,KAAK,WACJC,iBAAgBxB,EAChByB,iBAAgBrB,MAIVsB,SACT,IAYM,CAZNV,EAYM,MAZNW,EAYM,CAXJN,EAIEO,EAAA,CAHAC,QAAQ,mBACRC,MAAM,WACLC,uBAAOlB,EAAAA,MAAK,kBAAA,MAGfQ,EAIEO,EAAA,CAHCE,MAAOpB,EAAAsB,kBACPC,UAAWtC,EAAAO,OAAiBQ,EAAAuB,SAC5BF,QAAOzB"}