import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges, Type } from '@angular/core';
import { ControlContainer, FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { Observable } from 'rxjs';
import { QdFocusableDirective } from '../core/focusable/focusable.directive';
import { QdEventBrokerService } from '../core/services/event-broker.service';
import { QdPageFooterService } from '../page/shared/services/page-footer.service';
import { QdPageStoreService } from '../page/shared/services/page-store.service';
import { QdSectionToolbarActionService } from '../section/services/section-toolbar-action.service';
import { QdQuickEditColumn, QdQuickEditConfig, QdQuickEditSecondaryAction } from './model/quick-edit-config';
import { QdQuickEditData, QdQuickEditRow } from './model/quick-edit-data';
import { QdCustomForDirective } from './qd-ng-for.directive';
import { QdTooltip } from '../core/core.module';
import * as i0 from "@angular/core";
/**
 * The **QdQuickEditComponent** is a dynamic tool that enables users to swiftly edit data without the need for traditional forms.
 * It is specifically designed for inline editing, providing a more seamless and efficient user experience.
 * The component currently supports editing columns with data types such as string, number, and enum.
 * In addition to its editing capabilities, the QdQuickEditComponent also offers features for adding new rows and deleting existing ones.
 *
 * QuickEdit supports two modes:
 * - **Reactive Forms Mode** via `formArrayName` – recommended for full control and validation.
 * - **Template Data Mode** via `data` input – for use cases without external forms.
 *
 * ### Usage
 *
 * #### Configuration
 *
 * ```ts
 * type ColumnDefinition = 'rubrik' | 'data' | 'status';
 * const config: QdQuickEditConfig<ColumnDefinition> = {
 *   columns: [
 *     {
 *       name: 'rubrik',
 *       type: 'text',
 *       i18n: 'translation.key.rubrik',
 *       isEditable: () => false
 *     },
 *     {
 *       name: 'data',
 *       type: 'integer',
 *       i18n: 'translation.key.data',
 *       isEditable: (row, column) => !!row['rubrik'],
 *       validators: [Validators.required] // only relevant in template data mode
 *     }
 *   ],
 *   canAdd: true,
 *   secondaryActions: [...]
 * }
 * ```
 *
 * #### FormArray (recommended)
 *
 * To use QuickEdit with Angular Reactive Forms, define a FormGroup containing a FormArray. The controls must match the defined columns.
 *
 * ```ts
 * form = new FormGroup({
 *   data: new FormArray([
 *     new FormGroup({
 *       rubrik: new QdFormControl('Text'),
 *       data: new QdFormControl(123)
 *     })
 *   ])
 * })
 * ```
 *
 * Then bind the `formArrayName` directive in the template:
 *
 * ```html
 * <form [formGroup]="form">
 *   <qd-quick-edit [config]="config" formArrayName="data"></qd-quick-edit>
 * </form>
 * ```
 *
 * You can add new rows by reacting to `(addNewClicked)`:
 *
 * ```ts
 * addControl(): void {
 *   this.form.get('data')?.insert(0, new FormGroup({ ... }));
 * }
 * ```
 *
 * #### Template Data (optional)
 *
 * Alternatively, you can provide a static `data` array. This is useful for read-only scenarios without reactive forms.
 *
 * ```ts
 * const data: QdQuickEditData<MyColumns> = [
 *   { rubrik: 'Foo', data: 42 },
 *   { rubrik: 'Bar', data: 77 }
 * ];
 * ```
 *
 * ```html
 * <qd-quick-edit [config]="config" [data]="data"></qd-quick-edit>
 * ```
 *
 * #### Validation
 *
 * - In **FormArray mode**, validators must be set directly on your FormControls. Validators in `config.columns` are ignored.
 * - In **template data mode**, validators defined in `config.columns` are applied.
 *
 * **Note: Do not combine both approaches. When using `formArrayName`, only the external FormGroup is used for validation and value access.**
 */
export declare class QdQuickEditComponent<T extends string> implements OnInit, OnChanges, OnDestroy {
    private fb;
    readonly footerService: QdPageFooterService;
    readonly pageService: QdPageStoreService<any>;
    private readonly sectionActionService;
    private readonly eventBrokerService;
    private changeDetectorRef;
    private controlContainer;
    /**
     * Configuration of the QuickEdit. The generic type specifies the column definition. <br />
     *
     * **Usage:**
     *
     * @example
     * type ColumnDefinition = 'article' | 'mass' | 'documents';
     * const config: QdQuickEditConfig<ColumnDefinition> = {
     *   columns: [
     *     {
     *       name: 'rubrik',
     *       type: 'text',
     *       i18n: 'translation.key.rubrik',
     *       isEditable: () => false
     *     },
     *     {
     *       name: 'data',
     *       type: 'integer',
     *       i18n: 'translation.key.data',
     *       isEditable: (row, column) => row['active'] == 1,
     *       validators: [Validators.required]
     *     },
     *     {
     *       name: 'size',
     *       type: 'boolean',
     *       i18n: 'translation.key.size',
     *       validators: [customValidatorFunction()]
     *     }
     *   ]
     * }
     */
    config: QdQuickEditConfig<T>;
    /**
     * Data provider for QuickEdit.
     */
    data: QdQuickEditData<T> | undefined;
    get templateData(): QdQuickEditData<T>;
    get templateData$(): Observable<QdQuickEditData<T>>;
    /**
     * A static test ID for integration tests can be set. <br />
     * The value for the HTML attribute [data-test-id].
     */
    testId?: string;
    /**
     * The form group instance of QdQuickEdit.
     * Use this form group to bind it to step-control of QdStepper or other custom logics.
     */
    formGroupChange: EventEmitter<any>;
    addNewClicked: EventEmitter<void>;
    focusables: QueryList<QdFocusableDirective> | undefined;
    customForDirective: QdCustomForDirective;
    quickEditFormGroup: FormGroup;
    viewonly$: Observable<boolean>;
    actions$: Observable<QdQuickEditSecondaryAction<T>[]>;
    hasVisibleActions$: Observable<boolean>;
    private _destroyed$;
    get control(): FormGroup;
    get showStandaloneCreate(): boolean;
    get canAdd(): boolean;
    get rows(): FormArray;
    get visibleColumns(): QdQuickEditColumn<T>[];
    trackByColumnName(_: number, column: QdQuickEditColumn<T>): string;
    get isFormControl(): boolean;
    togglerDrawing: boolean;
    constructor(fb: FormBuilder, footerService: QdPageFooterService, pageService: QdPageStoreService<any>, sectionActionService: QdSectionToolbarActionService, eventBrokerService: QdEventBrokerService, changeDetectorRef: ChangeDetectorRef, controlContainer: ControlContainer);
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    ngOnDestroy(): void;
    isActionDisabled(action: QdQuickEditSecondaryAction<T>, row: QdQuickEditRow<T>): boolean;
    handleSecondaryAction(action: QdQuickEditSecondaryAction<T>, rowIndex: number): void;
    getComponentType(column: QdQuickEditColumn<T>): Type<unknown> | null;
    getComponentInputs(column: QdQuickEditColumn<T>, row: QdQuickEditRow<T>): any;
    createRow(): void;
    removeRow(index: number): void;
    hasTooltip(tooltip: QdTooltip): boolean;
    private initRows;
    private initCreating;
    private createFormGroupRow;
    private focusFirstControl;
    private initOpModeSubscription;
    private validateSetup;
    private redrawOnNextChange;
    private initActionsStream;
    private filterActionsByMode;
    private initManualChangeDetectionForControlReset;
    static ɵfac: i0.ɵɵFactoryDeclaration<QdQuickEditComponent<any>, [null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, null, { optional: true; self: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<QdQuickEditComponent<any>, "qd-quick-edit", never, { "config": { "alias": "config"; "required": true; }; "data": { "alias": "data"; "required": false; }; "testId": { "alias": "data-test-id"; "required": false; }; }, { "formGroupChange": "formGroupChange"; "addNewClicked": "addNewClicked"; }, never, never, false, never>;
}
//# sourceMappingURL=quick-edit.component.d.ts.map