import{b as f}from"./chunk-DQ3OEJZG.js";import{a as d}from"./chunk-MMXOO6K2.js";import{d as m}from"./chunk-Z3X6CMPV.js";import{q as c,r as s}from"./chunk-4TTMHS7H.js";import{a,na as l}from"./chunk-NYZDFFAU.js";var p=class{static fromFeature(t){return t.action}};var S=class extends f{constructor(t,n){super(t,{featureId:"DatagridEditFormFeature",onSelected:e=>{if(!s.isSet(e.commitRecord)||s.isFunction(this.featureSettings.recordFeature)&&!this.featureSettings.recordFeature(e.commitRecord,e))return;let o=e.getInputFieldsFor(e.commitRecord);if(!s.isSet(o))return;let h=e.getFieldSet(e.commitRecord);c.iterate(this.featureSettings.getColumns(),i=>{let r=s.isFunction(i.inputField)?i.inputField(e.commitRecord,e):i.inputField;!r||c.exists(o,u=>u.id===r.id)||(r.bind.fieldSet=h,o.push(a({},r)))});let F=this.dialogService.open({title:this.featureSettings.title||"",styleClass:this.featureSettings.styleClass,size:this.featureSettings.size,onClose:()=>{e.clearAddRecord(),e.clearCommitRecord(),e.clearSelection()},component:d,bindings:{fields:o,groups:this.featureSettings.groups,grouppingStyleClass:this.featureSettings.grouppingStyleClass,model:a({},e.commitRecord),actions:[{id:"datagrid-edit-record-cancel",label:"Cancel",type:"paw-chip-btn",onSelected:()=>{F.close()}}],settings:{onSubmit:(i,r)=>this.featureSettings.submitRecord(i,e)},submitAction:{id:"datagrid-edit-record-submit"}}})},display:"selection"}),this.featureSettings=n,this.dialogService=l(m),t.icon="fa-regular fa-edit",t.label=""}recordFeature(t,n){return this.featureSettings.recordFeature?this.featureSettings.recordFeature(t,n):!0}};export{p as a,S as b};
