import { Component, Input, Output, EventEmitter } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "./cell-view-mode/view-cell.component";
import * as i2 from "./cell-edit-mode/edit-cell.component";
import * as i3 from "@angular/common";
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: "13.3.11", ngImport: i0, type: CellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
CellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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, components: [{ type: i1.ViewCellComponent, selector: "table-cell-view-mode", inputs: ["cell", "isExpanded"] }, { type: i2.EditCellComponent, selector: "table-cell-edit-mode", inputs: ["editingFormGroup"] }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VsbC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy91bm8tdWktbGliL3NyYy9saWIvdGFibGUvY29tcG9uZW50cy9jZWxsL2NlbGwuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7O0FBNkJ2RSxNQUFNLE9BQU8sYUFBYTtJQXRCMUI7UUFpQ2EsZUFBVSxHQUFHLEVBQUUsQ0FBQztRQUNoQixTQUFJLEdBQUc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