Files
bruno/app/dist/spa/assets/SideIncomeStep-BrBQMl9k.js
2026-02-19 18:54:57 +01:00

2 lines
2.5 KiB
JavaScript

import{as as V,$ as k,r as C,o as g,j as w,w as q,a0 as f,a3 as h,a1 as m,a4 as a,ae as Q,a5 as i,a8 as A,a9 as t,a6 as I,am as D,af as N,an as B,ah as R}from"./index-GXFLJtQL.js";import{Q as T}from"./QChip-DE2_FO3B.js";import{P as S}from"./LocalStorage-DjXJ9f5H.js";import{C as E}from"./CommentAttachment-DGUhSBXt.js";import{u as P}from"./vue-i18n.runtime-BXSOjn_j.js";import{_ as U}from"./IndexPage-C20RwqJI.js";import"./userstore-SjLknvTP.js";import"./QList-BZpTot_c.js";const _="sideIncome:v1",d={hasSideIncome:!1,sideIncomeDocuments:{comments:"",attachments:[]}};function j(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}const F=V("sideincomestore",{state:()=>{try{let e=S.getItem(_);if(typeof e=="string")try{e=JSON.parse(e)}catch{e=null}if(j(e))return{data:{...d,...e}}}catch{}return{data:{...d}}},actions:{persist(){try{S.set(_,this.data)}catch(e){console.error("sideIncome.store: persist error",e)}},getSideIncome(){return this.data},setSideIncome(e){this.data={...this.data,...e},this.persist()},replaceSideIncome(e){this.data=e,this.persist()},resetSideIncome(){this.data={...d},this.persist()}}}),O={class:"row items-center"},G={class:"col"},J={class:"text-h6"},K={class:"col-auto"},L=k({__name:"SideIncomeStep",props:{step:{}},emits:["next","prev"],setup(e,{emit:y}){const u=e,p=y,{t:o}=P(),n=F(),s=n.data,c=C(null);g(async()=>{await w(),c.value?.resetValidation?.()}),q(()=>s,()=>{n.persist()},{deep:!0});async function v(){try{if(await(c.value?.validate?.()??!0)===!1)return}catch{return}n.setSideIncome(s),p("next",u.step?.next)}function b(){n.setSideIncome(s),p("prev",u.step?.prev)}return(x,r)=>(h(),f(R,{flat:"",class:"full-width q-pa-none"},{default:m(()=>[a(Q,{class:"full-width"},{default:m(()=>[i("div",O,[i("div",G,[i("div",J,A(t(o)("SID")),1)]),i("div",K,[a(I,{flat:"",label:t(o)("button.prev"),onClick:b,class:"q-mr-sm"},null,8,["label"]),a(I,{color:"primary",label:t(o)("button.next"),onClick:v},null,8,["label"])])]),a(D,{class:"q-my-sm"}),a(T,{ref_key:"formRef",ref:c,class:"q-gutter-md q-mt-md"},{default:m(()=>[a(B,{class:"q-mb-md",modelValue:t(s).hasSideIncome,"onUpdate:modelValue":r[0]||(r[0]=l=>t(s).hasSideIncome=l),label:t(o)("sideIncome.hasSideIncome")},null,8,["modelValue","label"]),t(s).hasSideIncome?(h(),f(E,{key:0,class:"q-mt-none",modelValue:t(s).sideIncomeDocuments,"onUpdate:modelValue":r[1]||(r[1]=l=>t(s).sideIncomeDocuments=l),label:t(o)("sideIncome.attachments"),id:"documents"},null,8,["modelValue","label"])):N("",!0)]),_:1},512)]),_:1})]),_:1}))}}),ee=U(L,[["__scopeId","data-v-be25d2d0"]]);export{ee as default};