import{a as F}from"./chunk-6PGGAAYD.js";import{y,z as I}from"./chunk-3SGEAGU4.js";import{e as n,f as P}from"./chunk-DQXXLIFV.js";import{$b as d,Ab as s,Gb as r,Ld as b,Rb as l,ac as u,bc as f,cc as c,dc as m,fd as g,kc as h,nb as a,ud as v}from"./chunk-LU6Q5ONP.js";P();var t=function(e){return e.PlainText="PlainText",e.RTF="RTF",e}(t||{});g();b();function R(e,T){if(e&1&&(c(0),f(1,"paw-input-field",2),m()),e&2){let i=h();a(),l("field",i.noteInputField)("model",i.noteModel)}}var D=(()=>{class e{constructor(){this.model=null,this.fieldId="note",this.editorType=t.PlainText,this.dialogTitle="Note",this.noteActions={cancel:{id:"note-popup-cancel",label:"Cancel",type:"paw-icon-btn",onSelected:()=>{this.dialogRef.close()}},submit:{id:"nonte-popup-save",label:"Save",type:"mat-flat-button",color:"primary",icon:"fa fa-save",onSelected:()=>this.save()}},this.dialogActions=[this.noteActions.cancel,this.noteActions.submit],this.noteModel={note:""},this.noteInputField=null}ngOnInit(){this.compileInputField(),this.setDisabledFeature(),this.setValuePropertyRef()}save(){return this.valuePropertyRef.property[this.fieldId]=this.noteModel.note,this.dialogRef.close(),this.onSave?.()}setValuePropertyRef(){this.valuePropertyRef=n.getValuePropertyRef(this.model,this.fieldId),n.isSet(this.valuePropertyRef)&&(this.noteModel.note=n.isSet(this.valuePropertyRef?.valueId)?this.valuePropertyRef.property[this.valuePropertyRef.valueId]:this.valuePropertyRef.property[this.fieldId])}compileInputField(){switch(this.editorType){case t.RTF:this.noteInputField={id:"note",component:F,toolbar:!1};break;case t.PlainText:default:this.noteInputField={id:"note",component:I};break}}setDisabledFeature(){this.noteInputField.feature=this.disabledFeature,this.noteActions.cancel.hideFeature=this.disabledFeature,this.noteActions.submit.hideFeature=this.disabledFeature}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=s({type:e,selectors:[["paw-note-popup"]],inputs:{model:"model",fieldId:"fieldId",dialogRef:"dialogRef",disabledFeature:"disabledFeature",editorType:"editorType",onSave:"onSave"},standalone:!1,decls:2,vars:1,consts:[[1,"paw-padding-left-m","paw-padding-right-m","paw-padding-top-s"],[4,"ngIf"],[1,"w-full","h-full",3,"field","model"]],template:function(o,p){o&1&&(d(0,"div",0),r(1,R,2,2,"ng-container",1),u()),o&2&&(a(),l("ngIf",p.model&&p.noteInputField))},dependencies:[v,y],encapsulation:2})}}return e})();export{t as a,D as b};
