import { EntityType, FieldType, FilteringLogic, IExpressionTree, IFilteringExpression, IFilteringExpressionsTree, IQueryBuilderResourceStrings, OverlaySettings, PlatformUtil, preventImplicitSubmission, trackByIdentity } from "igniteui-angular/core"; import * as i0 from "@angular/core"; import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, PipeTransform, QueryList, TemplateRef } from "@angular/core"; import { IBaseChipEventArgs, IgxChipComponent } from "igniteui-angular/chips"; import { IgxSelectComponent } from "igniteui-angular/select"; import { IComboSelectionChangingEventArgs } from "igniteui-angular/combo"; import { IChangeCheckboxEventArgs } from "igniteui-angular/checkbox"; import { ISelectionEventArgs } from "igniteui-angular/drop-down"; import { IgxIconService } from "igniteui-angular/icon"; /** * @igxParent IgxQueryBuilderComponent */ export declare class IgxQueryBuilderHeaderComponent { private _destroyRef; private _resourceStrings; private _customResourceStrings; private _defaultResourceStrings; /** * @hidden @internal */ get getClass(): string; /** * Sets the title of the query builder header. * * @example * ```html * * ``` */ title: string; /** * Show/hide the legend. * * @example * ```html * * ``` * @deprecated in version 19.1.0. */ showLegend: boolean; /** * Sets the resource strings. * By default it uses EN resources. * * @deprecated in version 19.1.0. */ set resourceStrings(value: IQueryBuilderResourceStrings); /** * Returns the resource strings. */ get resourceStrings(): IQueryBuilderResourceStrings; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class IgxFieldFormatterPipe implements PipeTransform { transform(value: any, formatter: (v: any, data: any, fieldData?: any) => any, rowData: any, fieldData?: any): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * @hidden @internal */ declare class ExpressionItem { parent: ExpressionGroupItem; expanded: boolean; constructor(parent?: ExpressionGroupItem); } /** * @hidden @internal */ declare class ExpressionGroupItem extends ExpressionItem { operator: FilteringLogic; children: ExpressionItem[]; constructor(operator: FilteringLogic, parent?: ExpressionGroupItem); } /** * @hidden @internal */ declare class ExpressionOperandItem extends ExpressionItem { expression: IFilteringExpression; inEditMode: boolean; inAddMode: boolean; hovered: boolean; focused: boolean; fieldLabel: string; constructor(expression: IFilteringExpression, parent: ExpressionGroupItem); } /** * @hidden @internal */ declare const QueryBuilderSelectors: { DRAG_INDICATOR: string; CHIP_GHOST: string; DROP_DOWN_LIST_SCROLL: string; DROP_DOWN_ITEM_DISABLED: string; FILTER_TREE: string; FILTER_TREE_EXPRESSION_CONTEXT_MENU: string; FILTER_TREE_EXPRESSION_ITEM: string; FILTER_TREE_EXPRESSION_ITEM_DROP_GHOST: string; FILTER_TREE_EXPRESSION_ITEM_KEYBOARD_GHOST: string; FILTER_TREE_EXPRESSION_ITEM_GHOST: string; FILTER_TREE_EXPRESSION_SECTION: string; FILTER_TREE_LINE_AND: string; FILTER_TREE_LINE_OR: string; FILTER_TREE_SUBQUERY: string; QUERY_BUILDER: string; QUERY_BUILDER_BODY: string; QUERY_BUILDER_HEADER: string; QUERY_BUILDER_TREE: string; }; interface IgxQueryBuilderSearchValueContext { $implicit: any; selectedField: FieldType; selectedCondition: string; defaultSearchValueTemplate: TemplateRef; } /** @hidden @internal */ declare class IgxQueryBuilderDragService { /** The ExpressionItem that's actually the drop ghost's content */ dropGhostExpression: ExpressionItem; isKeyboardDrag: boolean; private _queryBuilderTreeComponent; private _queryBuilderTreeComponentElRef; private _sourceExpressionItem; private _sourceElement; private _targetExpressionItem; private _dropUnder; private _ghostChipMousemoveSubscription$; private _keyboardSubscription$; private _keyDragCurrentIndex; private _keyDragInitialIndex; private _isKeyDragsFirstMove; /** Stores a flat ordered list of possible drop locations as Tuple <[targetExpression, dropUnder]>, while performing the keyboard drag&drop */ private _possibleDropLocations; private _timeoutId; /** Get the dragged ghost as a HTMLElement*/ private get getDragGhostElement(); /** Get the drop ghost chip component */ private get getDropGhostElement(); private get getMainExpressionTree(); /** Whether a chip is currently being dragged with the mouse */ private get isMouseDragInProgress(); /** Whether a chip is currently being dragged with the keyboard */ private get isKeyboardDragInProgress(); register(tree: IgxQueryBuilderTreeComponent, el: ElementRef): void; /** When chip is picked up for dragging * * @param sourceDragElement The HTML element of the chip that's been dragged * @param sourceExpressionItem The expressionItem of the chip that's been dragged * @param isKeyboardDrag If it's a mouse drag or keyboard reorder * @param sourceChip The chip that's been mouse dragged * */ onMoveStart(sourceDragElement: HTMLElement, sourceExpressionItem: ExpressionItem, isKeyboardDrag: boolean, sourceChip?: IgxChipComponent): void; /** When dragged chip is let go outside a proper drop zone, or its drag is cancelled * @param event The chip's moveEnd event args */ onMoveEnd(event?: IBaseChipEventArgs): void; /** When mouse drag enters a chip's area * @param targetDragElement The HTML element of the drop area chip that's been dragged to * @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to */ onChipEnter(targetDragElement: HTMLElement, targetExpressionItem: ExpressionItem): void; /** When mouse drag moves in a div's drop area * @param targetDragElement The HTML element of the drop area chip that's been dragged to * @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to */ onDivOver(targetDragElement: HTMLElement, targetExpressionItem: ExpressionItem): void; /** When mouse drag moves in a chip's drop area * @param targetDragElement The HTML element of the drop area chip that's been dragged to */ onChipOver(targetDragElement: HTMLElement): void; /** When mouse drag leaves a chip's drop area */ onChipLeave(): void; /** When dragged chip is let go in div's drop area * @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to */ onDivDropped(targetExpressionItem: ExpressionItem): void; /** When dragged chip is let go in chip's drop area */ onChipDropped(): void; /** When mouse drag moves in a AND/OR drop area * @param targetDragElement The HTML element of the drop area chip that's been dragged to * @param targetExpressionItem The expressionItem of the drop area chip that's been dragged to */ onGroupRootOver(targetDragElement: HTMLElement, targetExpressionItem: ExpressionGroupItem): void; /** When mouse drag moves in 'Add condition' button's drop area * @param addConditionElement The Add condition button HTML Element * @param rootGroup The root group of the query tree */ onAddConditionEnter(addConditionElement: HTMLElement, rootGroup: ExpressionGroupItem): void; /** When chip's drag indicator is focused * * @param sourceDragElement The HTML element of the chip that's been dragged * @param sourceExpressionItem The expressionItem of the chip that's been dragged * */ onChipDragIndicatorFocus(sourceDragElement: HTMLElement, sourceExpressionItem: ExpressionItem): void; /** When chip's drag indicator looses focus*/ onChipDragIndicatorFocusOut(): void; /** Upon blurring the tree, if Keyboard drag is underway and the next active item is not the drop ghost's drag indicator icon, cancel the drag&drop procedure*/ onDragFocusOut(): void; /** Starts a keyboard drag for the chip whose drag indicator is focused, since focusing it while mouse dragging is ignored */ private startKeyboardDragOnFocusedIndicator; /** Checks if the dragged ghost is horizontally on the same line with the drop ghost*/ private dragGhostIsOnDropGhostRow; /** Checks if the dragged ghost is north or south of a target element's center*/ private ghostInLowerPart; /** Make a copy of the _sourceExpressionItem's chip and paste it in the tree north or south of the _targetExpressionItem's chip */ private renderDropGhostChip; /** Set the cursor when dragging a ghost*/ private setDragCursor; /** Removes the drop ghost expression from the tree and it's chip effectively */ private clearDropGhost; /** Reset Drag&Drop vars. Optionally the drag source vars too*/ private resetDragAndDrop; /** Start listening for drag and drop specific keys */ private listenToKeyboard; /** Perform up/down movement of drop ghost along the expression tree*/ private arrowDrag; /** Produces a flat ordered list of possible drop locations as Tuple <[targetExpression, dropUnder]>, while performing the keyboard drag&drop */ private getPossibleDropLocations; /** Counts how many chips will be in the tree (from top to bottom) before the dropped one */ private countChipsBeforeDropLocation; /** Sets the z-index of the drag ghost with a little delay, since we don't have access to ghostCreated() but we know it's executed right after moveStart() */ private setDragGhostZIndex; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** @hidden */ declare class IgxQueryBuilderTreeComponent implements AfterViewInit, OnDestroy { cdr: ChangeDetectorRef; dragService: IgxQueryBuilderDragService; protected platform: PlatformUtil; private elRef; protected _localeId: string; /** * @hidden @internal */ _expressionTree: IExpressionTree; /** * @hidden @internal */ _expressionTreeCopy: IExpressionTree; /** * @hidden @internal */ get getClass(): string; /** * Sets/gets the entities. */ entities: EntityType[] | undefined; /** * Sets/gets the parent query builder component. */ queryBuilder: IgxQueryBuilderComponent; /** * Sets/gets the search value template. */ searchValueTemplate: TemplateRef; /** * Returns the parent expression operand. */ get parentExpression(): ExpressionOperandItem; /** * Sets the parent expression operand. */ set parentExpression(value: ExpressionOperandItem); /** * Returns the fields. */ get fields(): FieldType[]; /** * Sets the fields. */ set fields(fields: FieldType[]); /** * Returns the expression tree. */ get expressionTree(): IExpressionTree; /** * Sets the expression tree. */ set expressionTree(expressionTree: IExpressionTree); /** * Gets the `locale` of the query builder. * If not set, defaults to application's locale. */ get locale(): string; /** * Sets the `locale` of the query builder. * Expects a valid BCP 47 language tag. */ set locale(value: string); /** * Sets the resource strings. * By default it uses EN resources. */ set resourceStrings(value: IQueryBuilderResourceStrings); /** * Returns the resource strings. */ get resourceStrings(): IQueryBuilderResourceStrings; /** * Gets/sets the expected return field. */ expectedReturnField: string | undefined; /** * Event fired as the expression tree is changed. */ expressionTreeChange: EventEmitter; /** * Event fired if a nested query builder tree is being edited. */ inEditModeChange: EventEmitter; protected entitySelect: IgxSelectComponent; private editingInputs; private returnFieldsCombo; protected returnFieldSelect: IgxSelectComponent; private fieldSelect; private conditionSelect; private searchValueInput; private picker; private addConditionButton; private entityChangeDialog; private addExpressionItemDropDown; private groupContextMenuDropDown; /** * @hidden @internal */ expressionsChips: QueryList; protected set editingInputsContainer(value: ElementRef); protected set currentGroupButtonsContainer(value: ElementRef); private expressionsContainer; private innerQueries; /** * @hidden @internal */ innerQueryNewExpressionTree: IExpressionTree; /** * @hidden @internal */ rootGroup: ExpressionGroupItem; /** * @hidden @internal */ selectedExpressions: ExpressionOperandItem[]; /** * @hidden @internal */ currentGroup: ExpressionGroupItem; /** * @hidden @internal */ contextualGroup: ExpressionGroupItem; /** * @hidden @internal */ filteringLogics: any; /** * @hidden @internal */ selectedCondition: string; /** * @hidden @internal */ searchValue: { value: any; }; /** * @hidden @internal */ prevFocusedExpression: ExpressionOperandItem; /** * @hidden @internal */ initialOperator: number; /** * @hidden @internal */ returnFieldSelectOverlaySettings: OverlaySettings; /** * @hidden @internal */ entitySelectOverlaySettings: OverlaySettings; /** * @hidden @internal */ fieldSelectOverlaySettings: OverlaySettings; /** * @hidden @internal */ conditionSelectOverlaySettings: OverlaySettings; /** * @hidden @internal */ addExpressionDropDownOverlaySettings: OverlaySettings; /** * @hidden @internal */ groupContextMenuDropDownOverlaySettings: OverlaySettings; private destroy$; private _timeoutId; private _lastFocusedChipIndex; private _focusDelay; private _parentExpression; private _selectedEntity; private _selectedReturnFields; private _selectedField; private _editingInputsContainer; private _currentGroupButtonsContainer; private _addModeExpression; private _editedExpression; private _preventInit; private _prevFocusedContainer; private _fields; private _locale?; private _defaultLocale; private _entityNewValue; private _resourceStrings; private _customResourceStrings; private _defaultResourceStrings; /** * Returns if the select entity dropdown at the root level is disabled after the initial selection. */ get disableEntityChange(): boolean; /** * Returns if the fields combo at the root level is disabled. */ get disableReturnFieldsChange(): boolean; /** * Returns the current level. */ get level(): number; /** @hidden */ protected isAdvancedFiltering(): boolean; /** @hidden */ protected isHierarchicalNestedQuery(): boolean; /** @hidden */ protected isSearchValueInputDisabled(): boolean; constructor(); /** * @hidden @internal */ ngAfterViewInit(): void; /** * @hidden @internal */ ngOnDestroy(): void; /** * @hidden @internal */ set selectedEntity(value: string); /** * @hidden @internal */ get selectedEntity(): EntityType; /** * @hidden @internal */ onEntitySelectChanging(event: ISelectionEventArgs): void; /** * @hidden */ onShowEntityChangeDialogChange(eventArgs: IChangeCheckboxEventArgs): void; /** * @hidden */ onEntityChangeCancel(): void; /** * @hidden */ onEntityChangeConfirm(): void; /** * @hidden @internal */ set selectedReturnFields(value: string[]); /** * @hidden @internal */ get selectedReturnFields(): string[]; /** * @hidden @internal */ set selectedField(value: FieldType | null); /** * @hidden @internal */ get selectedField(): FieldType | null; /** * @hidden @internal * * used by the grid */ get isContextMenuVisible(): boolean; /** * @hidden @internal */ get hasEditedExpression(): boolean; /** * @hidden @internal */ addCondition(parent: ExpressionGroupItem, afterExpression?: ExpressionOperandItem, isUIInteraction?: boolean): void; /** * @hidden @internal */ addReverseGroup(parent?: ExpressionGroupItem, afterExpression?: ExpressionItem): void; /** * @hidden @internal */ commitExpression(): void; /** * @hidden @internal */ discardExpression(expressionItem?: ExpressionOperandItem): void; /** * @hidden @internal */ commitOperandEdit(): void; /** * @hidden @internal */ cancelOperandAdd(): void; /** * @hidden @internal */ deleteItem: (expressionItem: ExpressionItem, skipEmit?: boolean) => void; /** * @hidden @internal */ cancelOperandEdit(): void; /** * @hidden @internal */ operandCanBeCommitted(): boolean; /** * @hidden @internal */ canCommitCurrentState(): boolean; /** * @hidden @internal */ commitCurrentState(): void; /** * @hidden @internal */ exitEditAddMode(shouldPreventInit?: boolean): void; /** * @hidden @internal * * used by the grid */ exitOperandEdit(): void; /** * @hidden @internal */ isExpressionGroup(expression: ExpressionItem): boolean; /** * @hidden @internal */ onExpressionFocus(expressionItem: ExpressionOperandItem): void; /** * @hidden @internal */ onExpressionBlur(event: FocusEvent, expressionItem: ExpressionOperandItem): void; /** * @hidden @internal */ onChipRemove(expressionItem: ExpressionItem): void; /** * @hidden @internal */ focusChipAfterDrag: (index: number) => void; /** * @hidden @internal */ addExpressionBlur(): void; /** * @hidden @internal */ onChipClick(expressionItem: ExpressionOperandItem, chip: IgxChipComponent): void; /** * @hidden @internal */ enterExpressionEdit(expressionItem: ExpressionOperandItem, chip?: IgxChipComponent): void; /** * @hidden @internal */ clickExpressionAdd(targetButton: HTMLElement, chip: IgxChipComponent): void; /** * @hidden @internal */ openExpressionAddDialog(targetButton: HTMLElement): void; /** * @hidden @internal */ enterExpressionAdd(event: ISelectionEventArgs, expressionItem: ExpressionOperandItem): void; /** * @hidden @internal */ enterEditMode(expressionItem: ExpressionOperandItem): void; /** * @hidden @internal */ onConditionSelectChanging(event: ISelectionEventArgs): void; /** * @hidden @internal */ onGroupClick(groupContextMenuDropDown: any, targetButton: HTMLButtonElement, groupItem: ExpressionGroupItem): void; /** * @hidden @internal */ getOperator(expressionItem: any): any; /** * @hidden @internal */ getSwitchGroupText(expressionItem: any): string; /** * @hidden @internal */ onGroupContextMenuDropDownSelectionChanging(event: ISelectionEventArgs): void; /** * @hidden @internal */ ungroup(): void; /** * @hidden @internal */ selectFilteringLogic(index: number): void; /** * @hidden @internal */ getConditionFriendlyName(name: string): string; /** * @hidden @internal */ isDate(value: any): value is Date; /** * @hidden @internal */ invokeClick(eventArgs: KeyboardEvent): void; /** * @hidden @internal */ openPicker(args: KeyboardEvent): void; /** * @hidden @internal */ getConditionList(): string[]; /** * @hidden @internal */ getFormatter(field: string): ((value: any, rowData?: any) => any) | undefined; /** * @hidden @internal */ getFormat(field: string): string; /** * @hidden @internal * * used by the grid */ setAddButtonFocus(): void; /** * @hidden @internal */ context(expression: ExpressionItem, afterExpression?: ExpressionItem): { $implicit: ExpressionItem; afterExpression: ExpressionItem | undefined; }; formatReturnFields(innerTree: IFilteringExpressionsTree): string; isInEditMode(): boolean; onInEditModeChanged(expressionItem: ExpressionOperandItem): void; getExpressionTreeCopy(expressionTree: IExpressionTree, shouldAssignInnerQueryExprTree?: boolean): IExpressionTree; onSelectAllClicked(): void; onReturnFieldSelectChanging(event: IComboSelectionChangingEventArgs | ISelectionEventArgs): void; initExpressionTree(selectedEntityName: string, selectedReturnFields: string[]): void; getSearchValueTemplateContext(defaultSearchValueTemplate: TemplateRef): IgxQueryBuilderSearchValueContext; private getPipeArgs; private selectDefaultCondition; private getFilters; private addGroup; private createExpressionGroupItem; private createExpressionTreeFromGroupItem; private scrollElementIntoView; private focusEditedExpressionChip; private init; private initLocale; private onResourceChange; private updateResources; /** rootGroup is recreated after clicking Apply, which sets new expressionTree and calls init()*/ protected trackExpressionItem: typeof trackByIdentity; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Defines the custom template that will be used for the search value input of condition in edit mode * * @igxModule IgxQueryBuilderModule * @igxKeywords query builder, query builder search value * @igxGroup Data entry and display * * @example * * * * * */ export declare class IgxQueryBuilderSearchValueTemplateDirective { template: TemplateRef; static ngTemplateContextGuard(_directive: IgxQueryBuilderSearchValueTemplateDirective, context: unknown): context is IgxQueryBuilderSearchValueContext; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * A component used for operating with complex filters by creating or editing conditions * and grouping them using AND/OR logic. * It is used internally in the Advanced Filtering of the Grid. * * @example * ```html * * * ``` */ export declare class IgxQueryBuilderComponent implements OnDestroy { protected iconService: IgxIconService; protected readonly preventImplicitSubmission: typeof preventImplicitSubmission; /** * @hidden @internal */ cssClass: string; /** * @hidden @internal */ display: string; /** * Gets/sets whether the confirmation dialog should be shown when changing entity. * Default value is `true`. */ showEntityChangeDialog: boolean; /** * Gets the list of entities available for the query builder. * * Each entity describes a logical group of fields that can be used in queries. * An entity can optionally have child entities, allowing nested sub-queries. * * @returns An array of {@link EntityType} objects. */ get entities(): EntityType[]; /** * Sets the list of entities for the query builder. * If the `expressionTree` is defined, it will be recreated with the new entities. * * Each entity should be an {@link EntityType} object describing the fields and optionally child entities. * * Example: * ```ts * [ * { * name: 'Orders', * fields: [{ field: 'OrderID', dataType: 'number' }], * childEntities: [ * { * name: 'OrderDetails', * fields: [{ field: 'ProductID', dataType: 'number' }] * } * ] * } * ] * ``` * * @param entities - The array of entities to set. */ set entities(entities: EntityType[]); /** * Gets the list of fields for the QueryBuilder. * * @deprecated since version 19.1.0. Use the `entities` property instead. * @hidden */ get fields(): FieldType[]; /** * Sets the list of fields for the QueryBuilder. * Automatically wraps them into a single entity to maintain backward compatibility. * * @param fields - The array of fields to set. * @deprecated since version 19.1.0. Use the `entities` property instead. * @hidden */ set fields(fields: FieldType[]); /** * Returns the expression tree. */ get expressionTree(): IExpressionTree; /** * Sets the expression tree. */ set expressionTree(expressionTree: IExpressionTree); /** * Gets the `locale` of the query builder. * If not set, defaults to application's locale. */ locale: string; /** * Sets the resource strings. * By default it uses EN resources. */ set resourceStrings(value: IQueryBuilderResourceStrings); /** * Returns the resource strings. */ get resourceStrings(): IQueryBuilderResourceStrings; /** * Disables subsequent entity changes at the root level after the initial selection. */ disableEntityChange: boolean; /** * Sets/gets the search value template. */ set searchValueTemplate(template: TemplateRef); get searchValueTemplate(): TemplateRef; /** * Disables return fields changes at the root level. */ disableReturnFieldsChange: boolean; /** * Event fired as the expression tree is changed. * * ```html * * ``` */ expressionTreeChange: EventEmitter; /** * @hidden @internal */ protected searchValueTemplateDirective: IgxQueryBuilderSearchValueTemplateDirective; /** @hidden @internal */ protected queryBuilderHeaderCollection: QueryList; /** * @hidden @internal */ queryTree: IgxQueryBuilderTreeComponent; private destroy$; private _resourceStrings; private _customResourceStrings; private _defaultResourceStrings; private _expressionTree; private _fields; private _entities; private _shouldEmitTreeChange; private _searchValueTemplate; constructor(); /** * Returns whether the expression tree can be committed in the current state. */ canCommit(): boolean; /** * Commits the expression tree in the current state if it is valid. If not throws an exception. */ commit(): void; /** * Discards all unsaved changes to the expression tree. */ discard(): void; /** * @hidden @internal */ ngOnDestroy(): void; /** * @hidden @internal * * used by the grid */ get isContextMenuVisible(): boolean; /** * @hidden @internal * * used by the grid */ exitOperandEdit(): void; /** * @hidden @internal * * used by the grid */ setAddButtonFocus(): void; protected onExpressionTreeChange(tree: IExpressionTree): void; private registerSVGIcons; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_showEntityChangeDialog: unknown; } export declare const IGX_QUERY_BUILDER_DIRECTIVES: readonly [typeof IgxQueryBuilderComponent, typeof IgxQueryBuilderHeaderComponent, typeof IgxQueryBuilderSearchValueTemplateDirective]; /** * @hidden * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components */ export declare class IgxQueryBuilderModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export {};