import{r as i,h as e,H as t}from"./p-a0569a5f.js";import{I as a}from"./p-f7077f5c.js";import{I as s}from"./p-1dd4a9a0.js";import"./p-7737f905.js";import"./p-d343a062.js";import"./p-f46dff5e.js";const n={seeMore:"See More"};let d=class{constructor(e){i(this,e),this.showInfoDetailDialog=!1,this.itemFetchState=s.init()}async componentWillLoad(){this.strings=await this.apiSozluk.getContent(this.view.i18nEntryId,n);const{apiData:i,params:e,view:t}=this,{query:s,table:d}=t;this.itemDataProvider=new a(i,e,d,s,(null==s?void 0:s.fields)||t.table.fields,(i=>{this.itemFetchState=i})),(null==e?void 0:e.item)||this.itemDataProvider.fetchData(this.itemFetchState)}componentDidUpdate(){const{params:i,itemFetchState:e}=this;(null==i?void 0:i.item)||e.data||e.isPending||e.error||this.itemDataProvider.fetchData(this.itemFetchState)}async invalidate(i){this.itemDataProvider.fetchData(this.itemFetchState)}onAction(i){"open-dvn-card-view-detail-view"===i.detail.name&&(i.preventDefault(),this.showInfoDetailDialog=!0)}render(){var i,a,s;const{itemFetchState:n,showInfoDetailDialog:d,view:o}=this,{ui:r}=o,l=o.table.fields,c=(null===(i=this.params)||void 0===i?void 0:i.item)||n.data;return e(t,null,!n.isPending&&!n.error&&e("dvn-card-view",r.summaryCardConfig?{key:`summary-card-view-${c._id}`,config:Object.assign(Object.assign({},r.summaryCardConfig),{footer:Object.assign(Object.assign({},r.summaryCardConfig.footer||{}),{actions:[...(null===(s=null===(a=r.summaryCardConfig)||void 0===a?void 0:a.footer)||void 0===s?void 0:s.actions)||[],{ui:{label:this.strings.seeMore,name:"open-dvn-card-view-detail-view",view:"flat"}}]})}),fields:l,item:c,cornerRadius:r.cardCornerRadius,leaned:!0,overrideStyle:{width:"100%"}}:{key:`card-view-${c._id}`,config:r.cardConfig,fields:l,item:c,cornerRadius:r.cardCornerRadius,leaned:!0,overrideStyle:{width:"100%"}}),n.isPending&&e("div",{class:"d-flex flex-grow-1 align-items-center justify-content-center detail-view-progress-container"},e("dvn-progress",{indefinite:!0,tint:"primary"})),n.error&&e("div",{class:"d-flex flex-grow-1 align-items-center justify-content-center flex-column detail-view-progress-container"},"Fetching data failed.",e("dvn-button",{onClick:()=>this.itemDataProvider.fetchData(this.itemFetchState)},"Retry")),d&&e("dvn-dialog",{shown:this.showInfoDetailDialog,onDismiss:()=>this.showInfoDetailDialog=!1,raw:!0},e("dvn-card-view",{key:`detail-card-view-${c._id}`,config:r.cardConfig,fields:l,item:c,cornerRadius:r.cardCornerRadius,leaned:!0,overrideStyle:{width:"100%"}})))}};d.style=".sc-dvn-app-view-detail-view-card-h{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:stretch;align-items:stretch;max-width:100%;overflow:auto}.detail-view-progress-container.sc-dvn-app-view-detail-view-card{padding:calc(4 * var(--spacing-unit))}";export{d as dvn_app_view_detail_view_card}