import { Component } from '@angular/core';
import { BaseControl } from '../basecontrol';
import * as i0 from "@angular/core";
import * as i1 from "../../service/common.service";
import * as i2 from "../form-box/form-box.component";
import * as i3 from "ng-devui";
import * as i4 from "@angular/common";
export class FormTransferComponent extends BaseControl {
    constructor(commonService) {
        super(commonService);
        this.commonService = commonService;
    }
    ngOnInit() {
        this.getData();
        this.commonService.testEvent.subscribe(o => {
            if (o == this.data.name) {
                this.getData();
            }
        });
    }
    getData() {
        this.commonService.getTheData(this.data)?.subscribe(o => {
            var res = null;
            eval("res =" + this.data.postdata.function);
            this.data.options = res(o);
        });
    }
}
FormTransferComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: FormTransferComponent, deps: [{ token: i1.CommonService }], target: i0.ɵɵFactoryTarget.Component });
FormTransferComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: FormTransferComponent, selector: "form-transfer", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"data.mode=='op'; else detail\">\r\n    <form-box #box [mainCarry]=\"detail\" [name]=\"data.name\" [controltype]=\"data.controltype\" (controlclick)=\"onClick($event)\"></form-box>\r\n  </ng-container>\r\n  <ng-template #detail>\r\n      <d-form-item>\r\n          <d-form-label [required]=\"data.required\" [hasHelp]=\"data.help\" [helpTips]=\"data.helptip||''\">{{data.label}}</d-form-label>\r\n          <d-form-control>\r\n            <d-transfer\r\n                [attr.name]=\"data.controlname\" \r\n                [disabled]=\"data.disabled\"\r\n                [sourceOption]=\"data.options\"\r\n                [targetOption]=\"data.defaultvalue\"\r\n                [titles]=\"{ source: data.source, target: data.target }\"\r\n            >\r\n            </d-transfer>\r\n          </d-form-control>\r\n        </d-form-item>\r\n  </ng-template>", styles: [""], components: [{ type: i2.FormBoxComponent, selector: "form-box", inputs: ["mainCarry", "name", "controltype", "additionalcss"], outputs: ["controlclick"] }, { type: i3.FormItemComponent, selector: "d-form-item", inputs: ["dFeedbackType", "dHasFeedback"] }, { type: i3.FormLabelComponent, selector: "d-form-label", inputs: ["required", "hasHelp", "helpTips"] }, { type: i3.FormControlComponent, selector: "d-form-control", inputs: ["extraInfo", "feedbackStatus", "suffixTemplate"] }, { type: i3.TransferComponent, selector: "d-transfer", inputs: ["sourceOption", "targetOption", "titles", "height", "isSearch", "disabled", "isSourceDroppable", "isTargetDroppable", "showOptionTitle", "beforeTransfer", "virtualScroll", "customSourceCheckedLen", "customTargetCheckedLen"], outputs: ["transferToTarget", "transferToSource", "searching", "transferring", "afterTransfer"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: FormTransferComponent, decorators: [{
            type: Component,
            args: [{ selector: 'form-transfer', template: "<ng-container *ngIf=\"data.mode=='op'; else detail\">\r\n    <form-box #box [mainCarry]=\"detail\" [name]=\"data.name\" [controltype]=\"data.controltype\" (controlclick)=\"onClick($event)\"></form-box>\r\n  </ng-container>\r\n  <ng-template #detail>\r\n      <d-form-item>\r\n          <d-form-label [required]=\"data.required\" [hasHelp]=\"data.help\" [helpTips]=\"data.helptip||''\">{{data.label}}</d-form-label>\r\n          <d-form-control>\r\n            <d-transfer\r\n                [attr.name]=\"data.controlname\" \r\n                [disabled]=\"data.disabled\"\r\n                [sourceOption]=\"data.options\"\r\n                [targetOption]=\"data.defaultvalue\"\r\n                [titles]=\"{ source: data.source, target: data.target }\"\r\n            >\r\n            </d-transfer>\r\n          </d-form-control>\r\n        </d-form-item>\r\n  </ng-template>", styles: [""] }]
        }], ctorParameters: function () { return [{ type: i1.CommonService }]; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS10cmFuc2Zlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9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