PageSourceSearch

https://dsparges.ro/_nuxt/5m2NjSA1.js

js dsparges.ro collected 2026-10-07 20:30:56 UTC 11,526 bytes, 6 lines download raw bytes

1import{_ as fe,d as pe,aB as p,aX as ve,a as be,c as ge,i as x,aM as ye,r as I,w as K,g as he,k as X,P as Ee,l as m,m as c,y as L,n as U,q as O,t as n,Q as Ie,a0 as Y,v as w,j as d,a3 as Le,F as C,x as q,C as J,E as Q,A as _e}from"./DEUfL-Pg.js";import{s as Fe}from"./CqfaxCxl.js";import{u as xe}from"./B_GIxUgM.js";import{u as we}from"./V2BZcG0p.js";import"./BUOvcqv_.js";import"./BkEKlvxv.js";import"./BvBYdgKS.js";import"./5tWKZlH5.js";import"./Cm1ESS5h.js";import"./C5MCsFHU.js";import"./Bz4lgz8B.js";import"./BeBaDx0q.js";try{let r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="535cd299-35c6-4ffb-80d4-3d5d912cf547",r._sentryDebugIdIdentifier="sentry-dbid-535cd299-35c6-4ffb-80d4-3d5d912cf547")}catch{}const Se={class:"w-full flex flex-column mt-1",style:{"min-width":"350px"}},ke={class:"field flex flex-column"},Ce={class:"field flex flex-column"},Re={for:"new-file",class:"p-button p-ripple"},Ne={class:"flex flex-column gap-4"},Ae=["for"],Be={class:"vfe-camera-container"},Me={class:"vfe-camera-container-child"},Ue={key:0,class:"vfe-camera-container-img"},qe=["src"],De={class:"vfe-button-container"},Oe=["onClick"],ze=["onClick"],Ge=["onClick"],Te=["href","download"],Pe={key:0,class:"vfe-camera-container-img"},$e=["src"],Ve={class:"vfe-button-container"},je=["onClick"],We=["onClick"],He=["onClick"],Ke={key:0,class:"vfe-message vfe-message-error"},Xe=pe({__name:"FECameraUpload",props:{name:{type:String,required:!0,meta:{group:p.GENERAL,label:"Name",component:{type:"InputText"}}},elementId:{type:Object,required:!0},formIndex:{type:Number,required:!0},depth:{type:Number,required:!0},inputId:{type:String,required:!0,meta:{group:p.GENERAL,label:"Input ID",component:{type:"InputText"}}},label:{type:String,required:!1,meta:{group:p.GENERAL,label:"Label",component:{type:"I18nEditor"}}},removeLabel:{type:String,required:!1,meta:{group:p.GENERAL,label:"Remove file label",component:{type:"I18nEditor"}}},editLabel:{type:String,required:!1,meta:{group:p.GENERAL,label:"Edit file label",component:{type:"I18nEditor"}}},downloadLabel:{type:String,required:!1,meta:{group:p.GENERAL,label:"Label",component:{type:"I18nEditor"}}},multiple:{type:Boolean,required:!1,meta:{group:p.GENERAL,label:"Multiple files?",component:{type:"InputSwitch",componentOptions:{binary:!0}}}},accept:{type:String,required:!1,meta:{group:p.GENERAL,label:"Type",component:{type:ve.OneOfString,componentOptions:{options:[{name:"All Images",value:"image/*"},{name:"JPEG Image",value:"image/jpeg"},{name:"PNG Image",value:"image/png"},{name:"WEBP Image",value:"image/webp"}]}}}},fileLimit:{type:Number,required:!1,default:5,meta:{group:p.GENERAL,label:"Max files",component:{type:"InputNumber"}}},maxFileSize:{type:Number,required:!1,meta:{group:p.GENERAL,label:"Max file size",component:{type:"InputNumber",componentOptions:{suffix:"Kb"}}}},invalidFileSizeMessage:{type:String,required:!1,meta:{group:p.GENERAL,label:"Invalid file size message",component:{type:"InputText"}}},invalidFileLimitMessage:{type:String,required:!1,meta:{group:p.GENERAL,label:"Invalid file limit message",component:{type:"InputText"}}},parentId:{type:Object,required:!1},events:{type:Object,required:!0},onReplaceUploadedFile:{type:String,required:!1,meta:{group:p.LIFECYCLE,label:"On replace existing file",component:{type:"ScriptEditor"}}},readOnly:{type:Boolean,required:!1,meta:{group:p.GENERAL,label:"Is element read only",component:{type:"InputSwitch",componentOptions:{binary:!0}}}}},setup(r){const a=be(),l=r,{t:R,s:N}=ge(l.elementId),z=x(()=>a.definitions[l.elementId.id].validation),{meta:G,errors:Z,handleChange:A,setValue:ee}=ye(a.definitions[l.elementId.id].objectPath,z,{bails:!1,controlled:!a.definitions[l.elementId.id].ignoreInput}),T=x(()=>{const e=l.label?R(N(l.label),l.label):l.label;return z.value.required?`${e} *`:e}),P=x(()=>l.removeLabel?R(N(l.removeLabel),l.removeLabel):l.removeLabel),te=x(()=>l.editLabel?R(N(l.editLabel),l.editLabel):l.editLabel),ae=x(()=>l.downloadLabel?R(N(l.downloadLabel),l.downloadLabel):l.downloadLabel),D=I(null),s=I(null),{modelValue:E}=xe(l.elementId,ee),S=I(!1),B=I(),k=I(),M=I(!1),v=I(),g=I(),{disabledState:_}=we(l.elementId.id),$=()=>{D.value&&(D.value.value="",v.value=void 0,B.value=void 0,k.value=void 0,g.value=void 0,M.value=!1)},le=e=>{S.value=!0,v.value=e},ie=e=>{M.value=e},ne=e=>{if(e===0)return"0 B";let t=1e3,o=2,u=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],f=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,f)).toFixed(o))+" "+u[f]},oe=e=>{const t=e.filter(o=>o.type.startsWith("image/"));E.value=t},se=e=>{if(e.target){const t=e.target;t.files&&t.files.length==1&&(k.value=t.files[0].name,g.value=t.files[0],B.value=`1 Fisier: ${ne(t.files[0].size)}`)}},de=async()=>{var e,t,o,u;if(g.value&&v.value){const f=await g.value.arrayBuffer().then(y=>{var h;return new Blob([new Uint8Array(y)],{type:(h=g.value)==null?void 0:h.type})}),i=new File([f],k.value);
1if(i.uuid=v.value.uuid,!a.forms[0].attachmentsEdit)a.forms[0].attachmentsEdit=[],a.forms[0].attachmentsEdit.push(i);else{const y=a.forms[0].attachmentsEdit.findIndex(h=>h.uuid==g.value.uuid);a.forms[0].attachmentsEdit[y]=i}if(s.value){const y=s.value.uploadedFiles.findIndex(b=>b.uuid==i.uuid),h=URL.createObjectURL(i);s.value.uploadedFiles[y]={href:h,name:i.name,uuid:v.value.uuid,lastModified:i.lastModified,size:i.size,type:i.type}}}if(v.value)if(!a.forms[0].attachmentsEditId)a.forms[0].attachmentsEditId=[],a.forms[0].attachmentsEditId.push(v.value.uuid);else if(!a.forms[0].attachmentsEditId.includes(v.value.uuid))a.forms[0].attachmentsEditId.push(v.value.uuid),g.value&&((e=a.forms[0].attachmentsEdit)==null||e.push(g.value));else{const f=a.forms[0].attachmentsEditId.indexOf(v.value.uuid);(t=a.forms[0].attachmentsEdit)==null||t.splice(f,1),(o=a.forms[0].attachmentsEditId)==null||o.splice(f,1),g.value&&((u=a.forms[0].attachmentsEdit)==null||u.push(g.value)),a.forms[0].attachmentsEditId.push(v.value.uuid)}if(l.onReplaceUploadedFile&&l.onReplaceUploadedFile!="")try{await new _e("$fe_existing_file, $fe_new_file, $fe_set_loading_state",l.onReplaceUploadedFile)(v.value,g.value,ie)&&(S.value=!1,M.value=!1)}catch(f){console.error(f)}$()},re=e=>{if(s.value&&s.value.files){const t=s.value.files.filter((o,u)=>u!==e);s.value.files=t}s.value&&E.value&&(E.value.splice(e,1),E.value=[...E.value])},ue=e=>{if(s.value&&s.value.uploadedFiles){const t=s.value.uploadedFiles.filter((o,u)=>u!==e);s.value.uploadedFiles=t}},me=e=>{if(a.forms[0].attachmentsDelete?a.forms[0].attachmentsDelete.push(e):a.forms[0].attachmentsDelete=[e],a.forms[0].attachmentsEditId&&a.forms[0].attachmentsEditId.includes(e)){const t=a.forms[0].attachmentsEditId.indexOf(e);a.forms[0].attachmentsEditId.splice(t,1),a.forms[0].attachmentsEdit&&a.forms[0].attachmentsEdit.splice(t,1)}};K(E,e=>{let t=!1;Array.isArray(e)&&e.length>0&&(t=e.some(o=>o instanceof File),s.value&&!t&&(s.value.uploadedFiles=e.filter(o=>o.href!=null)))},{immediate:!0});const ce=x(()=>{var e,t;const o=((e=s.value)==null?void 0:e.uploadedFiles.length)||0,u=((t=s.value)==null?void 0:t.files.length)||0,f=o+u,i=l.fileLimit-f;return new Array(i).fill(void 0)});function V(e){var t,o;const u=(o=(t=s.value)==null?void 0:t.$el)==null?void 0:o.querySelector('input[type="file"]');u&&(e?u.setAttribute("capture",e):u.removeAttribute("capture"))}const j=x(()=>{var e;return l.multiple||(((e=E.value)==null?void 0:e.length)??0)>0?void 0:"user"});he(()=>{V(j.value)}),K(j,e=>{V(e)});const W=e=>e instanceof File?e.objectURL:e.href;return(e,t)=>{const o=X("InputText"),u=X("Button"),f=Ee("ripple");return m(),c(C,null,[L(` =====================================================================
2       Camera Upload Component
3       - Provides a camera-based file upload interface
4       - Supports image preview, editing, and management
5       - Handles file validation and size restrictions
6       ===================================================================== `),U(d(Le),{closable:!0,appendTo:"body",visible:S.value,"onUpdate:visible":[t[1]||(t[1]=i=>S.value=i),t[2]||(t[2]=i=>{S.value=i,i||$()})],modal:!0,header:"Inlocuieste poze"},{default:O(()=>[n("div",Se,[n("div",ke,[t[5]||(t[5]=n("label",{for:"new-filename"},"Nume fisiere",-1)),U(o,{id:"new-filename",modelValue:k.value,"onUpdate:modelValue":t[0]||(t[0]=i=>k.value=i)},null,8,["modelValue"])]),n("div",Ce,[Ie((m(),c("label",Re,[Y(w(B.value?B.value:"Selecteaza un fisier"),1)])),[[f]]),n("input",{onChange:se,type:"file",class:"hidden",id:"new-file",ref_key:"toBeUploadedFileInputRef",ref:D},null,544)])]),U(u,{onClick:de,loading:M.value},{default:O(()=>t[6]||(t[6]=[Y("Salveaza")])),_:1},8,["loading"])]),_:1},8,["visible"]),U(d(Fe),{name:d(a).definitions[r.elementId.id].objectPath,multiple:r.multiple,accept:l.accept,maxFileSize:r.maxFileSize,fileLimit:r.fileLimit,invali
6dFileSizeMessage:r.invalidFileSizeMessage,invalidFileLimitMessage:r.invalidFileLimitMessage,disabled:d(_)?d(_):r.readOnly,"data-uuid":e.$attrs["data-uuid"],ref_key:"cameraUploadRef",ref:s,onSelect:t[3]||(t[3]=({originalEvent:i,files:y})=>{oe(y),d(A)(i)}),onChange:t[4]||(t[4]=()=>{d(A)(d(E))})},{header:O(({chooseCallback:i,uploadedFiles:y,files:h})=>[n("div",Ne,[n("div",null,[T.value?(m(),c("label",{key:0,for:r.inputId,class:"text-color-secondary mb-2"},w(T.value),9,Ae)):L("v-if",!0)]),n("div",Be,[L(" EXISTING FILES  "),(m(!0),c(C,null,q(y,(b,F)=>(m(),c("div",{key:F,class:"flex flex-column"},[n("div",Me,[b?(m(),c("div",Ue,[n("img",{src:W(b),alt:"Image Preview"},null,8,qe),n("div",De,[n("div",{class:J(["vfe-edit-button",{"vfe-disabled":d(_)}]),onClick:H=>d(_)?null:le(b)},[n("span",null,w(te.value),1)],10,Oe),n("div",{onClick:Q(H=>{d(_)||ue(F),d(A)(h),me(b.uuid)},["prevent"]),class:J(["vfe-remove-button",{"vfe-disabled":d(_)}])},[n("span",null,w(P.value),1)],10,ze)])])):(m(),c("div",{key:1,onClick:i,class:"vfe-camera-container-text"},[...t[7]||(t[7]=[n("span",{class:"material-symbols-outlined text-primary"},"photo_camera",-1)])],8,Ge))]),n("a",{href:b.href,class:"vfe-download-button",target:"_blank",download:b.name},w(ae.value),9,Te)]))),128)),L(" FILES TO BE UPLOADED  "),h.length>0?(m(!0),c(C,{key:0},q(h,(b,F)=>(m(),c("div",{key:F,class:"vfe-camera-container-child"},[b?(m(),c("div",Pe,[n("img",{src:W(b),alt:"Image Preview"},null,8,$e),n("div",Ve,[n("div",{onClick:Q(H=>{re(F),d(A)(h)},["prevent"]),class:"vfe-remove-button vfe-height"},[n("span",null,w(P.value),1)],8,je)])])):(m(),c("div",{key:1,onClick:i,class:"vfe-camera-container-text"},[...t[8]||(t[8]=[n("span",{class:"material-symbols-outlined text-primary"},"photo_camera",-1)])],8,We))]))),128)):L("v-if",!0),L(" UPLOAD SLOTS (PLACEHOLDERS)  "),d(_)?L("v-if",!0):(m(!0),c(C,{key:1},q(ce.value,(b,F)=>(m(),c("div",{key:"slot#"+F,class:"vfe-camera-container-child"},[n("div",{onClick:i,class:"vfe-camera-container-text"},[...t[9]||(t[9]=[n("span",{class:"material-symbols-outlined text-primary"},"photo_camera",-1)])],8,He)]))),128))])])]),_:1},8,["name","multiple","accept","maxFileSize","fileLimit","invalidFileSizeMessage","invalidFileLimitMessage","disabled","data-uuid"]),!d(G).valid&&d(G).touched?(m(),c("div",Ke,[(m(!0),c(C,null,q(d(Z),(i,y)=>(m(),c("div",{key:y},w(i),1))),128))])):L("v-if",!0)],64)}}}),dt=fe(Xe,[["__scopeId","data-v-08013dd7"],["__file","/var/lib/jenkins/workspace/dps-form-editor/src/components/ComponentDefinitions/FECameraUpload/FECameraUpload.vue"]]);export{dt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.