import{Ib as i,Oa as o,Td as u,gd as r,id as c,md as a,nd as e}from"./chunk-CZOGMAXR.js";var p=class l{_descriptorInput=e(null,{alias:"descriptor"});get descriptor(){return this._descriptorInput()}_contextInput=e(void 0,{alias:"context"});get context(){return this._contextInput()}_currentFormInput=e(void 0,{alias:"currentForm"});get currentForm(){return this._currentFormInput()}_onControlTouchedInput=e(t=>{},{alias:"onControlTouched"});get onControlTouched(){return this._onControlTouchedInput()}_controlValueInput=e(null,{alias:"controlValue"});controlValue=c(()=>this._controlValueInput()??null);onValueChanged=t=>this.defaultValueChanged(t);valueChanged=a();constructor(){o(()=>{this._descriptorInput(),r(()=>this.descriptorChanged())}),o(()=>{this._controlValueInput(),r(()=>this.applyNewValue())})}ngOnInit(){this.initContent()}ngAfterContentInit(){this.descriptor?.autofocus&&setTimeout(()=>{this.setFocus()})}setControlValue(t){!t&&t!==0&&t!==BigInt(0)&&(t=null),this.controlValue.set(t),this.applyNewValue()}onAction(t){if(!t.execute)return;let n=u.evalInContext(t.execute,this.context);n&&this.setControlValue(n)}applyNewValue(){}setFocus(){let t=this.getFocusableControl();t&&t.nativeElement.focus()}getFocusableControl(){return null}defaultValueChanged(t){this.controlValue.set(t),this.valueChanged.emit(t)}initContent(){}descriptorChanged(){}static \u0275fac=function(n){return new(n||l)};static \u0275dir=i({type:l,inputs:{_descriptorInput:[1,"descriptor","_descriptorInput"],_contextInput:[1,"context","_contextInput"],_currentFormInput:[1,"currentForm","_currentFormInput"],_onControlTouchedInput:[1,"onControlTouched","_onControlTouchedInput"],_controlValueInput:[1,"controlValue","_controlValueInput"]},outputs:{valueChanged:"valueChanged"}})};export{p as a};
