/**
 * @module entity-fields-grid.component
 * @description Inline field editor for the Database Designer wizard (Step 2) and
 * the Modify view (Fields tab).
 *
 * Each row represents one column definition.  Cells are directly editable —
 * click any cell to edit it in-place.  No separate dialog needed.
 *
 * ### Modes
 *  - `create`: all rows are new columns being defined. Any row can be deleted.
 *  - `modify`: rows loaded from an existing entity. Existing rows can be hidden
 *    from new records (soft-removal preserving data) but not deleted. New rows
 *    added by the user can be deleted outright.
 *
 * ### Validation
 * Reserved column names (`ID`, `__mj_CreatedAt`, `__mj_UpdatedAt`) are detected
 * and shown with an inline error badge. The parent step component reads
 * `HasErrors` to gate the "Next" button.
 */
import { EventEmitter } from '@angular/core';
import type { ColumnSpec, FieldTypeOption } from '../../database-designer.types.js';
import * as i0 from "@angular/core";
/** Extends ColumnSpec with grid-specific display state. */
interface FieldRow extends ColumnSpec {
    /** True when the column already exists in the DB (modify mode). */
    isExisting: boolean;
    /** True when the user has soft-toggled this existing column to hidden. */
    isHidden: boolean;
    /** 0-based index for stable tracking. */
    rowIndex: number;
}
export declare class EntityFieldsGridComponent {
    private readonly cdr;
    set Columns(v: ColumnSpec[]);
    Mode: 'create' | 'modify';
    /** Emitted on every change so the parent/state service can stay in sync. */
    readonly ColumnsChanged: EventEmitter<ColumnSpec[]>;
    rows: FieldRow[];
    /** Index of the row currently being actively edited (-1 = none). */
    ActiveRowIndex: number;
    /** Available type options — drives the dropdown. */
    readonly FieldTypeOptions: readonly FieldTypeOption[];
    /** True when any row has a reserved-name validation error. */
    get HasErrors(): boolean;
    /** True when any row has an error (exposed for parent template). */
    get HasReservedNameError(): boolean;
    TrackByIndex(_: number, row: FieldRow): number;
    IsReservedName(name: string): boolean;
    TypeLabel(type: ColumnSpec['Type']): string;
    /** True when the selected type supports a Max Length field. */
    ShowMaxLength(type: ColumnSpec['Type']): boolean;
    /** True when the selected type supports precision/scale fields. */
    ShowPrecisionScale(type: ColumnSpec['Type']): boolean;
    /** Append an empty row and make it active for editing. */
    AddField(): void;
    /** Remove a new (non-existing) row outright. */
    DeleteRow(index: number): void;
    /**
     * Toggle the "hidden" state of an existing row in modify mode.
     * Hidden = soft-remove: `IncludeInAPI` will be set to false server-side;
     * data in the column is preserved.
     */
    ToggleHide(index: number): void;
    /** Update a field's Name. */
    OnNameChange(index: number, value: string): void;
    /** Update a field's Type. */
    OnTypeChange(index: number, value: ColumnSpec['Type']): void;
    /** Toggle the "Required" (not-nullable) flag. */
    OnRequiredToggle(index: number): void;
    /** Update MaxLength for string columns. */
    OnMaxLengthChange(index: number, value: string): void;
    /** Update the Default Value string. */
    OnDefaultValueChange(index: number, value: string): void;
    /** Update the Description string. */
    OnDescriptionChange(index: number, value: string): void;
    private isReservedName;
    /** Called directly from the template for precision/scale inline updates. */
    updateRow(index: number, patch: Partial<FieldRow>): void;
    /** Emit the current non-hidden rows as `ColumnSpec[]` to the parent. */
    private emit;
    static ɵfac: i0.ɵɵFactoryDeclaration<EntityFieldsGridComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<EntityFieldsGridComponent, "mj-database-fields-grid", never, { "Columns": { "alias": "Columns"; "required": false; }; "Mode": { "alias": "Mode"; "required": false; }; }, { "ColumnsChanged": "ColumnsChanged"; }, never, never, false, never>;
}
export {};
//# sourceMappingURL=entity-fields-grid.component.d.ts.map