"use strict";(this.webpackChunk_tsmesolutions_cubes_initiatives=this.webpackChunk_tsmesolutions_cubes_initiatives||[]).push([[7273],{7273:(e,t,l)=>{l.r(t),l.d(t,{default:()=>v});var s=l(24590),a=l(90726);const n={items:{type:Array,default:[]},frequency:{type:Number,default:a.FrequencyType.Monthly},bulk:Object,bulkData:Array};var c=l(16464);const o={class:"table-responsive",style:{"max-height":"330px"}},r={class:"table mb-0"},i={class:"sticky-top"},d={class:"d-flex align-items-center bg-muted"},u={key:0,class:"flex-fill align-self-center ml-4"},m={class:"align-middle text-center border-0",style:{width:"20%"}},p={class:"align-middle text-center border-0",style:{width:"20%"}},h=(0,s.defineComponent)({__name:"reset-initiative-table@signle",props:n,setup(e){const t=e,n=(0,s.inject)(c.Ow.initiativeLayoutContext),h=n.translation.tResetInitiative,v=a.IoC.DI().resolve(c.Ow.appContext).translation.global,k=(0,s.toRef)(t,"bulk"),b=(0,s.toRef)(t,"items"),f=(0,s.computed)(()=>{let e=[];return k.value?(!k.value.areAllSelected&&e.push({title:e=>v.value.selectAll,handler:e=>(w(t.items),k.value.checkAll(!0),Promise.resolve())}),k.value.selectedSet.size&&e.push({title:e=>v.value.unselectAll,handler:()=>(g(t.items),k.value.checkAll(!1),Promise.resolve()),divider:!1}),e):e}),y=e=>{k.value.updateSelection(e.id,e.selected),e.workItems&&e.workItems?.forEach(e=>{y(e)})},w=e=>{e.forEach(e=>{e.selected=!0,e.disabled=n.props.isHardReset.value,e.workItems&&w(e.workItems)})},g=e=>{e.forEach(e=>{e.selected=!1,e.disabled=!1,e.workItems&&g(e.workItems)})},E=e=>{e?(w(t.items),k.value.checkAll(!0)):(g(t.items),k.value.checkAll(!1)),k.value.onBulkActionsCheck(e)};(0,s.watch)(()=>b.value,e=>e.forEach(e=>e.setSelected(k.value.selectedSet.has(e.id)))),(0,s.watch)(()=>n?.props?.isHardReset?.value,()=>E(!1));const C=(0,s.defineAsyncComponent)(()=>l.e(4495).then(l.bind(l,34495)));return(e,t)=>{const l=(0,s.resolveComponent)("app-bulk-actions");return(0,s.openBlock)(),(0,s.createElementBlock)("div",o,[(0,s.createElementVNode)("table",r,[(0,s.createElementVNode)("thead",i,[(0,s.createElementVNode)("tr",d,[(0,s.createVNode)(l,{selected:k.value.selectedSet,items:e.bulkData,actions:f.value,"checkbox-id":"reset",class:"border-0",style:{width:"60%"},hideSelected:"",onChange:E},{default:(0,s.withCtx)(e=>{let{selected:t}=e;return[t.length?(0,s.createCommentVNode)("v-if",!0):((0,s.openBlock)(),(0,s.createElementBlock)("span",u,(0,s.toDisplayString)((0,s.unref)(v).period),1))]}),_:1},8,["selected","items","actions"]),(0,s.createElementVNode)("th",m,(0,s.toDisplayString)((0,s.unref)(h).data),1),(0,s.createElementVNode)("th",p,(0,s.toDisplayString)((0,s.unref)(v).status),1)])]),(0,s.createElementVNode)("tbody",null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(b.value,t=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(C),{"model-value":t,frequency:e.frequency,"onUpdate:modelValue":y},null,8,["model-value","frequency"]))),256))])])])}}}),v=h}}]);
//# sourceMappingURL=cf9a341745b62189d8d1.js.map