import { Component, Input } from "@angular/core";
import { FormGroup } from "@angular/forms";
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@seniorsistemas/angular-components/dynamic-form";
export class InlineEditLookupComponent {
    field;
    formGroup = new FormGroup({});
    tempValue = '';
    ngOnInit() {
        if (this.formGroup && this.field) {
            this.tempValue = this.formGroup.get(this.field.name)?.value || "";
        }
    }
    saveValue() {
        if (this.formGroup && this.field) {
            this.formGroup.get(this.field.name)?.setValue(this.tempValue);
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: InlineEditLookupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: InlineEditLookupComponent, selector: "ng-component", inputs: { field: "field", formGroup: "formGroup" }, ngImport: i0, template: "<s-lookup\n    [id]=\"field.name\"\n    [multiple]=\"field.multiple\"\n    [lookupSuggestions]=\"field.lookupSuggestions\"\n    [dataKey]=\"field.dataKey\"\n    [placeholder]=\"field.placeholder\"\n    [showSearch]=\"field.showSearch\"\n    [searchFields]=\"field.searchFields\"\n    [searchGridFields]=\"field.searchGridFields\"\n    [searchGridData]=\"field.gridData\"\n    (onLookupRequest)=\"field.onLookupRequest ? field.onLookupRequest($event) : null\"\n    (onSearchRequest)=\"field.onSearchRequest ? field.onSearchRequest($event) : null\"\n    [lookupDisplayField]=\"field.lookupDisplayField\"\n    [searchTotalRecords]=\"field.searchTotalRecords\"\n    [labelOptions]=\"{\n            filterTitle: field.filterTitle,\n            searchTotalRecordsLabel: field.searchTotalRecordsLabel,\n            searchEmptyTitle: field.searchEmptyTitle,\n            searchTitle: field.searchTitle,\n\n    }\"\n    (onSelect)=\"field.onSelect($event)\"\n    (onUnselect)=\"field.onUnselect($event)\"\n    (onClear)=\"field.onClear ? field.onClear($event) : null\"\n    (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n    [lookupAppendTo]=\"field.appendTo\"\n    [lookupEmptyMessage]=\"field.emptyMessage\"\n    [defaultFilter]=\"field.defaultFilter\"\n    [autocompleteForceSelection]=\"field.autocompleteForceSelection\"\n    [showAddOption]=\"field.showAddOption\"\n    [showEditOption]=\"field.showEditOption\"\n    [showRemoveOption]=\"field.showRemoveOption\"\n    (onAdd)=\"field.onAdd ? field.onAdd() : null\"\n    (onEdit)=\"field.onEdit ? field.onEdit($event) : null\"\n    (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n    [(ngModel)]=\"tempValue\">\n</s-lookup>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LookupComponent, selector: "s-lookup", inputs: ["formControlName", "id", "autocompleteForceSelection", "multiple", "dataKey", "disabled", "showSearch", "lookupSuggestions", "lookupDisplayField", "lookupDisplayFieldTooltip", "lookupEmptyMessage", "lookupAppendTo", "searchEmptyDescription", "searchGridData", "searchTotalRecords", "searchFields", "searchGridFields", "multiSortMeta", "placeholder", "sortableColumnsDisabled", "lookupRowProps", "defaultFilter", "showAddOption", "showEditOption", "showRemoveOption", "dialogFullScreen", "labelOptions"], outputs: ["onLookupRequest", "onSearchRequest", "onFocus", "onBlur", "onKeyUp", "onSelect", "onUnselect", "onClear", "onAdd", "onEdit", "onRemove", "onClearButtonClick"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: InlineEditLookupComponent, decorators: [{
            type: Component,
            args: [{ template: "<s-lookup\n    [id]=\"field.name\"\n    [multiple]=\"field.multiple\"\n    [lookupSuggestions]=\"field.lookupSuggestions\"\n    [dataKey]=\"field.dataKey\"\n    [placeholder]=\"field.placeholder\"\n    [showSearch]=\"field.showSearch\"\n    [searchFields]=\"field.searchFields\"\n    [searchGridFields]=\"field.searchGridFields\"\n    [searchGridData]=\"field.gridData\"\n    (onLookupRequest)=\"field.onLookupRequest ? field.onLookupRequest($event) : null\"\n    (onSearchRequest)=\"field.onSearchRequest ? field.onSearchRequest($event) : null\"\n    [lookupDisplayField]=\"field.lookupDisplayField\"\n    [searchTotalRecords]=\"field.searchTotalRecords\"\n    [labelOptions]=\"{\n            filterTitle: field.filterTitle,\n            searchTotalRecordsLabel: field.searchTotalRecordsLabel,\n            searchEmptyTitle: field.searchEmptyTitle,\n            searchTitle: field.searchTitle,\n\n    }\"\n    (onSelect)=\"field.onSelect($event)\"\n    (onUnselect)=\"field.onUnselect($event)\"\n    (onClear)=\"field.onClear ? field.onClear($event) : null\"\n    (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n    [lookupAppendTo]=\"field.appendTo\"\n    [lookupEmptyMessage]=\"field.emptyMessage\"\n    [defaultFilter]=\"field.defaultFilter\"\n    [autocompleteForceSelection]=\"field.autocompleteForceSelection\"\n    [showAddOption]=\"field.showAddOption\"\n    [showEditOption]=\"field.showEditOption\"\n    [showRemoveOption]=\"field.showRemoveOption\"\n    (onAdd)=\"field.onAdd ? field.onAdd() : null\"\n    (onEdit)=\"field.onEdit ? field.onEdit($event) : null\"\n    (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n    [(ngModel)]=\"tempValue\">\n</s-lookup>\n" }]
        }], propDecorators: { field: [{
                type: Input,
                args: [{ required: true }]
            }], formGroup: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 