import{a as d}from"./chunk-ABXDWOZI.js";import"./chunk-4NGHU5PZ.js";import"./chunk-NWOU67BD.js";import"./chunk-TBSUMTHM.js";import"./chunk-CKJJI5MU.js";import"./chunk-TAT3HGQ4.js";import"./chunk-4SWKWV3M.js";import"./chunk-DY645AKB.js";import"./chunk-5I5ZFUTL.js";import"./chunk-QN66BDDM.js";import"./chunk-JBNKEIUX.js";import"./chunk-5SW267PH.js";import"./chunk-PU7DBJLZ.js";import"./chunk-3DDBG3AR.js";import"./chunk-5MLUVH77.js";import"./chunk-SMMBZMNL.js";import"./chunk-S5GA3KRV.js";import"./chunk-EFONMPAR.js";import"./chunk-YQXLYYOT.js";import"./chunk-6RITFGP2.js";import"./chunk-HGXDKXJP.js";import"./chunk-WQUXAKOL.js";import"./chunk-LYNKRDJC.js";import"./chunk-SKY4LXUD.js";import"./chunk-BZT47AWD.js";import"./chunk-5WQBRAHK.js";import"./chunk-4FTRQKHH.js";import"./chunk-BYXBJQAS.js";import"./chunk-TTWRMELT.js";import"./chunk-EMJ4QQUL.js";import"./chunk-QPCAJSKO.js";import"./chunk-QV67LFVX.js";import"./chunk-4O3FVBGX.js";import"./chunk-TGWIHQDX.js";import"./chunk-Q5KZV54I.js";import"./chunk-YHVRQUSB.js";import"./chunk-N7PBPSN6.js";import"./chunk-3Z7PXZF3.js";import"./chunk-43BLBOSI.js";import"./chunk-IWSLIKCG.js";import"./chunk-2DXJE6G7.js";import"./chunk-7RP244JU.js";import"./chunk-LHGSJXTX.js";import"./chunk-ZKNPBXGB.js";import{b as l}from"./chunk-S3ADKFO2.js";import"./chunk-I5MYHHJE.js";import{Fb as o,Ib as n,gb as i,lb as r}from"./chunk-CKLXM6EG.js";import"./chunk-TSRGIXR5.js";var c=class a{constructor(s){this.translate=s;this.buildHighlightStyles(),this.translate.onLangChange.subscribe(()=>{this.buildHighlightStyles()})}iconPath="../../../../assets/images/sidebar-icons/purchase.svg";iconAlt="purchase";draftStyle={color:"#BF9300",backgroundColor:"rgba(191, 147, 0, 0.08)",fontWeight:"bold",padding:"10px",borderRadius:"5px",whiteSpace:"nowrap"};submittedStyle={color:"#1D8702",backgroundColor:"#1D870214",fontWeight:"bold",padding:"10px",borderRadius:"5px",whiteSpace:"nowrap"};pendingStyle={color:"#FFC107",backgroundColor:"#FFF8E1",fontWeight:"bold",padding:"10px",borderRadius:"5px",whiteSpace:"nowrap"};rejectedStyle={color:"red",backgroundColor:"#FFEBEE",fontWeight:"bold",padding:"10px",borderRadius:"5px",whiteSpace:"nowrap"};otherStyle={color:"grey",backgroundColor:"#f0f0f0ff",fontWeight:"bold",padding:"10px",borderRadius:"5px",whiteSpace:"nowrap"};otherStyleType={color:"#112129"};Field;tableHighlightedFields={};ngOnInit(){this.Field=[{type:"select",title:"status",controlName:"status",class:"col-3",options:[{name:this.translate.instant("status.draft"),id:"draft"},{name:this.translate.instant("status.rejected"),id:"rejected"},{name:this.translate.instant("status.approved"),id:"approved"},{name:this.translate.instant("status.submitted"),id:"submitted"}]},{type:"dateWithOptions",title:"date_range",controlName:"date",fromControlName:"from",toControlName:"to",showQuickButtons:!0,class:"col-6",parentClass:"col-6"},{type:"select",title:"priority",controlName:"priority",class:"col-3",options:[{name:this.translate.instant("Urgent"),id:"Urgent"},{name:this.translate.instant("High"),id:"High"},{name:this.translate.instant("Medium"),id:"Medium"},{name:this.translate.instant("Low"),id:"Low"}]},{type:"select",title:"department",options:[],class:"col-3",optionsUrl:"procurement/public/departments",controlName:"department_id",optionName:"name"},{type:"select",title:"new_product",class:"col-3",controlName:"has_new_product",options:[{name:this.translate.instant("Yes"),id:1},{name:this.translate.instant("No"),id:0}]},{type:"select",title:"type",controlName:"type",class:"col-3",options:[{name:this.translate.instant("direct"),id:"direct"},{name:this.translate.instant("indirect"),id:"indirect"}]}]}floorsHeaders=["id","pr_number","employee_name","department.name","type.value","date","updated_at","status.name"];titlesOfMenu=[{label:"show",action:"show",routerLink:"/purchase-request/show-purchase-request",queryParams:{mode:"show"}},{label:"edit",action:"draft",routerLink:"/purchase-request/edit-purchase-request",queryParams:{mode:"edit"}},{label:"delete",action:"delete",permission:"delete purchase_requests"}];buildHighlightStyles(){let s=this.translate.instant("status.draft"),e=this.translate.instant("type.direct"),t="indirect",u=this.translate.instant("status.submitted"),h=this.translate.instant("status.approved"),p=this.translate.instant("status.rejected");this.tableHighlightedFields={"status.name":{fieldToCheck:"status.name",stylesByValue:{[s]:this.draftStyle,[u]:this.submittedStyle,[h]:this.submittedStyle,[p]:this.rejectedStyle,[e]:this.rejectedStyle,__other__:this.otherStyle}},"type.value":{fieldToCheck:"type.value",stylesByValue:{[e]:this.rejectedStyle,__other__:this.otherStyleType},showIconForValue:[e],iconHtml:`
  <i 
    class="fa-solid fa-circle-exclamation" 
    style="
      margin-left: 5px;
      color: #DA303014;
      background-color: #ffebeb;
      border-radius: 50%;
      padding: 4px;
      font-size: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    ">
  </i>
`}},console.log(this.tableHighlightedFields,"tableHighlightedFields")}static \u0275fac=function(e){return new(e||a)(i(l))};static \u0275cmp=r({type:a,selectors:[["app-purchase-requests-list"]],decls:1,vars:20,consts:[["routeOfButton2","/purchase-request/create-purchase-request","titleOfButton2","create-purchase-request","url","procurement/purchase-request","translationPrefixx","purchase-request","titleOfPage","purchase-request","deleteRowUrl","procurement/purchase-request","classesForTable","designOne","iconOfBtn2","fa-solid fa-plus","translationPrefix","purchase-request","deleteRowUrls","procurement/purchase-request",3,"ShowButton","Menu","showIconORTITLE","filterKeyData","filterSearchField","ShowModal","headers","showMenubar","ShowButton3","showFilter","ShowButton2","showTitle","showBreadcrumb","bulkmode","iconPath","iconAlt","useCustomStatusStyling","tableHighlightedFields","ApplyTheFunctionOfDraft"]],template:function(e,t){e&1&&n(0,"app-page-body",0),e&2&&o("ShowButton",!1)("Menu",t.titlesOfMenu)("showIconORTITLE",!0)("filterKeyData",t.floorsHeaders)("filterSearchField",t.Field)("ShowModal",!1)("headers",t.floorsHeaders)("showMenubar",!0)("ShowButton3",!0)("showFilter",!0)("ShowButton",!0)("ShowButton2",!0)("showTitle",!0)("showBreadcrumb",!0)("bulkmode",!0)("iconPath",t.iconPath)("iconAlt",t.iconAlt)("useCustomStatusStyling",!1)("tableHighlightedFields",t.tableHighlightedFields)("ApplyTheFunctionOfDraft",!0)},dependencies:[d],styles:["i[_ngcontent-%COMP%]   .exclamation[_ngcontent-%COMP%]{display:none}.exclamation-icon[_ngcontent-%COMP%]{margin-left:5px;background-color:#fff0f0;border-radius:50%;padding:3px;font-size:12px;display:inline-flex;align-items:center;justify-content:center}[_nghost-%COMP%]     label{color:#145055}"]})};export{c as PurchaseRequestsList};
