import { QdTooltip } from '../../core/core.module';
import { QdFormDropdownConfiguration } from '../../forms/model/forms.interface';
import { ValidatorFnWithProps } from '../../forms/reactive-forms/controls/form-control';
import { QdQuickEditRow } from './quick-edit-data';
/**
 * @description Configuration model for empty state view
 */
export interface QdQuickEditEmptyStateView {
    /**
     * @description Toggles the empty view off, if set to "true".
     *
     * * @default: false
     */
    disabled?: boolean;
    /**
     * Translation key for empty state view
     */
    i18n: string;
}
/**
 * Configuration of QuickEdit.
 */
export interface QdQuickEditConfig<T extends string> {
    /**
     * @description Defines the columns of QuickData.
     */
    columns: QdQuickEditColumn<T>[];
    /**
     * @description Defines a list of secondary actions that can be executed per Click/Tab of an item in the menu.
     *
     * * @example
     * This is how the two actions "save" and "delete" are created.
     * ```ts
     * secondaryActions: [
     *    {
     *      type: 'save',
     *      handler: rowData => doSomethingWith(rowData)
     *    },
     *    {
     *      type: 'delete',
     *      isDisabled: true,
     *      handler: rowData => doSomethingWith(rowData)
     *    }
     * ]
     * ```
     */
    secondaryActions?: QdQuickEditSecondaryAction<T>[];
    /**
     * Determines whether users can create entries to quick edit. Works only for standalone mode. If configured as yes, a create button
     * will be rendered either in quick edit itself when being used standalone. For usage in section, configure section with add button.
     */
    canAdd?: boolean;
    /**
     * Allows to change the label of the create button.
     */
    standaloneCreateLabel?: {
        i18n: string;
    };
    /**
     * @description Sets an alternative view if no elements are available
     */
    emptyStateView?: QdQuickEditEmptyStateView;
    /**
     * @description Enables "viewonly" mode for quick edit.
     *
     * When set to `true`, the table displays its content as read-only.
     * Combined with `secondaryActions`, this can be used to selectively show or hide secondary actions
     * based on the operation mode (`'view'` or `'edit'`) used in the Quadrel framework.
     *
     * * If `viewonly` is explicitly set, it overrides the global operation mode
     * (which is normally controlled through external events).
     * This gives you full control: for example, setting `viewonly: false` will allow edit actions to be shown,
     * even if the global mode would normally hide them.
     *
     * * @default false
     */
    viewonly?: boolean;
}
/**
 * Base set for column configurations of QdQuickEdit.
 */
export interface QdQuickEditColumnBase<T extends string> {
    /**
     * Name of the column.
     */
    name: T;
    /**
     * Translation key used for the column header.
     */
    i18n: string;
    /**
     * A function to determine if the column is editable for a specific row.
     * @param row - Current row of the data.
     * @param column - Column key that corresponds to the current column of the data.
     */
    isEditable: (row: QdQuickEditRow<any>, column: T) => boolean;
    /**
     * Function or array of functions to validate the column values. Works only for QuickEdit when data is provided.
     */
    validators?: ValidatorFnWithProps | ValidatorFnWithProps[];
    /**
     * Hides the specific column.
     */
    isHidden?: boolean;
    /**
     * @description Tooltip configuration for the column header.
     */
    tooltip?: QdTooltip;
}
/**
 * Column configuration for text in QdQuickEdit.
 */
export interface QdQuickEditColumnText<T extends string> extends QdQuickEditColumnBase<T> {
    type: 'text';
}
/**
 * Column configuration for integers in QdQuickEdit.
 */
export interface QdQuickEditColumnInteger<T extends string> extends QdQuickEditColumnBase<T> {
    type: 'integer';
}
/**
 * Column configuration for dropdowns in QdQuickEdit.
 */
export interface QdQuickEditColumnEnum<T extends string> extends QdQuickEditColumnBase<T>, Pick<QdFormDropdownConfiguration, 'placeholder' | 'placeholderPrefix' | 'filter' | 'options'> {
    /**
     * @inheritdoc
     */
    type: 'enum';
}
/**
 * Column configuration for Quick Edit
 */
export type QdQuickEditColumn<T extends string> = QdQuickEditColumnInteger<T> | QdQuickEditColumnText<T> | QdQuickEditColumnEnum<T>;
/**
 * Secondary Actions configuration for Quick Edit
 */
export interface QdQuickEditSecondaryAction<T extends string> {
    /**
     * @description Defines the secondary action type for the table.
     */
    label: {
        i18n: string;
    };
    /**
     * @description Sets the inline action to disabled
     */
    isDisabled?: boolean | ((row: QdQuickEditRow<T>) => boolean);
    /**
     * @description Defines a handler that is triggered by a selection.
     */
    handler: (selectedRow: QdQuickEditRow<T>) => void;
    /**
     * @description Controls in which operation mode this action is shown. May be set by the Quadrel Framework ('edit' or 'view').
     *
     * - Use `'edit'` to show the action only in editable mode.
     * - Use `'view'` to show the action only in viewonly mode.
     * - If not set, the action is shown in **both modes**.
     *
     * **Note:** The `viewonly` flag in the table configuration overrides any external operation mode.
     *
     * * @example
     * ```ts
     * {
     *   label: i18n: { ... },
     *   operationMode: 'edit',
     *   handler: ...
     * }
     * ```
     */
    operationMode?: 'edit' | 'view';
}
//# sourceMappingURL=quick-edit-config.d.ts.map