import * as _angular_core from '@angular/core'; import { AfterViewInit, OnInit, InjectionToken, Type, Provider } from '@angular/core'; import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchemaConnectionFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, EntityListFieldRuntimeContext, ScheduleItemSelectorFieldRuntimeContext, LookupCheckListPropertyConfig, LookupModuleCheckListFieldRuntimeContext } from '@masterteam/components'; import { ControlValueAccessor, NgControl, AbstractControl, Validators } from '@angular/forms'; import { HttpContext } from '@angular/common/http'; import { ColumnDef, TableAction } from '@masterteam/components/table'; import { EntityData, EntityListLocalSchemaField, EntityListLocalCell } from '@masterteam/components/entities'; declare class LookupMatrixField implements AfterViewInit { readonly config: _angular_core.InputSignal; private readonly controlContainer; private readonly destroyRef; private readonly transloco; private readonly valueVersion; private subscribedControl; readonly hasYAxis: _angular_core.Signal; readonly xOptions: _angular_core.Signal; readonly yOptions: _angular_core.Signal; readonly hasMatrix: _angular_core.Signal; readonly cellMap: _angular_core.Signal>; readonly selectedXOption: _angular_core.Signal; readonly selectedYOption: _angular_core.Signal; readonly activeCell: _angular_core.Signal; readonly selectionSummary: _angular_core.Signal; readonly pendingMessage: _angular_core.Signal; readonly missingResultMessage: _angular_core.Signal; ngAfterViewInit(): void; getCell(xLookupItemId: number | string, yLookupItemId?: number | string): LookupMatrixCellConfig | null; getSwatchColor(color?: string | null): string | null; private getControlValue; private ensureControlSubscription; private resolveSelectedOption; private optionMatchesValue; private cellKey; private resolveColor; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * One source level inside connection configuration. * Comes from `field.propertyMetadata.configuration.sourceLevels[]` * * A source can be either a **level** (has `levelId`/`levelKey`) or a * **module** (has `moduleId`/`moduleKey`). Exactly one pair will be present. */ interface ConnectionSourceLevel { /** Present for level-type sources */ levelId?: number; /** Present for level-type sources */ levelKey?: string; /** Present for module-type sources */ moduleId?: number; /** Present for module-type sources */ moduleKey?: string; name: { en?: string; ar?: string; [k: string]: string | undefined; }; connectionId: number; isOptional: boolean; allowManyToMany: boolean; supportWeights: boolean; optionsQuery: { path: string; method?: string; query?: Record; }; } /** * Full connection configuration from `field.propertyMetadata.configuration`. * This is passed as a single input to the component. */ interface SchemaConnectionConfig { targetLevelId: number; sourceLevelId?: number; propertyKey?: string; valueMode?: string; sourceLevels: ConnectionSourceLevel[]; payloadTemplate?: { levelId: number; sources: any[]; }; sourceItemShape?: Record; } /** One selected source in the connection payload */ interface ConnectionSource { sourceLevelId?: number; sourceLevelDataId?: number; sourceModuleId?: number; sourceModuleDataId?: number; } /** The value shape for a connection field */ interface ConnectionPayload { levelId: number; sources: ConnectionSource[]; } /** * Internal state tracked per source level dropdown. */ interface SourceLevelState { source: ConnectionSourceLevel; options: any[]; loading: boolean; } declare class SchemaConnectionField implements ControlValueAccessor, OnInit { readonly label: _angular_core.InputSignal; readonly placeholder: _angular_core.InputSignal; readonly readonly: _angular_core.InputSignal; /** * Kept for direct-host API compatibility. Dynamic/client forms do not bind * it; runtime requiredness is defined per source by * `configuration.sourceLevels[].isOptional`. */ readonly required: _angular_core.InputSignal; readonly filter: _angular_core.InputSignal; /** * Full connection configuration object from the API. * Includes `targetLevelId`, `sourceLevels[]`, `payloadTemplate`, etc. */ readonly configuration: _angular_core.InputSignal; /** * Runtime scope for this field's options queries. When `templateId` is * present, it is sent as a `templateId` structural filter on every source * level's `fetch/query` request, scoping the dropdown to the active plan * instance. Absent means options load unscoped, same as before this input * existed. */ readonly runtimeContext: _angular_core.InputSignal; /** * Optional HttpContext for API requests (e.g. to set base URL behavior). */ readonly context: _angular_core.InputSignal; /** The full ConnectionPayload value */ value: _angular_core.WritableSignal; disabled: _angular_core.WritableSignal; /** Per-source-level state: options + loading */ sourceLevelStates: _angular_core.WritableSignal; /** Mutable selections per source level: sourceLevelId -> selected value */ selections: Record; onTouched: () => void; onModelChange: (value: ConnectionPayload | null) => void; /** * Every source whose `isOptional` is false must have at least one selected * record. The field-level `isRequired` flag is intentionally ignored because * one Connection property can mix optional and required source levels. */ private readonly requiredSourcesValidator; ngControl: NgControl | null; private http; private destroyRef; private readonly cdr; private transloco; /** Active UI language, kept reactive so source labels re-resolve on switch. */ private readonly activeLang; /** * Resolve a source level's display name in the active locale, falling back * to English, Arabic, then the level/module key. */ protected resolveSourceName(source: ConnectionSourceLevel): string; /** * Source levels from configuration. */ readonly sourceLevels: _angular_core.Signal; /** * Tooltip for the marker rendered next to every source label — it is what * tells the user these dropdowns belong to a connection, now that the * connection's own label no longer occupies a row above them. Reads * {@link activeLang} so the text re-translates on language switch. */ readonly connectionHint: _angular_core.Signal; /** * Placeholder for a source dropdown: its own source name, matching the label * above it. Falls back to the field-level placeholder only when the source * has no resolvable name. */ protected sourcePlaceholder(source: ConnectionSourceLevel): string; /** * Percentage width for each dropdown, evenly divided. */ readonly dropdownWidth: _angular_core.Signal; constructor(); /** * Repaint when the control's own state changes. * * `touched` and validity are plain `AbstractControl` state, not signals, and * this component is `OnPush` — so a host that calls `markAllAsTouched()` on a * failed submit marked the connection invalid and nothing re-rendered. The * required message only appeared once the user happened to touch a dropdown, * which is the one moment they no longer need telling. * * `ngOnInit` rather than the constructor: `formControl` / `formControlName` * only expose `.control` after their first `ngOnChanges`. */ ngOnInit(): void; /** * Returns a stable numeric ID for a source regardless of whether it is a * level (`levelId`) or a module (`moduleId`). Used as the key in `selections` * and `sourceLevelStates`. */ protected getSourceId(source: ConnectionSourceLevel): number; /** * A source that must be selected and is not. Mirrors * {@link requiredSourcesValidator}, which decides the same thing from the * control value. * * A method, not a computed: `selections` is a plain object that `ngModel` * mutates in place and carries no signal, so only re-reading it every change * detection cycle stays truthful. */ protected isSourceMissing(source: ConnectionSourceLevel): boolean; /** * The control, but only for the source the message belongs under — every * other source gets `null` and renders nothing. `mt-field-validation` still * decides whether to paint: it waits for `touched`. * * Field height stays stable because the reserved line moves rather than * appears. A null control reserves nothing, so exactly one slot is live at a * time — the missing source's, or {@link unattributedErrorControl}'s below * the row. */ protected sourceErrorControl(source: ConnectionSourceLevel): AbstractControl | null; /** * The control, but only while no source owns the failure — a server error on * a fully selected connection has nowhere else to render. Null as soon as a * source is missing, so one failure never prints twice. */ protected unattributedErrorControl(): AbstractControl | null; /** * Builds the `contextKey` for the `fetch/query` request based on source type. */ private getContextKey; private loadOptions; private updateSourceState; /** * Single handler — no params. Reads all selections, builds the combined payload. */ syncValue(): void; private distributeToSelections; writeValue(value: ConnectionPayload | string | null): void; registerOnChange(fn: (value: ConnectionPayload | null) => void): void; registerOnTouched(fn: any): void; setDisabledState(disabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type PredecessorType = 0 | 1 | 2 | 3; interface SchedulePredecessorValue { predecessorId: number | string; type: PredecessorType; lagDays: number; } interface SchedulePredecessorRow extends SchedulePredecessorValue { key: string; } interface SelectOption { label: string; value: number | string; } declare class SchedulePredecessorField implements ControlValueAccessor { private readonly predecessorCellTpl; private readonly typeCellTpl; private readonly lagCellTpl; readonly label: _angular_core.InputSignal; /** Unique; shared by the control and its