import * as _angular_core from '@angular/core';
import { ElementRef, NgZone } from '@angular/core';
import { HttpContext } from '@angular/common/http';
import * as _masterteam_components_entities from '@masterteam/components/entities';
import { CdkDragDrop } from '@angular/cdk/drag-drop';

type EntityViewType = 'Text' | 'LongText' | 'Date' | 'DateTime' | 'Percentage' | 'Status' | 'Currency' | 'Checkbox' | 'User' | 'Lookup' | 'Attachment';
/** Entity size – controls column span (1-24) inside a 24-column grid */
type EntitySize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
interface EntityBaseConfig {
    /** Column span of the entity card (1-24). Default: 8 */
    size?: EntitySize;
    /** Whether to show a dashed border around the entity card */
    showBorder?: boolean;
    /** Whether to hide the entity name label */
    hideName?: boolean;
}
interface EntityUserConfig extends EntityBaseConfig {
    showDisplayName?: boolean;
    showPhoneNumber?: boolean;
    showEmail?: boolean;
}
type EntityPercentageConfig = EntityBaseConfig;
type EntityConfiguration = EntityBaseConfig | EntityUserConfig | EntityPercentageConfig;
interface EntityStatusValue {
    key: string;
    display: string;
    color: string;
    description?: string;
}
interface EntityLookupValue {
    key: string;
    display: string;
    color: string;
    description?: string;
}
interface EntityUserValue {
    id?: string;
    userName?: string;
    name?: string;
    displayName?: string;
    photoUrl?: string;
    phoneNumber?: string;
    email?: string;
}
interface EntityAttachmentItemValue {
    id?: string;
    name?: string;
    fileName?: string;
    contentType?: string;
    extension?: string;
    size?: number;
}
type EntityAttachmentValue = Array<EntityAttachmentItemValue | string>;
interface EntityData {
    id?: number;
    propertyId?: number;
    key?: string;
    normalizedKey?: string;
    name?: string;
    rawValue?: string;
    order?: number;
    value: string | EntityStatusValue | EntityUserValue | EntityLookupValue | EntityAttachmentValue;
    viewType: EntityViewType;
    type?: string;
    configuration?: EntityConfiguration;
}
/** Emitted when an entity is resized via the drag handle */
interface EntityResizeEvent {
    entity: EntityData;
    previousSize: EntitySize;
    newSize: EntitySize;
}

declare class EntityText {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    readonly hideName: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityText, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityText, "mt-entity-text", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityDate {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    readonly hideName: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityDate, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityDate, "mt-entity-date", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityStatus {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<EntityStatusValue | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly statusValue: _angular_core.Signal<EntityStatusValue | null>;
    readonly badgeStyle: _angular_core.Signal<{
        color?: undefined;
        backgroundColor?: undefined;
    } | {
        color: string;
        backgroundColor: string;
    }>;
    readonly emptyLabel = "_";
    readonly statusLabel: _angular_core.Signal<string>;
    private hexToRgba;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityStatus, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityStatus, "mt-entity-status", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityUser {
    readonly httpContext: HttpContext;
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Resolved user value object from data().value */
    private readonly userValue;
    readonly rawUserName: _angular_core.Signal<string | null>;
    readonly userName: _angular_core.Signal<string>;
    readonly userPhoto: _angular_core.Signal<string>;
    readonly labelText: _angular_core.Signal<string>;
    private readonly config;
    readonly showDisplayName: _angular_core.Signal<boolean>;
    readonly showPhoneNumber: _angular_core.Signal<boolean>;
    readonly showEmail: _angular_core.Signal<boolean>;
    readonly phoneNumber: _angular_core.Signal<string>;
    readonly email: _angular_core.Signal<string>;
    readonly hasContactInfo: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityUser, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityUser, "mt-entity-user", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityPercentage {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly rawValue: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    private readonly rawNumericValue;
    readonly hasNumericValue: _angular_core.Signal<boolean>;
    readonly numericValue: _angular_core.Signal<number>;
    readonly maxValue: _angular_core.Signal<number>;
    readonly hideName: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPercentage, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPercentage, "mt-entity-percentage", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "rawValue": { "alias": "rawValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityCurrency {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    readonly hideName: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCurrency, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCurrency, "mt-entity-currency", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityCheckbox {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly rawValue: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly emptyLabel = "_";
    readonly hideName: _angular_core.Signal<boolean>;
    readonly checkboxState: _angular_core.Signal<boolean | null>;
    private parseBoolean;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCheckbox, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCheckbox, "mt-entity-checkbox", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "rawValue": { "alias": "rawValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityLongText {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    readonly hideName: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityLongText, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityLongText, "mt-entity-long-text", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityLookup {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<EntityLookupValue | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly lookupValue: _angular_core.Signal<EntityLookupValue | null>;
    readonly badgeStyle: _angular_core.Signal<{
        color?: undefined;
        backgroundColor?: undefined;
    } | {
        color: string;
        backgroundColor: string;
    }>;
    readonly emptyLabel = "_";
    readonly lookupLabel: _angular_core.Signal<string>;
    readonly hideName: _angular_core.Signal<boolean>;
    private hexToRgba;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityLookup, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityLookup, "mt-entity-lookup", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityAttachment {
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | EntityAttachmentItemValue | EntityAttachmentValue | null | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly hideName: _angular_core.Signal<boolean>;
    readonly uploadValue: _angular_core.Signal<string | _masterteam_components_entities.EntityStatusValue | _masterteam_components_entities.EntityUserValue | EntityAttachmentItemValue | (string | EntityAttachmentItemValue)[] | null>;
    readonly hasAttachments: _angular_core.Signal<boolean>;
    readonly isMultiple: _angular_core.Signal<boolean>;
    protected readonly empty = "-";
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityAttachment, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityAttachment, "mt-entity-attachment", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityPreview {
    /** Single entity data to display */
    readonly data: _angular_core.InputSignal<EntityData>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreview, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPreview, "mt-entity-preview", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntitiesPreview {
    /** Array of entity data to display */
    readonly entities: _angular_core.InputSignal<EntityData[]>;
    /** Entities sorted by order */
    readonly sortedEntities: _angular_core.Signal<EntityData[]>;
    /** Returns the grid-column span for a given entity size (1-24) */
    getColSpan(entity: EntityData): string;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesPreview, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesPreview, "mt-entities-preview", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
}

/**
 * Base class that encapsulates all entity resize-via-drag logic.
 *
 * Extend this directive in any component that needs column-resize behaviour
 * on a 24-column CSS grid.  The subclass must:
 *   - Provide a `model.required<EntityData[]>()` (or equivalent) for the
 *     entity list so `updateEntitySize()` can be called after resize.
 *   - Contain a `.grid` element (or override `getGridElement()`).
 *
 * Resize flow:
 *   1. `onResizeStart(event, entity)` — called from a mousedown on the handle
 *   2. mousemove  → snaps to nearest column, updates `resizePreviewSize`
 *   3. mouseup    → emits `entityResized` with previous & new size
 */
declare abstract class EntitiesResizeBase {
    protected readonly elRef: ElementRef<any>;
    protected readonly zone: NgZone;
    protected readonly doc: Document;
    /** Emits when an entity is resized via the drag handle */
    readonly entityResized: _angular_core.OutputEmitterRef<EntityResizeEvent>;
    /** The entity currently being resized (null when idle) */
    readonly resizingEntity: _angular_core.WritableSignal<EntityData | null>;
    /** Live preview size while dragging */
    readonly resizePreviewSize: _angular_core.WritableSignal<EntitySize | null>;
    /** Bound listeners kept for cleanup */
    private _onMouseMove;
    private _onMouseUp;
    /**
     * Returns the grid element used to compute column widths.
     * Override if the grid selector differs.
     */
    protected getGridElement(): HTMLElement | null;
    /**
     * Returns the grid-column span string for a given entity.
     * While resizing the active entity, returns the preview size.
     */
    getResizeColSpan(entity: EntityData): string;
    /** Starts a resize operation from the right-edge handle */
    onResizeStart(event: MouseEvent, entity: EntityData): void;
    /**
     * Called when a resize operation completes with a changed size.
     * Subclasses should update the entity list and emit events here.
     */
    protected abstract onResizeComplete(entity: EntityData, previousSize: EntitySize, newSize: EntitySize): void;
    /** Removes global mouse listeners */
    private _cleanupListeners;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesResizeBase, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EntitiesResizeBase, never, never, {}, { "entityResized": "entityResized"; }, never, never, true, never>;
}

declare class EntitiesManage extends EntitiesResizeBase {
    /** Array of entity data – supports two-way binding to keep order in sync */
    readonly entities: _angular_core.ModelSignal<EntityData[]>;
    /** Emits the reordered entities array after each drag-drop */
    readonly entitiesReordered: _angular_core.OutputEmitterRef<EntityData[]>;
    /** Entities sorted by their order field */
    readonly sortedEntities: _angular_core.Signal<EntityData[]>;
    /** Returns the grid-column span for a given entity size (1-24) */
    getColSpan(entity: EntityData): string;
    /** Handle drag-drop reorder */
    onDrop(event: CdkDragDrop<EntityData[]>): void;
    protected onResizeComplete(entity: EntityData, previousSize: EntitySize, newSize: EntitySize): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesManage, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesManage, "mt-entities-manage", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; }, { "entities": "entitiesChange"; "entitiesReordered": "entitiesReordered"; }, never, never, true, never>;
}

export { EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityCurrency, EntityDate, EntityLongText, EntityLookup, EntityPercentage, EntityPreview, EntityStatus, EntityText, EntityUser };
export type { EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityConfiguration, EntityData, EntityLookupValue, EntityPercentageConfig, EntityResizeEvent, EntitySize, EntityStatusValue, EntityUserConfig, EntityUserValue, EntityViewType };
