import { Component, Input, Output, EventEmitter } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "./cell-edit-mode/edit-cell.component";
import * as i3 from "./cell-view-mode/view-cell.component";
export class CellComponent {
    constructor() {
        this.inputClass = '';
        this.mode = 'inline';
        this.isInEditing = false;
        this.isExpanded = false;
        this.edited = new EventEmitter();
        this.selectedElem = new EventEmitter();
    }
    onEdited() {
        if (this.isNew) {
            this.grid.create(this.grid.getNewRow(), this.createConfirm);
        }
    }
}
CellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
CellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CellComponent, selector: "ng2-smart-table-cell", inputs: { editingFormGroup: "editingFormGroup", grid: "grid", row: "row", createConfirm: "createConfirm", isNew: "isNew", cell: "cell", inputClass: "inputClass", mode: "mode", isInEditing: "isInEditing", isExpanded: "isExpanded", updateColumnList: "updateColumnList" }, outputs: { edited: "edited", selectedElem: "selectedElem" }, ngImport: i0, template: `
        <ng-container [ngSwitch]="isInEditing">
            <table-cell-view-mode
                *ngSwitchCase="false"
                [cell]="cell"
                [isExpanded]="isExpanded">
            </table-cell-view-mode>

            <table-cell-edit-mode
                *ngSwitchCase="true"
                [editingFormGroup]="editingFormGroup"
                [cell]="cell"
                [inputClass]="inputClass"
                [updateColumnList]="updateColumnList"
                (edited)="onEdited()"
                (selectedElem)="selectedElem.emit($event)">
            </table-cell-edit-mode>
        </ng-container>
    `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2.EditCellComponent, selector: "table-cell-edit-mode", inputs: ["editingFormGroup"] }, { kind: "component", type: i3.ViewCellComponent, selector: "table-cell-view-mode", inputs: ["cell", "isExpanded"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CellComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ng2-smart-table-cell',
                    template: `
        <ng-container [ngSwitch]="isInEditing">
            <table-cell-view-mode
                *ngSwitchCase="false"
                [cell]="cell"
                [isExpanded]="isExpanded">
            </table-cell-view-mode>

            <table-cell-edit-mode
                *ngSwitchCase="true"
                [editingFormGroup]="editingFormGroup"
                [cell]="cell"
                [inputClass]="inputClass"
                [updateColumnList]="updateColumnList"
                (edited)="onEdited()"
                (selectedElem)="selectedElem.emit($event)">
            </table-cell-edit-mode>
        </ng-container>
    `
                }]
        }], propDecorators: { editingFormGroup: [{
                type: Input
            }], grid: [{
                type: Input
            }], row: [{
                type: Input
            }], createConfirm: [{
                type: Input
            }], isNew: [{
                type: Input
            }], cell: [{
                type: Input
            }], inputClass: [{
                type: Input
            }], mode: [{
                type: Input
            }], isInEditing: [{
                type: Input
            }], isExpanded: [{
                type: Input
            }], updateColumnList: [{
                type: Input
            }], edited: [{
                type: Output
            }], selectedElem: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VsbC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy91bm8tdWktbGliL3NyYy9saWIvdGFibGUvY29tcG9uZW50cy9jZWxsL2NlbGwuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7O0FBNkJ2RSxNQUFNLE9BQU8sYUFBYTtJQXRCMUI7UUFzQ2EsZUFBVSxHQUFHLEVBQUUsQ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