import * as _angular_core from '@angular/core';
import { OnInit, EventEmitter } from '@angular/core';
import * as i1 from '@angular/common';
import { AXFormComponent } from '@acorex/components/form';
import { AXValidationSummary } from '@acorex/core/validation';
import { AXPWidgetNode, AXPWidgetRenderMode, AXPWidgetCoreContextChangeEvent, AXPWidgetContainerComponent, AXPWidgetCoreElementAction } from '@acorex/platform/layout/widget-core';
import { AXDataSource } from '@acorex/cdk/common';
import { AXPopupSizeType } from '@acorex/components/popup';
import { AXStepWizardLook } from '@acorex/components/step-wizard';
import { AXPGridLayoutOptions, AXPExpression, AXPValidationRules, AXPOptionsData, AXPActionMenuItem } from '@acorex/platform/core';
import { AXBasePageComponent } from '@acorex/components/page';

/**
 * Extended widget node properties (excluding type, path, name, options, children)
 * These properties can be passed as a third parameter to customWidget method
 */
type AXPWidgetNodeExtendedProperties = Omit<AXPWidgetNode, 'type' | 'path' | 'name' | 'options'>;
/**
 * Form appearance and density styling (using fieldset widget look)
 */
type AXPDynamicFormLook = 'fieldset' | 'card' | 'group' | 'container';
/**
 * Form rendering mode
 */
type AXPDynamicFormMode = 'view' | 'edit';
/**
 * Form layout direction and flow
 */
type AXPDynamicFormDirection = 'vertical' | 'horizontal' | 'grid';
interface AXPDynamicFormFieldDefinition {
    path: string;
    title?: string;
    badge?: string;
    description?: string;
    widget: AXPWidgetNode;
    /**
     * Optional per-field rendering mode. Takes precedence over section and form modes.
     */
    mode?: AXPDynamicFormMode;
    layout?: AXPGridLayoutOptions;
}
interface AXPDynamicFormGroupDefinition {
    name: string;
    title?: string;
    description?: string;
    parameters: AXPDynamicFormFieldDefinition[];
    /**
     * Optional per-section rendering mode. Takes precedence over form mode and is overridden by field mode.
     */
    mode?: AXPDynamicFormMode;
    /**
     * Visual appearance of the group (fieldset, card, group, container)
     */
    look?: 'fieldset' | 'card' | 'group' | 'container';
}
interface AXPDynamicFormDefinition {
    groups: AXPDynamicFormGroupDefinition[];
    /**
     * Optional form-level rendering mode
     */
    mode?: AXPDynamicFormMode;
}
interface AXPDialogRef {
    /**
     * Manually close the dialog (optional - dialog closes automatically after user interaction)
     */
    close(): void;
    /**
     * Get the form data from the dialog
     */
    context(): any;
    /**
     * Get the action that was clicked by the user
     */
    action(): string | undefined;
    /**
     * Set the loading state of the dialog
     */
    setLoading(loading: boolean): void;
}
interface LayoutWidgetOptions {
    name?: string;
}
interface ValueWidgetOptions extends LayoutWidgetOptions {
    path: string;
    defaultValue?: any;
    validations?: AXPValidationRules;
}
interface TextBoxOptions extends ValueWidgetOptions {
    placeholder?: string;
    maxLength?: number;
    minLength?: number;
    prefix?: string;
    suffix?: string;
    clearButton?: boolean;
}
interface NumberBoxOptions extends ValueWidgetOptions {
    min?: number;
    max?: number;
    step?: number;
    placeholder?: string;
    format?: string;
}
interface SelectBoxOptions extends ValueWidgetOptions {
    dataSource: any[] | (() => any[]) | (() => Promise<any[]>) | AXDataSource<any>;
    valueField?: string;
    textField?: string;
    placeholder?: string;
    multiple?: boolean;
    searchable?: boolean;
    clearButton?: boolean;
    allowSearch?: boolean;
}
interface DateTimeBoxOptions extends ValueWidgetOptions {
    type?: 'date' | 'time' | 'datetime';
    format?: string;
    min?: Date | string;
    max?: Date | string;
    placeholder?: string;
    clearButton?: boolean;
}
interface ToggleSwitchOptions extends ValueWidgetOptions {
    label?: string;
    trueText?: string;
    falseText?: string;
}
interface LargeTextBoxOptions extends ValueWidgetOptions {
    rows?: number;
    maxLength?: number;
    minLength?: number;
    placeholder?: string;
    resizable?: boolean;
}
interface ColorBoxOptions extends ValueWidgetOptions {
    format?: 'hex' | 'rgb' | 'hsl';
    showAlpha?: boolean;
    showPalette?: boolean;
}
interface AXPFlexContainerOptions extends LayoutWidgetOptions {
    flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
    flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
    justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
    alignItems?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
    gap?: string;
    spacing?: {
        padding?: string;
        margin?: string;
    };
    border?: {
        radius?: string;
        width?: string;
        color?: string;
        style?: string;
    };
    backgroundColor?: string;
    direction?: string;
    overflow?: string;
    overflowX?: string;
    overflowY?: string;
    width?: string;
    minWidth?: string;
    maxWidth?: string;
    height?: string;
    minHeight?: string;
    maxHeight?: string;
}
interface AXPGridContainerOptions extends LayoutWidgetOptions {
    grid?: {
        default?: {
            columns?: number;
            rows?: number;
            gap?: string;
            justifyItems?: string;
            alignItems?: string;
            autoFlow?: string;
        };
    };
    spacing?: {
        padding?: string;
        margin?: string;
    };
    border?: {
        radius?: string;
        width?: string;
        color?: string;
        style?: string;
    };
    backgroundColor?: string;
    direction?: string;
    overflow?: string;
    overflowX?: string;
    overflowY?: string;
    width?: string;
    minWidth?: string;
    maxWidth?: string;
    height?: string;
    minHeight?: string;
    maxHeight?: string;
}
interface AXPPanelContainerOptions extends LayoutWidgetOptions {
    caption?: string;
    icon?: string;
    look?: 'solid' | 'fill' | 'outline' | 'flat' | 'none';
    disabled?: boolean;
    showHeader?: boolean;
    collapsed?: boolean;
}
interface AXPPageContainerOptions extends LayoutWidgetOptions {
    backgroundColor?: string;
    theme?: {
        id: string;
    };
    hasHeader?: boolean;
    hasFooter?: boolean;
    direction?: string;
}
interface AXPTabsetContainerOptions extends LayoutWidgetOptions {
    look?: 'with-line' | 'with-line-color' | 'pills' | 'pills-color';
    orientation?: 'vertical' | 'horizontal';
    activeIndex?: number;
}
interface AXPFieldsetContainerOptions extends LayoutWidgetOptions {
    title?: string;
    description?: string;
    icon?: string;
    collapsible?: boolean;
    isOpen?: boolean;
    look?: 'fieldset' | 'card' | 'group' | 'container';
    disabled?: boolean;
    showHeader?: boolean;
    cols?: number;
}
interface AXPFormFieldOptions extends LayoutWidgetOptions {
    label?: string;
    showLabel?: boolean;
}
interface AXPDialogContainerOptions extends LayoutWidgetOptions {
    title?: string;
    message?: string;
    size?: AXPopupSizeType;
    closeButton?: boolean;
    context?: any;
}
interface RichTextOptions extends ValueWidgetOptions {
    placeholder?: string;
    toolbar?: string[];
    readonly?: boolean;
}
interface PasswordBoxOptions extends ValueWidgetOptions {
    placeholder?: string;
    revealToggle?: boolean;
    maxLength?: number;
}
interface LookupBoxOptions extends ValueWidgetOptions {
    dataSource?: any[] | (() => any[]) | (() => Promise<any[]>);
    valueField?: string;
    textField?: string;
    searchable?: boolean;
    entity?: string;
    look?: string;
    columns?: any[];
    expose?: any[];
    multiple?: boolean;
    allowClear?: boolean;
}
interface SelectionListOptions extends ValueWidgetOptions {
    dataSource: any[] | (() => any[]) | (() => Promise<any[]>) | AXDataSource<any>;
    valueField?: string;
    textField?: string;
    multiple?: boolean;
    searchable?: boolean;
    placeholder?: string;
}
interface AXPListWidgetColumn {
    name: string;
    title?: string;
    visible?: boolean;
    width?: string;
    widget?: {
        type: string;
        path?: string;
        options?: any;
    };
}
interface AXPListWidgetRowCommand {
    title?: string;
    icon?: string;
    color?: string;
    disabled?: boolean | string;
    hidden?: boolean | string;
    command?: any;
}
interface AXPListWidgetOptions extends LayoutWidgetOptions {
    dataSource?: any[] | AXDataSource;
    columns?: AXPListWidgetColumn[];
    onRowClick?: (row: any) => void;
    onRowDoubleClick?: (row: any) => void;
    onSelectionChange?: (selectedRows: any[]) => void;
    onRowCommand?: (command: any, selectedRows: any[]) => void;
    paging?: boolean;
    showHeader?: boolean;
    showFooter?: boolean;
    fixHeader?: boolean;
    fixFooter?: boolean;
    fetchDataMode?: 'auto' | 'manual';
    parentField?: string;
    minHeight?: string | number;
    showIndex?: boolean;
    allowSelection?: boolean;
    primaryCommands?: any[];
    secondaryCommands?: AXPListWidgetRowCommand[];
    loading?: {
        enabled?: boolean;
        animation?: boolean;
    };
}
interface AXPWizardActionDefinition {
    title?: string;
    icon?: string;
    color?: string;
}
interface AXPWizardActions {
    previous?: AXPWizardActionDefinition;
    next?: AXPWizardActionDefinition;
    submit?: AXPWizardActionDefinition;
}
interface AXPStepDefinition {
    id: string;
    title: string;
    description?: string;
    icon?: string;
    skippable?: boolean;
    content: AXPWidgetNode;
    actions?: AXPActionMenuItem[];
}
interface AXPStepWizardGuardPayload {
    step: AXPStepDefinition;
    index: number;
    total: number;
    isFirst: boolean;
    isLast: boolean;
    context: any;
    stepContext?: any;
    dialogContext?: any;
}
interface AXPStepWizardStatus {
    currentStep: AXPStepDefinition;
    index: number;
    total: number;
    isFirst: boolean;
    isLast: boolean;
}
interface AXPStepWizardDefinition {
    steps: AXPStepDefinition[];
    linear?: boolean;
    direction?: 'horizontal' | 'vertical';
    look?: string;
    showActions?: boolean;
    actions?: AXPWizardActions;
    guards?: {
        next?: (payload: AXPStepWizardGuardPayload) => boolean | Promise<boolean>;
        prev?: (payload: AXPStepWizardGuardPayload) => boolean | Promise<boolean>;
    };
    events?: {
        onStepChanged?: (status: AXPStepWizardStatus) => void;
        onComplete?: (status: AXPStepWizardStatus) => void;
    };
}
interface AXPStepWizardContainerOptions extends LayoutWidgetOptions {
    definition?: AXPStepWizardDefinition;
}
interface InheritanceContext {
    mode?: AXPWidgetRenderMode;
    disabled?: boolean | string;
    readonly?: boolean | string;
    direction?: 'rtl' | 'ltr';
    visible?: boolean | string;
    defaultValue?: any;
}
interface InheritedProperties {
    mode: AXPWidgetRenderMode;
    disabled: boolean | string | undefined;
    readonly: boolean | string | undefined;
    direction: 'rtl' | 'ltr' | undefined;
    visible: boolean | string | undefined;
}
interface AXPWidgetConfiguration {
    type: string;
    options?: AXPOptionsData;
}
type LayoutBuilderState = AXPWidgetNode;
type WidgetBuilderState = AXPWidgetNode & {
    layout?: AXPGridLayoutOptions;
};
type FormFieldBuilderState = AXPWidgetNode & {
    layout?: AXPGridLayoutOptions;
};
type DialogBuilderState = AXPWidgetNode & {
    layout?: AXPGridLayoutOptions;
    dialogOptions?: AXPDialogContainerOptions;
    actions?: {
        footer?: {
            prefix?: AXPActionMenuItem[];
            suffix?: AXPActionMenuItem[];
        };
    };
};
interface IActionBuilder {
    cancel(text?: string): IActionBuilder;
    submit(text?: string): IActionBuilder;
    custom(action: AXPActionMenuItem): IActionBuilder;
}
interface ILayoutBuilder {
    grid(delegate: (container: IGridContainerBuilder) => void): ILayoutBuilder;
    flex(delegate: (container: IFlexContainerBuilder) => void): ILayoutBuilder;
    panel(delegate: (container: IPanelContainerBuilder) => void): ILayoutBuilder;
    page(delegate: (container: IPageContainerBuilder) => void): ILayoutBuilder;
    tabset(delegate: (container: ITabsetContainerBuilder) => void): ILayoutBuilder;
    fieldset(delegate: (container: IFieldsetContainerBuilder) => void): ILayoutBuilder;
    dialog(delegate: (container: IDialogBuilder) => void): IDialogBuilder;
    stepWizard(delegate: (wizard: IStepWizardBuilder) => void): ILayoutBuilder;
    build(): AXPWidgetNode;
    toJson(options?: {
        removeMeta?: boolean;
        removeFunctions?: boolean;
        pretty?: boolean;
    }): string;
}
interface IWidgetBuilder {
    name(name: string): IWidgetBuilder;
    path(path: string): IWidgetBuilder;
    type(type: string): IWidgetBuilder;
    options(options: AXPOptionsData): IWidgetBuilder;
    layout(config: Partial<AXPGridLayoutOptions>): IWidgetBuilder;
    layout(colSpan: number): IWidgetBuilder;
    mode(mode: AXPWidgetRenderMode): IWidgetBuilder;
    visible(condition: boolean | string): IWidgetBuilder;
    disabled(condition: boolean | string): IWidgetBuilder;
    readonly(condition: boolean | string): IWidgetBuilder;
    defaultValue(defaultValue: any): IWidgetBuilder;
    direction(direction: 'rtl' | 'ltr'): IWidgetBuilder;
    withInheritanceContext(context: InheritanceContext): IWidgetBuilder;
    getInheritanceContext(): InheritanceContext;
    build(): AXPWidgetNode;
}
interface IBaseContainerBuilder<TContainer = any> {
    name(name: string): TContainer;
    path(path: string): TContainer;
    mode(mode: AXPWidgetRenderMode): TContainer;
    visible(condition: boolean | AXPExpression): TContainer;
    disabled(condition: boolean | AXPExpression): TContainer;
    readonly(condition: boolean | AXPExpression): TContainer;
    direction(direction: 'rtl' | 'ltr'): TContainer;
    withInheritanceContext(context: InheritanceContext): TContainer;
    getInheritanceContext(): InheritanceContext;
    build(): AXPWidgetNode;
}
interface ILayoutContainerBuilder<TContainer = any> {
    layout(config: Partial<AXPGridLayoutOptions>): TContainer;
    layout(colSpan: number): TContainer;
}
interface IChildContainerBuilder<TContainer = any> {
    grid(delegate: (container: IGridContainerBuilder) => void): TContainer;
    flex(delegate: (container: IFlexContainerBuilder) => void): TContainer;
    panel(delegate: (container: IPanelContainerBuilder) => void): TContainer;
    page(delegate: (container: IPageContainerBuilder) => void): TContainer;
    tabset(delegate: (container: ITabsetContainerBuilder) => void): TContainer;
    fieldset(delegate: (container: IFieldsetContainerBuilder) => void): TContainer;
    formField(label: string, delegate?: (field: IFormFieldBuilder) => void): TContainer;
    stepWizard(delegate: (wizard: IStepWizardBuilder) => void): TContainer;
    dynamicForm(definition: AXPDynamicFormDefinition): TContainer;
}
interface IWidgetContainerBuilder<TContainer = any> {
    textBox(options?: TextBoxOptions): TContainer;
    largeTextBox(options?: LargeTextBoxOptions): TContainer;
    richText(options?: RichTextOptions): TContainer;
    passwordBox(options?: PasswordBoxOptions): TContainer;
    numberBox(options?: NumberBoxOptions): TContainer;
    selectBox(options: SelectBoxOptions): TContainer;
    lookupBox(options: LookupBoxOptions): TContainer;
    selectionList(options: SelectionListOptions): TContainer;
    dateTimeBox(options?: DateTimeBoxOptions): TContainer;
    toggleSwitch(options?: ToggleSwitchOptions): TContainer;
    colorBox(options?: ColorBoxOptions): TContainer;
    list(delegate: (container: IListWidgetBuilder) => void): TContainer;
    customWidget<T>(type: string, options?: T): TContainer;
    customWidget<T>(type: string, delegate: (widget: IWidgetBuilder) => void): TContainer;
}
interface IFlexContainerBuilder extends IBaseContainerBuilder<IFlexContainerBuilder>, ILayoutContainerBuilder<IFlexContainerBuilder>, IChildContainerBuilder<IFlexContainerBuilder>, IWidgetContainerBuilder<IFlexContainerBuilder> {
    setOptions(options: AXPFlexContainerOptions): IFlexContainerBuilder;
    setDirection(direction: 'row' | 'column' | 'row-reverse' | 'column-reverse'): IFlexContainerBuilder;
    setWrap(wrap: 'nowrap' | 'wrap' | 'wrap-reverse'): IFlexContainerBuilder;
    setJustifyContent(justify: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly'): IFlexContainerBuilder;
    setAlignItems(align: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'): IFlexContainerBuilder;
    setGap(gap: string): IFlexContainerBuilder;
    setBackgroundColor(color: string): IFlexContainerBuilder;
    setPadding(padding: string): IFlexContainerBuilder;
    setMargin(margin: string): IFlexContainerBuilder;
}
interface IGridContainerBuilder extends IBaseContainerBuilder<IGridContainerBuilder>, ILayoutContainerBuilder<IGridContainerBuilder>, IChildContainerBuilder<IGridContainerBuilder>, IWidgetContainerBuilder<IGridContainerBuilder> {
    setOptions(options: AXPGridContainerOptions): IGridContainerBuilder;
    setColumns(columns: number): IGridContainerBuilder;
    setRows(rows: number): IGridContainerBuilder;
    setGap(gap: string): IGridContainerBuilder;
    setJustifyItems(justify: 'start' | 'end' | 'center' | 'stretch'): IGridContainerBuilder;
    setAlignItems(align: 'start' | 'end' | 'center' | 'stretch'): IGridContainerBuilder;
    setAutoFlow(flow: 'row' | 'column' | 'row dense' | 'column dense'): IGridContainerBuilder;
    setBackgroundColor(color: string): IGridContainerBuilder;
    setPadding(padding: string): IGridContainerBuilder;
    setMargin(margin: string): IGridContainerBuilder;
}
interface IPanelContainerBuilder extends IBaseContainerBuilder<IPanelContainerBuilder>, ILayoutContainerBuilder<IPanelContainerBuilder>, IChildContainerBuilder<IPanelContainerBuilder>, IWidgetContainerBuilder<IPanelContainerBuilder> {
    setOptions(options: AXPPanelContainerOptions): IPanelContainerBuilder;
    setCaption(caption: string): IPanelContainerBuilder;
    setIcon(icon: string): IPanelContainerBuilder;
    setLook(look: 'solid' | 'fill' | 'outline' | 'flat' | 'none'): IPanelContainerBuilder;
    setShowHeader(show: boolean): IPanelContainerBuilder;
    setCollapsed(collapsed: boolean): IPanelContainerBuilder;
}
interface IPageContainerBuilder extends IBaseContainerBuilder<IPageContainerBuilder>, ILayoutContainerBuilder<IPageContainerBuilder>, IChildContainerBuilder<IPageContainerBuilder>, IWidgetContainerBuilder<IPageContainerBuilder> {
    setOptions(options: AXPPageContainerOptions): IPageContainerBuilder;
    setBackgroundColor(color: string): IPageContainerBuilder;
    setTheme(theme: {
        id: string;
    }): IPageContainerBuilder;
    setHasHeader(hasHeader: boolean): IPageContainerBuilder;
    setHasFooter(hasFooter: boolean): IPageContainerBuilder;
    setDirection(direction: 'rtl' | 'ltr'): IPageContainerBuilder;
}
interface ITabsetContainerBuilder extends IBaseContainerBuilder<ITabsetContainerBuilder>, ILayoutContainerBuilder<ITabsetContainerBuilder>, IChildContainerBuilder<ITabsetContainerBuilder>, IWidgetContainerBuilder<ITabsetContainerBuilder> {
    setOptions(options: AXPTabsetContainerOptions): ITabsetContainerBuilder;
    setLook(look: 'with-line' | 'with-line-color' | 'pills' | 'pills-color'): ITabsetContainerBuilder;
    setOrientation(orientation: 'vertical' | 'horizontal'): ITabsetContainerBuilder;
    setActiveIndex(index: number): ITabsetContainerBuilder;
}
interface IFormFieldBuilder extends IBaseContainerBuilder<IFormFieldBuilder>, ILayoutContainerBuilder<IFormFieldBuilder> {
    setOptions(options: AXPFormFieldOptions): IFormFieldBuilder;
    setLabel(label: string): IFormFieldBuilder;
    setShowLabel(showLabel: boolean): IFormFieldBuilder;
    defaultValue(value: any): IFormFieldBuilder;
    textBox(options?: Omit<TextBoxOptions, 'path'>): IFormFieldBuilder;
    largeTextBox(options?: Omit<LargeTextBoxOptions, 'path'>): IFormFieldBuilder;
    richText(options?: Omit<RichTextOptions, 'path'>): IFormFieldBuilder;
    passwordBox(options?: Omit<PasswordBoxOptions, 'path'>): IFormFieldBuilder;
    numberBox(options?: Omit<NumberBoxOptions, 'path'>): IFormFieldBuilder;
    selectBox(options: Omit<SelectBoxOptions, 'path'>): IFormFieldBuilder;
    lookupBox(options: Omit<LookupBoxOptions, 'path'>): IFormFieldBuilder;
    selectionList(options: Omit<SelectionListOptions, 'path'>): IFormFieldBuilder;
    dateTimeBox(options?: Omit<DateTimeBoxOptions, 'path'>): IFormFieldBuilder;
    toggleSwitch(options?: Omit<ToggleSwitchOptions, 'path'>): IFormFieldBuilder;
    colorBox(options?: Omit<ColorBoxOptions, 'path'>): IFormFieldBuilder;
    customWidget<T>(type: string, options?: Omit<T, 'path'>): IFormFieldBuilder;
    customWidget<T>(type: string, options?: Omit<T, 'path'> & Partial<AXPWidgetNodeExtendedProperties>): IFormFieldBuilder;
}
interface IFieldsetContainerBuilder extends IBaseContainerBuilder<IFieldsetContainerBuilder>, ILayoutContainerBuilder<IFieldsetContainerBuilder> {
    setOptions(options: AXPFieldsetContainerOptions): IFieldsetContainerBuilder;
    setTitle(title: string): IFieldsetContainerBuilder;
    setDescription(description: string): IFieldsetContainerBuilder;
    setIcon(icon: string): IFieldsetContainerBuilder;
    setCollapsible(collapsible: boolean): IFieldsetContainerBuilder;
    setIsOpen(isOpen: boolean): IFieldsetContainerBuilder;
    setLook(look: 'fieldset' | 'card' | 'group' | 'container'): IFieldsetContainerBuilder;
    setShowHeader(showHeader: boolean): IFieldsetContainerBuilder;
    setCols(cols: number): IFieldsetContainerBuilder;
    formField(label: string, delegate?: (field: IFormFieldBuilder) => void): IFieldsetContainerBuilder;
}
interface IDialogBuilder {
}
interface IDialogBuilder {
    setOptions(options: AXPDialogContainerOptions): IDialogBuilder;
    setTitle(title: string): IDialogBuilder;
    setMessage(message?: string): IDialogBuilder;
    setSize(size: AXPopupSizeType): IDialogBuilder;
    setCloseButton(closeButton: boolean): IDialogBuilder;
    setContext(context: any): IDialogBuilder;
    content(delegate: (layoutBuilder: IFlexContainerBuilder) => void): IDialogBuilder;
    setActions(delegate?: (actions: IActionBuilder) => void): IDialogBuilder;
    addCustomAction(action: AXPActionMenuItem): IDialogBuilder;
    build(): AXPWidgetNode;
    show(): Promise<AXPDialogRef>;
}
interface IListWidgetBuilder extends IBaseContainerBuilder<IListWidgetBuilder>, ILayoutContainerBuilder<IListWidgetBuilder>, IChildContainerBuilder<IListWidgetBuilder>, IWidgetContainerBuilder<IListWidgetBuilder> {
    setOptions(options: AXPListWidgetOptions): IListWidgetBuilder;
    setDataSource(dataSource: any[] | AXDataSource): IListWidgetBuilder;
    setColumns(columns: AXPListWidgetColumn[]): IListWidgetBuilder;
    setOnRowClick(handler: (row: any) => void): IListWidgetBuilder;
    setOnRowDoubleClick(handler: (row: any) => void): IListWidgetBuilder;
    setOnSelectionChange(handler: (selectedRows: any[]) => void): IListWidgetBuilder;
    setOnRowCommand(handler: (command: any, selectedRows: any[]) => void): IListWidgetBuilder;
    setPaging(paging: boolean): IListWidgetBuilder;
    setShowHeader(show: boolean): IListWidgetBuilder;
    setShowFooter(show: boolean): IListWidgetBuilder;
    setFixHeader(fix: boolean): IListWidgetBuilder;
    setFixFooter(fix: boolean): IListWidgetBuilder;
    setFetchDataMode(mode: 'auto' | 'manual'): IListWidgetBuilder;
    setParentField(field: string): IListWidgetBuilder;
    setMinHeight(height: string | number): IListWidgetBuilder;
    setShowIndex(show: boolean): IListWidgetBuilder;
    setAllowSelection(allow: boolean): IListWidgetBuilder;
    setPrimaryCommands(commands: any[]): IListWidgetBuilder;
    setSecondaryCommands(commands: AXPListWidgetRowCommand[]): IListWidgetBuilder;
    setLoading(loading: {
        enabled?: boolean;
        animation?: boolean;
    }): IListWidgetBuilder;
}
interface IStepBuilder {
    setIcon(icon: string): IStepBuilder;
    setDescription(description: string): IStepBuilder;
    setSkippable(skippable: boolean): IStepBuilder;
    content(delegate: (layoutBuilder: ILayoutBuilder) => void): IStepBuilder;
    build(): AXPStepDefinition;
}
interface IStepWizardBuilder extends IBaseContainerBuilder<IStepWizardBuilder>, ILayoutContainerBuilder<IStepWizardBuilder> {
    setLinear(linear: boolean): IStepWizardBuilder;
    setDirection(direction: 'horizontal' | 'vertical'): IStepWizardBuilder;
    setLook(look: AXStepWizardLook): IStepWizardBuilder;
    setShowActions(show: boolean): IStepWizardBuilder;
    setActions(actions: AXPWizardActions): IStepWizardBuilder;
    setGuards(guards: {
        next?: (payload: AXPStepWizardGuardPayload) => boolean | Promise<boolean>;
        prev?: (payload: AXPStepWizardGuardPayload) => boolean | Promise<boolean>;
    }): IStepWizardBuilder;
    setEvents(events: {
        onStepChanged?: (status: AXPStepWizardStatus) => void;
        onComplete?: (status: AXPStepWizardStatus) => void;
    }): IStepWizardBuilder;
    step(id: string, title: string, delegate: (step: IStepBuilder) => void): IStepWizardBuilder;
}

declare class AXPLayoutRendererComponent implements OnInit {
    #private;
    private conversionService;
    /**
     * RxJS subjects for context management
     */
    private contextUpdateSubject;
    private contextChangeSubject;
    /**
     * Form definition containing groups and fields OR widget tree
     */
    layout: _angular_core.InputSignal<AXPWidgetNode | AXPDynamicFormDefinition>;
    /**
     * Form context/model data
     */
    context: _angular_core.ModelSignal<any>;
    /**
     * Form appearance and density styling (normal, compact, spacious)
     */
    look: _angular_core.InputSignal<AXPDynamicFormLook>;
    /**
     * Default form mode. Can be overridden by section/group and field.
     */
    mode: _angular_core.InputSignal<AXPDynamicFormMode>;
    protected widgetTree: _angular_core.WritableSignal<AXPWidgetNode | null>;
    /**
     * Convert layout data to widget tree when inputs change
     */
    conversionEffect: _angular_core.EffectRef;
    /**
     * Emitted when context change is initiated
     */
    contextInitiated: _angular_core.OutputEmitterRef<any>;
    /**
     * Emitted when form becomes valid/invalid
     */
    validityChange: _angular_core.OutputEmitterRef<boolean>;
    private form;
    private container;
    /**
     * Internal context signal for reactivity
     */
    protected internalContext: _angular_core.WritableSignal<any>;
    /**
     * Initial context for reset functionality
     */
    private initialContext;
    ngOnInit(): void;
    /**
     * Handle context change events from widget container (optimized with RxJS)
     */
    protected handleContextChanged(event: AXPWidgetCoreContextChangeEvent): void;
    /**
     * Get the form component instance
     */
    getForm(): AXFormComponent | undefined;
    /**
     * Get the widget container component instance
     */
    getContainer(): AXPWidgetContainerComponent | undefined;
    /**
     * Get current form context
     */
    getContext(): any;
    /**
     * Update form context programmatically
     */
    updateContext(context: any): void;
    /**
     * Get the current widget tree
     */
    getWidgetTree(): AXPWidgetNode | null;
    /**
     * Validate the form
     */
    validate(): Promise<AXValidationSummary>;
    /**
     * Clear the form context
     */
    clear(): void;
    /**
     * Reset the form to its initial state
     */
    reset(): void;
    /**
     * Setup RxJS streams for context management
     */
    private setupContextStreams;
    /**
     * Type guard to check if the input is a form definition
     */
    private isFormDefinition;
    /**
     * Type guard to check if the input is a widget node
     */
    private isWidgetNode;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPLayoutRendererComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPLayoutRendererComponent, "axp-layout-renderer", never, { "layout": { "alias": "layout"; "required": true; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; }, { "context": "contextChange"; "contextInitiated": "contextInitiated"; "validityChange": "validityChange"; }, never, never, true, never>;
}

declare class LayoutBuilderModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<LayoutBuilderModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<LayoutBuilderModule, never, [typeof i1.CommonModule, typeof AXPLayoutRendererComponent], [typeof AXPLayoutRendererComponent]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<LayoutBuilderModule>;
}

declare class AXPLayoutBuilderService {
    private popupService;
    /**
     * Create a new layout builder
     */
    create(): ILayoutBuilder;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPLayoutBuilderService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXPLayoutBuilderService>;
}

declare class AXPLayoutConversionService {
    private widgetTreeCache;
    private formDefinitionCache;
    /**
     * Convert AXPDynamicFormDefinition to AXPWidgetNode tree structure
     * Groups become Fieldset Layouts with Form Field widgets as children
     * Fields become Form Field widgets with Editor widgets as children
     */
    convertFormDefinition(formDefinition: AXPDynamicFormDefinition): AXPWidgetNode;
    /**
     * Convert AXPWidgetNode tree back to AXPDynamicFormDefinition
     * Parses Fieldset Layouts back to Groups
     * Parses Form Field widgets back to Fields
     */
    convertWidgetTreeToFormDefinition(widgetTree: AXPWidgetNode): AXPDynamicFormDefinition;
    /**
     * Validate that a widget tree represents a valid dynamic form structure
     */
    validateFormWidgetTree(widgetTree: AXPWidgetNode): boolean;
    /**
     * Clear all caches
     */
    clearCaches(): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        widgetTreeCacheSize: number;
        formDefinitionCacheSize: number;
    };
    /**
     * Convert a single group to Fieldset widget structure
     */
    private createGroupAsFieldsetWidget;
    /**
     * Convert fields to Form Field widgets
     */
    private createFieldWidgets;
    /**
     * Convert a single field to Form Field widget with editor as child
     */
    private createFormFieldWidget;
    /**
     * Extract group information from Fieldset Layout widget
     */
    private extractGroupFromFieldset;
    /**
     * Extract field information from Form Field widget
     */
    private extractFieldFromFormWidget;
    /**
     * Create cache key for form definition
     */
    private createFormDefinitionCacheKey;
    /**
     * Create cache key for widget tree
     */
    private createWidgetTreeCacheKey;
    /**
     * Create a simple hash from a string
     */
    private createSimpleHash;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPLayoutConversionService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXPLayoutConversionService>;
}

interface DialogRendererConfig {
    title: string;
    message?: string;
    context: any;
    definition: AXPWidgetNode;
    actions?: {
        footer?: {
            prefix?: any[];
            suffix?: any[];
        };
    };
}
interface DialogRendererResult {
    context: any;
    action?: string;
}
declare class AXPDialogRendererComponent extends AXBasePageComponent implements OnInit {
    #private;
    config: DialogRendererConfig;
    result: EventEmitter<DialogRendererResult>;
    private widgetCoreService;
    private expressionEvaluator;
    private dialogResult?;
    context: _angular_core.WritableSignal<any>;
    callBack: (dialogRef: AXPDialogRef) => void;
    data: any;
    private isDialogLoading;
    footerPrefix: _angular_core.WritableSignal<AXPWidgetCoreElementAction[]>;
    footerSuffix: _angular_core.WritableSignal<AXPWidgetCoreElementAction[]>;
    ngOnInit(): void;
    private layoutRenderer;
    private debounceTimer?;
    handleContextChanged(event: any): void;
    handleContextInitiated(event: any): void;
    footerPrefixActions(): AXPWidgetCoreElementAction[];
    footerSuffixActions(): AXPWidgetCoreElementAction[];
    isFormLoading(): boolean;
    isSubmitting(): boolean;
    executeAction(action: AXPWidgetCoreElementAction): Promise<void>;
    private parseWidgetCommand;
    private executeWidgetApi;
    close(result?: DialogRendererResult): Promise<void>;
    private aggregateAndEvaluateActions;
    private collectWidgetActions;
    private collectDialogActionsFromConfig;
    private evaluatePredicates;
    private evalBool;
    private resolveApi;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPDialogRendererComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPDialogRendererComponent, "axp-dialog-renderer", never, {}, { "result": "result"; }, never, never, true, never>;
}

export { AXPDialogRendererComponent, AXPLayoutBuilderService, AXPLayoutConversionService, AXPLayoutRendererComponent, LayoutBuilderModule };
export type { AXPDialogContainerOptions, AXPDialogRef, AXPDynamicFormDefinition, AXPDynamicFormDirection, AXPDynamicFormFieldDefinition, AXPDynamicFormGroupDefinition, AXPDynamicFormLook, AXPDynamicFormMode, AXPFieldsetContainerOptions, AXPFlexContainerOptions, AXPFormFieldOptions, AXPGridContainerOptions, AXPListWidgetColumn, AXPListWidgetOptions, AXPListWidgetRowCommand, AXPPageContainerOptions, AXPPanelContainerOptions, AXPStepDefinition, AXPStepWizardContainerOptions, AXPStepWizardDefinition, AXPStepWizardGuardPayload, AXPStepWizardStatus, AXPTabsetContainerOptions, AXPWidgetConfiguration, AXPWidgetNodeExtendedProperties, AXPWizardActionDefinition, AXPWizardActions, ColorBoxOptions, DateTimeBoxOptions, DialogBuilderState, DialogRendererConfig, DialogRendererResult, FormFieldBuilderState, IActionBuilder, IBaseContainerBuilder, IChildContainerBuilder, IDialogBuilder, IFieldsetContainerBuilder, IFlexContainerBuilder, IFormFieldBuilder, IGridContainerBuilder, ILayoutBuilder, ILayoutContainerBuilder, IListWidgetBuilder, IPageContainerBuilder, IPanelContainerBuilder, IStepBuilder, IStepWizardBuilder, ITabsetContainerBuilder, IWidgetBuilder, IWidgetContainerBuilder, InheritanceContext, InheritedProperties, LargeTextBoxOptions, LayoutBuilderState, LayoutWidgetOptions, LookupBoxOptions, NumberBoxOptions, PasswordBoxOptions, RichTextOptions, SelectBoxOptions, SelectionListOptions, TextBoxOptions, ToggleSwitchOptions, ValueWidgetOptions, WidgetBuilderState };
