import * as _angular_core from '@angular/core'; import { InjectionToken, OnDestroy, OnInit, AfterViewInit, QueryList } from '@angular/core'; import { SdSearch, SdCustomValidator } from '@sdcorejs/angular/forms/models'; import { SdTableColumn, SdTableOption, SdTable } from '@sdcorejs/angular/components/table'; import { SdUploadFile } from '@sdcorejs/angular/components/upload-file'; import { Operator as Operator$1, ValidationPatternType, Color } from '@sdcorejs/utils/models'; import { SdUnwrapSignal } from '@sdcorejs/angular/utilities/models'; import { CdkDropList, CdkDragMove, CdkDragDrop, CdkDragEnter, CdkDragSortEvent, CdkDrag } from '@angular/cdk/drag-drop'; import { FormGroup } from '@angular/forms'; import { SdModal } from '@sdcorejs/angular/components/modal'; import { Subject } from 'rxjs'; import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer'; import { SdSearch as SdSearch$1 } from '@sdcorejs/angular/forms'; import * as _sdcorejs_angular_components_form_generic from '@sdcorejs/angular/components/form-generic'; type SdFormRenderEntity = Record & { sdRaw?: Record; }; interface SdFormGenericSelectionItem { value: string; display: string; disabled?: boolean; template?: string; data?: T; } interface SdFormGenericSelectionStaticItem { value: string; label: string; } type SdFormGenericDefinitionSelection = SelectionValues | SelectionLazyValues | SelectionValuesKey | SelectionLazyValuesKey; interface SelectionVariables { items?: { value: Extract; display: string; }[]; detail?: (values: string | number | string[] | number[], args: SdFormGenericArgs) => Promise; } interface SelectionQueries { items?: { value: string; display: string; }[]; } interface SelecttionBase { value: string; display: string; viewed?: (values: (string | number)[], args: SdFormGenericArgs) => Promise; queries?: SelectionQueries; variables?: SelectionVariables; } interface SelectionValuesKey extends SelecttionBase { valuesKey: string; args?: TArgs; } interface SelectionLazyValuesKey extends SelecttionBase { lazyValuesKey: string; args?: TArgs; } interface SelectionValues extends SelecttionBase { values: (args: SdFormGenericArgs) => Promise[]>; } interface SelectionLazyValues extends SelecttionBase { lazyValues: (searchArgs: Parameters[0], args: SdFormGenericArgs) => Promise[]>; } interface SdFormGenericExpression { key: string; type: 'combinator'; combinator: '&&' | '||'; conditions: (SdFormGenericExpression | SdFormGenericExpressionCondition)[]; } interface SdFormGenericExpressionCondition { key: string; type: 'condition'; field?: string; operator: Operator$1; value: any; dayInfo: DayInfo; } type Operator = 'EQUAL' | 'NOT_EQUAL' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_OR_EQUAL' | 'LESS_OR_EQUAL' | 'NULL' | 'NOT_NULL'; declare const Operators: { value: Operator; symbol?: string; display: string; }[]; type Attribute = AttributeBase | AttributeBoolean | AttributeDate | AttributeValues; interface AttributeBase { value: string; display: string; type: 'string' | 'number'; } interface AttributeBoolean { value: string; display: string; type: 'boolean'; displayOnTrue: string; displayOnFalse: string; } interface AttributeDate { value: string; display: string; type: 'datetime'; } interface DayInfo { type?: 'RELATED' | 'NOW' | 'DATETIME' | 'ATTRIBUTE'; related?: 'LASTDAY' | 'NEXTDAY' | 'LASTWEEK' | 'NEXTWEEK' | 'LASTMONTH' | 'NEXTMONTH'; relatedValue?: number; } declare const DayInfoTypes: { value: string; display: string; }[]; declare const DayInfoPreviouses: { value: string; display: string; format: (n: number) => string; }[]; declare const GetDatetimeValue: (value: string) => string | undefined; interface AttributeValues { value: string; display: string; type: 'values'; values: { value: string; display: string; }[]; } declare const AttributeOperators: Record; declare const GetAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => Attribute[]; declare const TemplateToCondition: (template: string | undefined | null, entity: Record) => string | undefined; declare const EvaluateExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition, entity: Record) => boolean | undefined; declare const ExpressionToJavascriptExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition) => string | undefined; type SdFormGenericValidation = ValidationExpression | ValidationFunction; interface ValidationBase { alert: 'warning' | 'error'; } interface ValidationExpression extends ValidationBase { type: 'expression'; expression: SdFormGenericExpression; message: string; } interface ValidationFunction extends ValidationBase { type: 'function'; code: string; } interface ValidateArgs { entity: Record; } interface SdFormGenericValidationFunction { value: string; display: string; validate: (args: ValidateArgs) => Promise; } interface SdFormGenericValidationConfiguration { functions?: SdFormGenericValidationFunction[]; } interface SdFormGeneric { components: (SdFormGenericComponent | SdFormGenericGroup)[]; variables?: SdFormGenericVariable[]; validations?: SdFormGenericValidation[]; } interface SdFormRenderConfiguration { onLoaded?: () => void; components: SdFormGeneric['components']; validations?: SdFormGeneric['validations']; variables?: SdFormGenericVariable[]; beforeSubmit?: (entity: Record) => Promise>; } interface SdFormGenericLayout { row?: string; columns: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; mobileColumns?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; } declare const GenerateId: () => string; declare const GenerateKey: () => string; declare const SdFormatComponent: (component: SdFormGenericComponent | SdFormGenericGroup) => void; interface SdFormGenericVariable { id: string; key: string; label: string; } type SdFormGenericComponent = SdFormGenericTextfield | SdFormGenericChipString | SdFormGenericChipCalendar | SdFormGenericTextarea | SdFormGenericNumber | SdFormGenericCheckbox | SdFormGenericDatetime | SdFormGenericValues | SdFormGenericUpload | SdFormGenericTable | SdFormGenericHtml | SdFormGenericBreak; type SdFormGenericValues = SdFormGenericRadio | SdFormGenericSelect | SdFormGenericChecklist; interface SdFormGenericComponentBase { template?: string; id: string; key: string; label: string; helperText?: string; layout?: SdFormGenericLayout; validate?: { required?: boolean; }; disabled?: boolean; properties?: { viewed?: boolean; hyperlink?: string; hidden?: boolean; hiddenWhenExpression?: SdFormGenericExpression; visibleWhenExpression?: SdFormGenericExpression; disabledWhenExpression?: SdFormGenericExpression; requiredWhenExpression?: SdFormGenericExpression; onChange?: { setValues?: Record; }; } & Record; } interface SdFormGenericTextfield extends SdFormGenericComponentBase { type: 'textfield'; defaultValue?: string; validate?: { maxlength?: number; minlength?: number; pattern?: ValidationPatternType | string; patternErrorMessage?: string; } & SdFormGenericComponentBase['validate']; } interface SdFormGenericChipString extends SdFormGenericComponentBase { type: 'chip-string'; defaultValue?: string[]; validate?: { maxlength?: number; minlength?: number; pattern?: ValidationPatternType | string; patternErrorMessage?: string; maxOfItems?: number; } & SdFormGenericComponentBase['validate']; } interface SdFormGenericChipCalendar extends SdFormGenericComponentBase { type: 'chip-calendar'; defaultValue?: string[]; validate?: { maxlength?: number; minlength?: number; pattern?: ValidationPatternType | string; patternErrorMessage?: string; maxOfItems?: number; } & SdFormGenericComponentBase['validate']; } interface SdFormGenericTextarea extends SdFormGenericComponentBase { type: 'textarea'; defaultValue?: string; validate?: { maxlength?: number; minlength?: number; } & SdFormGenericComponentBase['validate']; } interface SdFormGenericNumber extends SdFormGenericComponentBase { type: 'number'; defaultValue?: number; validate?: { min?: number; max?: number; } & SdFormGenericComponentBase['validate']; } interface SdFormGenericCheckbox extends SdFormGenericComponentBase { type: 'checkbox'; defaultValue?: boolean; } interface SdFormGenericDatetime extends SdFormGenericComponentBase { type: 'datetime'; subtype: 'date' | 'datetime'; defaultValue?: string; validate?: { min?: 'TODAY' | string; max?: 'TODAY' | string; } & SdFormGenericComponentBase['validate']; } interface SdFormGenericRadio extends SdFormGenericComponentBase { type: 'radio'; values?: SdFormGenericSelectionStaticItem[]; valuesKey?: string; defaultValue?: string; properties?: { direction?: 'row' | 'column'; } & SdFormGenericComponentBase['properties']; } interface SdFormGenericSelect extends SdFormGenericComponentBase { type: 'select'; values?: SdFormGenericSelectionStaticItem[]; valuesKey?: string; defaultValue?: string | string[]; properties?: { query?: Record; multiple?: boolean; setVariables?: Record; } & SdFormGenericComponentBase['properties']; } interface SdFormGenericChecklist extends SdFormGenericComponentBase { type: 'checklist'; values?: SdFormGenericSelectionStaticItem[]; valuesKey?: string; defaultValue?: string[]; properties?: { query?: Record; } & SdFormGenericComponentBase['properties']; } interface SdFormGenericGroup { id: string; type: 'group'; label: string; layout: SdFormGenericLayout; components: SdFormGenericComponent[]; properties: { icon: string; color: Color; hidden?: boolean; hiddenWhenExpression?: SdFormGenericExpression; visibleWhenExpression?: SdFormGenericExpression; }; } interface SdFormGenericUpload extends SdFormGenericComponentBase { type: 'upload'; properties?: { type?: SdUnwrapSignal; maxSize?: SdUnwrapSignal; max?: SdUnwrapSignal; extensions?: SdUnwrapSignal; args?: Record; source?: 'ALL' | 'PHOTO_LIBRARY' | 'CAPTURE'; } & SdFormGenericComponentBase['properties']; } interface FormRenderComponentTableColumnValues { valuesKey: string; query?: Record; } type SdFormGenericTableColumn = TableColumnString | TableColumnNumber | TableColumnBool | TableColumnDate | TableColumnDatetime | TableColumnRadio | TableColumnValues | TableColumnImage | TableColumnFile; declare const TableColumnTypes: { value: string; display: string; }[]; interface TableColumnBase { key: Extract; label: string; width?: SdTableColumn['width']; validate?: { required?: boolean; }; } interface TableColumnString extends TableColumnBase { type: 'string'; validate?: { minlength?: number; maxlength?: number; pattern?: string; patternErrorMessage?: string; } & TableColumnBase['validate']; } interface TableColumnNumber extends TableColumnBase { type: 'number'; validate?: { min?: number; max?: number; } & TableColumnBase['validate']; } interface TableColumnDate extends TableColumnBase { type: 'date'; validate?: { min?: 'TODAY' | string; max?: 'TODAY' | string; } & TableColumnBase['validate']; } interface TableColumnDatetime extends TableColumnBase { type: 'datetime'; validate?: { min?: 'TODAY' | string; max?: 'TODAY' | string; } & TableColumnBase['validate']; } interface TableColumnBool extends TableColumnBase { type: 'boolean'; displayOnTrue?: string; displayOnFalse?: string; } interface TableColumnRadio extends TableColumnBase { type: 'radio'; values?: SdFormGenericSelectionStaticItem[]; } interface TableColumnValues extends TableColumnBase { type: 'values'; valuesKey: string; query?: Record; values?: SdFormGenericSelectionStaticItem[]; } interface TableColumnImage extends TableColumnBase { type: 'image'; args?: Record; validate?: { max?: number; maxSize?: number; } & TableColumnBase['validate']; } interface TableColumnFile extends TableColumnBase { type: 'file'; args?: Record; validate?: { max?: number; maxSize?: number; } & TableColumnBase['validate']; } interface SdFormGenericTable extends SdFormGenericComponentBase { type: 'table'; columnsKey?: string; columns?: SdFormGenericTableColumn[]; properties?: { type?: SdTableOption['type']; titleButtonCreate?: string; } & SdFormGenericComponentBase['properties']; } /** * Break component — invisible runtime element ép xuống dòng mới. Dùng khi layout có * vùng cố định và việc ẩn/hiện trường khác không nên xáo trộn vị trí các trường còn lại. * Ở canvas (design) render thanh ngang mảnh; ở runtime render empty 12-col cell. * * Extend SdFormGenericComponentBase để tương thích với union narrowing trong các pipe/render * (key, validate, disabled, properties full) — runtime sẽ ignore mọi field ngoài id/type/layout. */ interface SdFormGenericBreak extends SdFormGenericComponentBase { type: 'break'; } interface SdFormGenericHtml { template?: string; id: string; key?: string; type: 'html'; content: string; validate?: { required?: boolean; }; layout?: SdFormGenericLayout; properties?: { viewed?: boolean; hyperlink?: string; hidden?: boolean; hiddenWhenExpression?: SdFormGenericExpression; visibleWhenExpression?: SdFormGenericExpression; variables?: { key: string; label: string; value?: string; }[]; queries?: { key: string; label: string; }[]; query?: Record; }; } type FormBuilderComponentGroup = 'basic' | 'choice' | 'advanced' | 'layout'; interface FormBuilderComponent { type: string; /** Material Icons Outlined icon name. Rendered via the builder icon alias. */ symbol: string; /** Category group for the left palette grouping. */ group: FormBuilderComponentGroup; name: string; } declare const FormBuilderComponents: FormBuilderComponent[]; /** Lookup: component type → Material icon + label, used by attribute panel header. */ declare const COMPONENT_ICONS: Record; declare const GetComponentAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => { value: string; display: string; }[]; declare const GetVariableAttributes: (variables: SdFormGenericVariable[]) => { value: string; display: string; }[]; interface SdFormGenericArgs { entity: Record; component?: SdFormGenericComponent; column?: SdFormGenericTableColumn; query?: Record; } interface SdFormGenericTemplate { value: string; display: string; component: Exclude; } interface SdFormGenericDefinitionTable { value: string; display: string; columns: () => SdFormGenericTableColumn[]; } type SdFormGenericDefinitionHtml = SdFormGenericDefinitionHtmlStatic | SdFormGenericDefinitionHtmlQuery; interface SdFormGenericDefinitionHtmlStatic { type: 'static'; value: string; display: string; content: string; variables?: { key: string; label: string; value?: string; }[]; } interface SdFormGenericDefinitionHtmlQuery { type: 'query'; value: string; display: string; queries: { key: string; label: string; }[]; content: (query?: Record) => Promise; variables?: { key: string; label: string; value?: string; }[]; } interface IWorkflowConfigurationForm { templates: SdFormGenericTemplate[]; selections: SdFormGenericDefinitionSelection[] | (() => SdFormGenericDefinitionSelection[]) | (() => Promise); getValues?: (key: string, selectionArgs?: TSelectionArgs) => Promise; getLazyValues?: (key: string, selectionArgs?: TSelectionArgs) => (searchArgs: Parameters[0], args: SdFormGenericArgs) => Promise; tables: SdFormGenericDefinitionTable[]; htmls: SdFormGenericDefinitionHtml[] | (() => SdFormGenericDefinitionHtml[]) | (() => Promise); validation?: SdFormGenericValidationConfiguration; } interface ISdFormGenericConfiguration { form?: IWorkflowConfigurationForm; } declare const SD_FORM_GENERIC_CONFIGURATION: InjectionToken; declare class UploadComponent implements OnDestroy, OnInit { #private; private readonly ref; readonly setVariables: _angular_core.InputSignal>; sdUploadFile?: SdUploadFile; readonly form: _angular_core.InputSignal>; value: any; entity: Record; set _entity(val: Record); component?: SdFormGenericUpload; set _component(val: SdFormGenericUpload); disabled: boolean; set _disabled(val: boolean | '' | undefined | null); required: boolean; set _required(val: boolean | '' | undefined | null); viewed: boolean; set _viewed(val: boolean | '' | undefined | null); validator?: SdCustomValidator; set _validator(validator: SdCustomValidator | undefined | null); /** Inserted by Angular inject() migration for backwards compatibility */ constructor(...args: unknown[]); ngOnDestroy(): void; ngOnInit(): void; upload: () => Promise; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class TableComponent implements AfterViewInit, OnDestroy, OnInit { #private; private ref; private readonly formGenericService; uploadFiles?: QueryList; table?: SdTable; sideDrawer?: SdSideDrawer; readonly setVariables: _angular_core.InputSignal>; readonly form: _angular_core.InputSignal>; component?: SdFormGenericTable; col: string; set _component(val: SdFormGenericTable); required: boolean; set _required(val: boolean | ''); viewed: boolean; set _viewed(val: boolean | '' | undefined | null); model: any[]; set _model(val: any[] | undefined | null); readonly modelChange: _angular_core.OutputEmitterRef; tableOption?: SdTableOption; row: any; columnValues: Record; formRenderColumn: Record; fileKeys: string[]; imageKeys: string[]; /** Inserted by Angular inject() migration for backwards compatibility */ constructor(...args: unknown[]); ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; onDetail: (row?: any) => void; onCancel: () => void; onAccept: (addable?: boolean) => void; onFileUploadChange(item: any, key: string, newValue: any): void; getArgs(key: string): Record | undefined; upload: () => Promise; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class LibItemComponent { itemUpload?: UploadComponent; itemTable?: TableComponent; readonly setVariables: _angular_core.InputSignal>; readonly form: _angular_core.InputSignal>; value: any; entity: Record; set _entity(val: Record); col: string; component?: SdFormGenericComponent; set _component(val: SdFormGenericComponent); disabled: boolean; set _disabled(val: boolean | '' | undefined); required: boolean; set _required(val: boolean | '' | undefined); viewed: boolean; set _viewed(val: boolean | '' | undefined); validator?: SdCustomValidator; set _validator(validator: SdCustomValidator); upload: () => Promise; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class SdFormRender implements OnDestroy, AfterViewInit { #private; formRenderItems: QueryList; form: FormGroup; configuration: SdFormRenderConfiguration; set _configuration(val: SdFormRenderConfiguration); set _default(defaultEntity: Record); entity: Record; set _entity(val: Record); properties: string[]; set _properties(val: string[]); viewed: boolean; set _viewed(val: boolean | ''); loadCompleted: boolean; hashedValues?: string; formValue: Record; setVariables: Subject<{ key: string; value: any; }>; private readonly ref; private readonly formGenericConfiguration; ngAfterViewInit(): void; ngOnDestroy(): void; upload: () => Promise; getValidationMessages: (alert: SdFormGenericValidation["alert"]) => Promise; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ConfigureValidationComponent implements AfterViewInit, OnDestroy { modal?: SdModal; form: FormGroup<{}>; attributes: Attribute[]; validations: SdFormGenericValidation[]; functions: SdFormGenericValidationFunction[]; alerts: { value: string; display: string; }[]; readonly accept: _angular_core.OutputEmitterRef; private readonly ref; private readonly formGenericConfiguration; constructor(); ngAfterViewInit(): void; ngOnDestroy(): void; open: (formGeneric: SdFormGeneric) => void; addValidation: (type: SdFormGenericValidation["type"]) => void; removaValidation: (index: number) => void; updateValidations: () => void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type FormBuilderLayoutItem = SdFormGenericComponent | SdFormGenericGroup; interface FormBuilderLayoutRow { id: string; items: FormBuilderLayoutItem[]; columns: number; } interface DragDropRowItem extends FormBuilderLayoutRow { rowIndex?: number; } interface ResizeState { itemId: string; rowId: string; columns: string; } type RowInsertionEdge = 'before' | 'after'; type PaletteDropTarget = { kind: 'empty'; } | { kind: 'inline'; rowId: string; index: number; columns: string; } | { kind: 'edge'; rowId: string; edge: RowInsertionEdge; }; declare class SdFormBuilder implements OnInit, OnDestroy { #private; readonly popupViewJSON: _angular_core.Signal; readonly popupConfigureVariables: _angular_core.Signal; readonly configureValidation: _angular_core.Signal; readonly formRender: _angular_core.Signal; private readonly canvasDropZone; readonly rowDropLists: _angular_core.Signal[]>; readonly connectedRowDropLists: _angular_core.Signal[]>; form: FormGroup<{}>; /** Input chính: schema form. Mỗi lần ref thay đổi → effect sẽ clone về local arrays. */ readonly formGeneric: _angular_core.InputSignal; readonly formBuilderComponents: FormBuilderComponent[]; readonly componentIcons: Record; readonly paletteSearch: _angular_core.WritableSignal; readonly paletteGroups: _angular_core.Signal<{ key: FormBuilderComponentGroup; label: string; items: FormBuilderComponent[]; }[]>; components: Required['components']; variables: Required['variables']; validations: Required['validations']; /** Cloned variables — dùng cho modal "Configure variables" (huỷ thì discard, ok thì gán ngược). */ clonedVariables: SdFormGenericVariable[]; readonly selectedComponent: _angular_core.WritableSignal; readonly isPreview: _angular_core.WritableSignal; readonly editingGroupId: _angular_core.WritableSignal; /** Group đang được Detail (tìm ở TOP-LEVEL theo id), undefined = đang ở canvas chính. */ readonly editingGroup: _angular_core.Signal; /** Signal toàn cục: TRUE khi BẤT KỲ cdkDrag nào đang active (palette, canvas, group, resize). * Trigger class `.fb-shell--dragging` để ẩn hover/actions/resize toàn diện, không phụ thuộc :has(). */ readonly isAnyDragging: _angular_core.WritableSignal; readonly dragSource: _angular_core.WritableSignal<"row" | "palette" | "canvas" | "resize" | undefined>; readonly draggedPaletteItem: _angular_core.WritableSignal; readonly paletteDropTarget: _angular_core.WritableSignal; /** @deprecated Internal drag-preview compatibility mirror; use no application code. */ readonly rowInsertionEdge: _angular_core.WritableSignal; /** @deprecated Internal drag-preview compatibility mirror; use no application code. */ readonly inlineDropTargetRow: _angular_core.WritableSignal; readonly resizeState: _angular_core.WritableSignal; readonly isResizing: _angular_core.Signal; expand: boolean; dragDropRows: DragDropRowItem[]; isDragging: boolean; targetItem?: DragDropRowItem; private lastDragPointer?; /** Handler chung cho mọi cdkDragStarted — set signal global true. */ onAnyDragStarted: () => void; onPaletteDragStarted: (item?: FormBuilderComponent) => void; onRowDragStarted: () => void; onAnyDragMoved: (event: CdkDragMove) => void; /** Handler chung cho mọi cdkDragEnded — set signal global false (dùng setTimeout 0 * để chờ CDK xử lý xong drop event trước khi UI re-enable). */ onAnyDragEnded: () => void; startResizeControl: (item: SdFormGenericComponent | SdFormGenericGroup, row: DragDropRowItem) => void; endResizeControl: (event: any) => void; constructor(); ngOnInit(): void; ngOnDestroy(): void; addComponent: (item: FormBuilderComponent, index?: number, layoutColumns?: string) => void; /** Symbol Material để render trên canvas item / attribute header. */ symbolFor: (item: SdFormGenericComponent | SdFormGenericGroup) => string; /** Human-readable type label (e.g. "Text field", "Date"). */ typeLabelFor: (item: SdFormGenericComponent | SdFormGenericGroup) => string; placeholderSymbolFor: (item: FormBuilderComponent | SdFormGenericComponent | SdFormGenericGroup | DragDropRowItem | undefined) => string; placeholderTitleFor: (item: FormBuilderComponent | SdFormGenericComponent | SdFormGenericGroup | DragDropRowItem | undefined) => string; placeholderMetaFor: (item: FormBuilderComponent | SdFormGenericComponent | SdFormGenericGroup | DragDropRowItem | undefined) => string; placeholderColumnsFor: (item: FormBuilderComponent | SdFormGenericComponent | SdFormGenericGroup | DragDropRowItem | undefined) => number; /** True nếu component có expression điều kiện — drives the "conditional" status chip. */ hasConditional: (item: SdFormGenericComponent | SdFormGenericGroup) => boolean; /** Map SdColor preset → 2 CSS var names cho header-bg và header-fg của group card. */ groupColorVars: (color: string | undefined | null) => { bg: string; fg: string; }; /** Segmented Design/Preview toggle (replaces play_circle/stop_circle). */ setMode: (preview: boolean) => void; /** Mở canvas thiết kế riêng cho 1 group (chỉ children của nó). Snapshot để Cancel revert. */ enterGroupEdit: (group: SdFormGenericGroup) => void; /** OK: giữ thay đổi children, quay về canvas chính. */ confirmGroupEdit: () => void; /** Cancel: revert children về snapshot lúc vào Detail, rồi quay về canvas chính. */ cancelGroupEdit: () => void; /** Quick-add break sau row chỉ định (theo scope hiện tại — top-level hoặc group). * Tính component index cuối cùng của row đó trong scope, splice break vào sau. */ insertBreakAfter: (row: DragDropRowItem) => void; /** Xoá component theo scope hiện tại (top-level hoặc children của group đang Detail). */ removeComponent: (id: string) => void; selectComponent: (item?: SdFormGenericComponent | SdFormGenericGroup) => void; onClickedOutside: (e: any) => void; clickFormContentEmpty: () => void; drop: (event: CdkDragDrop) => void; dragStartComponentItem: (event: any) => void; dragEndComponentItem: (event: any) => void; onMouseover: (event: MouseEvent, rowItem: DragDropRowItem) => void; isRowFull: (row: DragDropRowItem) => boolean; isRowInlineDropLocked: (row: DragDropRowItem) => boolean; shouldShowRowInsertionPlaceholder: (row: DragDropRowItem, edge?: RowInsertionEdge) => boolean; shouldShowInlinePalettePlaceholder: (row: DragDropRowItem, index: number) => boolean; isPaletteEmptyDropTarget: () => boolean; palettePlaceholderColumnsFor: (row?: DragDropRowItem) => number; onRowItemsDropEntered: (row: DragDropRowItem, event?: CdkDragEnter) => void; onRowItemsDropSorted: (row: DragDropRowItem, event: CdkDragSortEvent) => void; onRowItemsDropExited: (row: DragDropRowItem) => void; canEnterCanvasDropList: (drag: CdkDrag) => boolean; canEnterRowDropList: (drag: CdkDrag, drop: CdkDropList<(SdFormGenericComponent | SdFormGenericGroup)[]>) => boolean; onFocus: (event: FocusEvent) => void; xuLyKeoCheo: (dragItem?: SdFormGenericComponent | SdFormGenericGroup) => void; noReturnPredicate: () => boolean; changeSizeControl: (event: CdkDragMove, item: SdFormGenericComponent | SdFormGenericGroup, items: (SdFormGenericComponent | SdFormGenericGroup)[], currentIndex: number) => Promise; dragEndChangeSizeControl: (event: any) => void; onChangeViewed: (component: SdFormGenericComponent) => void; onChangeHidden: (component: SdFormGenericComponent | SdFormGenericGroup) => void; onDuplicate: (component: SdFormGenericComponent | SdFormGenericGroup) => void; jsonString?: string; viewJSON: () => void; updateJSON: () => void; configureVariables: () => void; addVariables: () => void; removeVariables: (id: string) => void; updateVariables: () => void; getComponents: () => (SdFormGenericComponent | SdFormGenericGroup)[]; getVariables: () => SdFormGenericVariable[]; getForm: () => SdFormGeneric; openConfigureValidation: () => void; onUpdateValidations: (validations: SdFormGenericValidation[]) => void; onValidate: () => Promise; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class SdFeelExpression implements OnInit { #private; private ref; private expressionFeelPipe; private formGenericService; modal?: SdModal; form: FormGroup<{}>; attributeOperators: Record<"string" | "number" | "boolean" | "datetime" | "values", { value: _sdcorejs_angular_components_form_generic.Operator; symbol?: string; display: string; }[]>; attributes: Attribute[]; attribute: Record; readonly components: _angular_core.InputSignal<(SdFormGenericComponent | SdFormGenericGroup)[]>; expression?: SdFormGenericExpression; set _expression(expression: SdFormGenericExpression | undefined); readonly expressionChange: _angular_core.OutputEmitterRef; model?: string; set _model(model: string | undefined); readonly modelChange: _angular_core.OutputEmitterRef; readonly sdChange: _angular_core.OutputEmitterRef<{ model?: string; expression?: SdFormGenericExpression; }>; /** Inserted by Angular inject() migration for backwards compatibility */ constructor(...args: unknown[]); ngOnInit(): void; edit: () => Promise; addCondition: (conditions: SdFormGenericExpression["conditions"]) => void; addCombinator: (conditions: SdFormGenericExpression["conditions"]) => void; remove: (conditions: SdFormGenericExpression["conditions"], idx: number) => void; onAccept: () => void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class SdFormRenderService { private readonly componentViewedPipe; /** Inserted by Angular inject() migration for backwards compatibility */ constructor(...args: unknown[]); viewEntities: (form: SdFormGeneric, entities: Record[]) => Promise[]>; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } export { AttributeOperators, COMPONENT_ICONS, DayInfoPreviouses, DayInfoTypes, EvaluateExpression, ExpressionToJavascriptExpression, FormBuilderComponents, GenerateId, GenerateKey, GetAttributes, GetComponentAttributes, GetDatetimeValue, GetVariableAttributes, Operators, SD_FORM_GENERIC_CONFIGURATION, SdFeelExpression, SdFormBuilder, SdFormRender, SdFormRenderService, SdFormatComponent, TableColumnTypes, TemplateToCondition }; export type { Attribute, DayInfo, FormBuilderComponent, FormBuilderComponentGroup, FormRenderComponentTableColumnValues, ISdFormGenericConfiguration, IWorkflowConfigurationForm, Operator, SdFormGeneric, SdFormGenericArgs, SdFormGenericBreak, SdFormGenericCheckbox, SdFormGenericChecklist, SdFormGenericChipCalendar, SdFormGenericChipString, SdFormGenericComponent, SdFormGenericComponentBase, SdFormGenericDatetime, SdFormGenericDefinitionHtml, SdFormGenericDefinitionSelection, SdFormGenericDefinitionTable, SdFormGenericExpression, SdFormGenericExpressionCondition, SdFormGenericGroup, SdFormGenericHtml, SdFormGenericLayout, SdFormGenericNumber, SdFormGenericRadio, SdFormGenericSelect, SdFormGenericSelectionItem, SdFormGenericSelectionStaticItem, SdFormGenericTable, SdFormGenericTableColumn, SdFormGenericTemplate, SdFormGenericTextarea, SdFormGenericTextfield, SdFormGenericUpload, SdFormGenericValues, SdFormGenericVariable, SdFormRenderConfiguration, SdFormRenderEntity };