diff --git a/projects/igniteui-angular-elements/src/app/custom-strategy.ts b/projects/igniteui-angular-elements/src/app/custom-strategy.ts index 0784e3abf83..e4d77febdd6 100644 --- a/projects/igniteui-angular-elements/src/app/custom-strategy.ts +++ b/projects/igniteui-angular-elements/src/app/custom-strategy.ts @@ -7,6 +7,7 @@ import { ComponentConfig, ContentQueryMeta } from './component-config'; import { ComponentNgElementStrategy, ComponentNgElementStrategyFactory, extractProjectableNodes } from './ng-element-strategy'; import { TemplateWrapperComponent } from './wrapper/wrapper.component'; +import { IExpressionTree, IFilteringExpression } from 'igniteui-angular'; export const ComponentRefKey = Symbol('ComponentRef'); const SCHEDULE_DELAY = 10; @@ -451,11 +452,30 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy { } protected patchOutputComponents(eventName: string, eventArgs: any) { - // Single out only `columnInit` event for now. If more events pop up will require a config generation. - if (eventName !== "columnInit") { + if (eventName === 'filteringExpressionsTreeChange' || eventName === 'expressionTreeChange' || eventName === 'advancedFilteringExpressionsTreeChange') { + this.stripExternalObject(eventArgs); return eventArgs; } - return this.createProxyForComponentValue(eventArgs, 1).value; + // Single out only `columnInit` event for now. If more events pop up will require a config generation. + if (eventName === "columnInit") { + return this.createProxyForComponentValue(eventArgs, 1).value; + } + return eventArgs; + } + + protected stripExternalObject(tree: IExpressionTree): void { + for (const operand of tree?.filteringOperands ?? []) { + if ('operator' in operand) { + this.stripExternalObject(operand); + continue; + } + + delete (operand.condition as any)?.externalObject; + + if ((operand as IFilteringExpression).searchTree) { + this.stripExternalObject(operand.searchTree); + } + } } /** diff --git a/projects/igniteui-angular/src/lib/query-builder/query-builder-tree.component.ts b/projects/igniteui-angular/src/lib/query-builder/query-builder-tree.component.ts index f456b40dbc7..d24fd109274 100644 --- a/projects/igniteui-angular/src/lib/query-builder/query-builder-tree.component.ts +++ b/projects/igniteui-angular/src/lib/query-builder/query-builder-tree.component.ts @@ -1701,7 +1701,7 @@ export class IgxQueryBuilderTreeComponent implements AfterViewInit, OnDestroy { this.cancelOperandEdit(); // Ignore values of certain properties for the comparison - const propsToIgnore = ['parent', 'hovered', 'ignoreCase', 'inEditMode', 'inAddMode']; + const propsToIgnore = ['parent', 'hovered', 'ignoreCase', 'inEditMode', 'inAddMode', 'externalObject']; const propsReplacer = function replacer(key, value) { if (propsToIgnore.indexOf(key) >= 0) { return undefined;