From 345e321d244d221dfe4b45c7f6e87d8ed0ae4295 Mon Sep 17 00:00:00 2001 From: "anna.shakhova" Date: Wed, 27 May 2026 16:07:35 +0200 Subject: [PATCH] AI Assistant: update filterValue command public types --- .../src/common/grids/index.ts | 10 ++-- .../devextreme-angular/src/common/index.ts | 10 ++-- packages/devextreme-react/src/common/grids.ts | 10 ++-- packages/devextreme-react/src/common/index.ts | 10 ++-- packages/devextreme-vue/src/common/grids.ts | 10 ++-- packages/devextreme-vue/src/common/index.ts | 10 ++-- .../ai_assistant/commands/filtering.ts | 32 +----------- packages/devextreme/js/common/grids.d.ts | 43 ++++++++++++---- packages/devextreme/ts/dx.all.d.ts | 49 +++++++++++++------ 9 files changed, 104 insertions(+), 80 deletions(-) diff --git a/packages/devextreme-angular/src/common/grids/index.ts b/packages/devextreme-angular/src/common/grids/index.ts index cc9f2595b51f..3dfa383d0540 100644 --- a/packages/devextreme-angular/src/common/grids/index.ts +++ b/packages/devextreme-angular/src/common/grids/index.ts @@ -6,7 +6,7 @@ export type { AIColumnRequestCreatingInfo, ApplyChangesMode, ApplyFilterMode, - BasicFilterExprObj, + BasicFilterExpr, ColumnAIOptions, ColumnBase, ColumnButtonBase, @@ -22,7 +22,7 @@ export type { ColumnHeaderFilterSearchConfig, ColumnLookup, ColumnResizeMode, - CombinedFilterExprObj, + CombinedFilterExpr, CommandInfo, CompositeKeyPair, DataChange, @@ -34,7 +34,9 @@ export type { EditingTextsBase, EnterKeyAction, EnterKeyDirection, - FilterExprObj, + FilterExpr, + FilterExprNode, + FilterExprTree, FilterOperation, FilterPanel, FilterPanelTexts, @@ -55,7 +57,7 @@ export type { KeyboardNavigation, KeyDownInfo, LoadPanel, - NegatedFilterExprObj, + NegatedFilterExpr, NewRowInfo, NewRowPosition, Pager, diff --git a/packages/devextreme-angular/src/common/index.ts b/packages/devextreme-angular/src/common/index.ts index 6267639283ab..279b8990e09d 100644 --- a/packages/devextreme-angular/src/common/index.ts +++ b/packages/devextreme-angular/src/common/index.ts @@ -281,7 +281,7 @@ export namespace Grids { export type AIColumnRequestCreatingInfo = GridsModule.AIColumnRequestCreatingInfo; export type ApplyChangesMode = GridsModule.ApplyChangesMode; export type ApplyFilterMode = GridsModule.ApplyFilterMode; - export type BasicFilterExprObj = GridsModule.BasicFilterExprObj; + export type BasicFilterExpr = GridsModule.BasicFilterExpr; export type ColumnAIOptions = GridsModule.ColumnAIOptions; export type ColumnBase = GridsModule.ColumnBase; export type ColumnButtonBase = GridsModule.ColumnButtonBase; @@ -297,7 +297,7 @@ export namespace Grids { export type ColumnHeaderFilterSearchConfig = GridsModule.ColumnHeaderFilterSearchConfig; export type ColumnLookup = GridsModule.ColumnLookup; export type ColumnResizeMode = GridsModule.ColumnResizeMode; - export type CombinedFilterExprObj = GridsModule.CombinedFilterExprObj; + export type CombinedFilterExpr = GridsModule.CombinedFilterExpr; export type CommandInfo = GridsModule.CommandInfo; export type CompositeKeyPair = GridsModule.CompositeKeyPair; export type DataChange = GridsModule.DataChange; @@ -309,7 +309,9 @@ export namespace Grids { export type EditingTextsBase = GridsModule.EditingTextsBase; export type EnterKeyAction = GridsModule.EnterKeyAction; export type EnterKeyDirection = GridsModule.EnterKeyDirection; - export type FilterExprObj = GridsModule.FilterExprObj; + export type FilterExpr = GridsModule.FilterExpr; + export type FilterExprNode = GridsModule.FilterExprNode; + export type FilterExprTree = GridsModule.FilterExprTree; export type FilterOperation = GridsModule.FilterOperation; export type FilterPanel = GridsModule.FilterPanel; export type FilterPanelTexts = GridsModule.FilterPanelTexts; @@ -330,7 +332,7 @@ export namespace Grids { export type KeyboardNavigation = GridsModule.KeyboardNavigation; export type KeyDownInfo = GridsModule.KeyDownInfo; export type LoadPanel = GridsModule.LoadPanel; - export type NegatedFilterExprObj = GridsModule.NegatedFilterExprObj; + export type NegatedFilterExpr = GridsModule.NegatedFilterExpr; export type NewRowInfo = GridsModule.NewRowInfo; export type NewRowPosition = GridsModule.NewRowPosition; export type Pager = GridsModule.Pager; diff --git a/packages/devextreme-react/src/common/grids.ts b/packages/devextreme-react/src/common/grids.ts index f1df9258b1ea..f90801f9d45e 100644 --- a/packages/devextreme-react/src/common/grids.ts +++ b/packages/devextreme-react/src/common/grids.ts @@ -6,7 +6,7 @@ export type { AIColumnRequestCreatingInfo, ApplyChangesMode, ApplyFilterMode, - BasicFilterExprObj, + BasicFilterExpr, ColumnAIOptions, ColumnBase, ColumnButtonBase, @@ -22,7 +22,7 @@ export type { ColumnHeaderFilterSearchConfig, ColumnLookup, ColumnResizeMode, - CombinedFilterExprObj, + CombinedFilterExpr, CommandInfo, CompositeKeyPair, DataChange, @@ -34,7 +34,9 @@ export type { EditingTextsBase, EnterKeyAction, EnterKeyDirection, - FilterExprObj, + FilterExpr, + FilterExprNode, + FilterExprTree, FilterOperation, FilterPanel, FilterPanelTexts, @@ -55,7 +57,7 @@ export type { KeyboardNavigation, KeyDownInfo, LoadPanel, - NegatedFilterExprObj, + NegatedFilterExpr, NewRowInfo, NewRowPosition, Pager, diff --git a/packages/devextreme-react/src/common/index.ts b/packages/devextreme-react/src/common/index.ts index cb837f030608..680fbb24f36a 100644 --- a/packages/devextreme-react/src/common/index.ts +++ b/packages/devextreme-react/src/common/index.ts @@ -281,7 +281,7 @@ export namespace Grids { export type AIColumnRequestCreatingInfo = GridsModule.AIColumnRequestCreatingInfo; export type ApplyChangesMode = GridsModule.ApplyChangesMode; export type ApplyFilterMode = GridsModule.ApplyFilterMode; - export type BasicFilterExprObj = GridsModule.BasicFilterExprObj; + export type BasicFilterExpr = GridsModule.BasicFilterExpr; export type ColumnAIOptions = GridsModule.ColumnAIOptions; export type ColumnBase = GridsModule.ColumnBase; export type ColumnButtonBase = GridsModule.ColumnButtonBase; @@ -297,7 +297,7 @@ export namespace Grids { export type ColumnHeaderFilterSearchConfig = GridsModule.ColumnHeaderFilterSearchConfig; export type ColumnLookup = GridsModule.ColumnLookup; export type ColumnResizeMode = GridsModule.ColumnResizeMode; - export type CombinedFilterExprObj = GridsModule.CombinedFilterExprObj; + export type CombinedFilterExpr = GridsModule.CombinedFilterExpr; export type CommandInfo = GridsModule.CommandInfo; export type CompositeKeyPair = GridsModule.CompositeKeyPair; export type DataChange = GridsModule.DataChange; @@ -309,7 +309,9 @@ export namespace Grids { export type EditingTextsBase = GridsModule.EditingTextsBase; export type EnterKeyAction = GridsModule.EnterKeyAction; export type EnterKeyDirection = GridsModule.EnterKeyDirection; - export type FilterExprObj = GridsModule.FilterExprObj; + export type FilterExpr = GridsModule.FilterExpr; + export type FilterExprNode = GridsModule.FilterExprNode; + export type FilterExprTree = GridsModule.FilterExprTree; export type FilterOperation = GridsModule.FilterOperation; export type FilterPanel = GridsModule.FilterPanel; export type FilterPanelTexts = GridsModule.FilterPanelTexts; @@ -330,7 +332,7 @@ export namespace Grids { export type KeyboardNavigation = GridsModule.KeyboardNavigation; export type KeyDownInfo = GridsModule.KeyDownInfo; export type LoadPanel = GridsModule.LoadPanel; - export type NegatedFilterExprObj = GridsModule.NegatedFilterExprObj; + export type NegatedFilterExpr = GridsModule.NegatedFilterExpr; export type NewRowInfo = GridsModule.NewRowInfo; export type NewRowPosition = GridsModule.NewRowPosition; export type Pager = GridsModule.Pager; diff --git a/packages/devextreme-vue/src/common/grids.ts b/packages/devextreme-vue/src/common/grids.ts index f1df9258b1ea..f90801f9d45e 100644 --- a/packages/devextreme-vue/src/common/grids.ts +++ b/packages/devextreme-vue/src/common/grids.ts @@ -6,7 +6,7 @@ export type { AIColumnRequestCreatingInfo, ApplyChangesMode, ApplyFilterMode, - BasicFilterExprObj, + BasicFilterExpr, ColumnAIOptions, ColumnBase, ColumnButtonBase, @@ -22,7 +22,7 @@ export type { ColumnHeaderFilterSearchConfig, ColumnLookup, ColumnResizeMode, - CombinedFilterExprObj, + CombinedFilterExpr, CommandInfo, CompositeKeyPair, DataChange, @@ -34,7 +34,9 @@ export type { EditingTextsBase, EnterKeyAction, EnterKeyDirection, - FilterExprObj, + FilterExpr, + FilterExprNode, + FilterExprTree, FilterOperation, FilterPanel, FilterPanelTexts, @@ -55,7 +57,7 @@ export type { KeyboardNavigation, KeyDownInfo, LoadPanel, - NegatedFilterExprObj, + NegatedFilterExpr, NewRowInfo, NewRowPosition, Pager, diff --git a/packages/devextreme-vue/src/common/index.ts b/packages/devextreme-vue/src/common/index.ts index cb837f030608..680fbb24f36a 100644 --- a/packages/devextreme-vue/src/common/index.ts +++ b/packages/devextreme-vue/src/common/index.ts @@ -281,7 +281,7 @@ export namespace Grids { export type AIColumnRequestCreatingInfo = GridsModule.AIColumnRequestCreatingInfo; export type ApplyChangesMode = GridsModule.ApplyChangesMode; export type ApplyFilterMode = GridsModule.ApplyFilterMode; - export type BasicFilterExprObj = GridsModule.BasicFilterExprObj; + export type BasicFilterExpr = GridsModule.BasicFilterExpr; export type ColumnAIOptions = GridsModule.ColumnAIOptions; export type ColumnBase = GridsModule.ColumnBase; export type ColumnButtonBase = GridsModule.ColumnButtonBase; @@ -297,7 +297,7 @@ export namespace Grids { export type ColumnHeaderFilterSearchConfig = GridsModule.ColumnHeaderFilterSearchConfig; export type ColumnLookup = GridsModule.ColumnLookup; export type ColumnResizeMode = GridsModule.ColumnResizeMode; - export type CombinedFilterExprObj = GridsModule.CombinedFilterExprObj; + export type CombinedFilterExpr = GridsModule.CombinedFilterExpr; export type CommandInfo = GridsModule.CommandInfo; export type CompositeKeyPair = GridsModule.CompositeKeyPair; export type DataChange = GridsModule.DataChange; @@ -309,7 +309,9 @@ export namespace Grids { export type EditingTextsBase = GridsModule.EditingTextsBase; export type EnterKeyAction = GridsModule.EnterKeyAction; export type EnterKeyDirection = GridsModule.EnterKeyDirection; - export type FilterExprObj = GridsModule.FilterExprObj; + export type FilterExpr = GridsModule.FilterExpr; + export type FilterExprNode = GridsModule.FilterExprNode; + export type FilterExprTree = GridsModule.FilterExprTree; export type FilterOperation = GridsModule.FilterOperation; export type FilterPanel = GridsModule.FilterPanel; export type FilterPanelTexts = GridsModule.FilterPanelTexts; @@ -330,7 +332,7 @@ export namespace Grids { export type KeyboardNavigation = GridsModule.KeyboardNavigation; export type KeyDownInfo = GridsModule.KeyDownInfo; export type LoadPanel = GridsModule.LoadPanel; - export type NegatedFilterExprObj = GridsModule.NegatedFilterExprObj; + export type NegatedFilterExpr = GridsModule.NegatedFilterExpr; export type NewRowInfo = GridsModule.NewRowInfo; export type NewRowPosition = GridsModule.NewRowPosition; export type Pager = GridsModule.Pager; diff --git a/packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/filtering.ts b/packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/filtering.ts index ad1437533a17..c010054f60e4 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/filtering.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/filtering.ts @@ -1,4 +1,5 @@ import type { SearchOperation } from '@js/common/data.types'; +import type { FilterExprNode, FilterExprTree } from '@js/common/grids'; import type { CommandResult } from '@ts/grids/grid_core/ai_assistant/types'; import { z } from 'zod'; @@ -9,37 +10,6 @@ const FILTER_OPS = [ 'contains', 'notcontains', 'startswith', 'endswith', ] as const satisfies readonly SearchOperation[]; -interface BasicFilterExpr { - type: 'basic'; - field: string; - operator: SearchOperation; - value: string | number | boolean | null; -} - -interface CombinedFilterExpr { - type: 'combined'; - combiner: 'and' | 'or'; - leftId: string; - rightId: string; -} - -interface NegatedFilterExpr { - type: 'negated'; - expressionId: string; -} - -type FilterExpr = BasicFilterExpr | CombinedFilterExpr | NegatedFilterExpr; - -interface FilterExprNode { - id: string; - expr: FilterExpr; -} - -interface FilterExprTree { - rootId: string; - nodes: FilterExprNode[]; -} - type FilterExprArray = | [string, SearchOperation, string | number | boolean | null] | [FilterExprArray, 'and' | 'or', FilterExprArray] | ['!', FilterExprArray]; diff --git a/packages/devextreme/js/common/grids.d.ts b/packages/devextreme/js/common/grids.d.ts index 1794caabb60f..30b89af484ed 100644 --- a/packages/devextreme/js/common/grids.d.ts +++ b/packages/devextreme/js/common/grids.d.ts @@ -105,7 +105,7 @@ export type ResponseStatusTexts = { * @public * @namespace DevExpress.common.grids */ -export type BasicFilterExprObj = { +export type BasicFilterExpr = { type: 'basic'; field: string; operator: SearchOperation; @@ -117,11 +117,11 @@ export type BasicFilterExprObj = { * @public * @namespace DevExpress.common.grids */ -export type CombinedFilterExprObj = { +export type CombinedFilterExpr = { type: 'combined'; - left: FilterExprObj; combiner: 'and' | 'or'; - right: FilterExprObj; + leftId: string; + rightId: string; }; /** @@ -129,9 +129,9 @@ export type CombinedFilterExprObj = { * @public * @namespace DevExpress.common.grids */ -export type NegatedFilterExprObj = { +export type NegatedFilterExpr = { type: 'negated'; - expression: FilterExprObj; + expressionId: string; }; /** @@ -139,7 +139,27 @@ export type NegatedFilterExprObj = { * @public * @namespace DevExpress.common.grids */ -export type FilterExprObj = BasicFilterExprObj | CombinedFilterExprObj | NegatedFilterExprObj; +export type FilterExpr = BasicFilterExpr | CombinedFilterExpr | NegatedFilterExpr; + +/** + * @docid + * @public + * @namespace DevExpress.common.grids + */ +interface FilterExprNode { + id: string; + expr: FilterExpr; +} + +/** + * @docid + * @public + * @namespace DevExpress.common.grids + */ +interface FilterExprTree { + rootId: string; + nodes: FilterExprNode[]; +} /** * @docid @@ -175,7 +195,7 @@ export type PredefinedCommands = { width: number | string; }; filterValue: { - expression: FilterExprObj | null; + expression: FilterExprTree | null; }; clearFilter: {}; focusRowByKey: { @@ -220,7 +240,12 @@ export type PredefinedCommands = { */ export type CommandInfo< TCommands extends PredefinedCommands = PredefinedCommands, -> = { [K in keyof TCommands]: { name: K; args: TCommands[K] } }[keyof TCommands]; +> = { + [K in keyof TCommands]: { + name: K; + args: TCommands[K] + } +}[keyof TCommands]; /** * @docid diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 8594eae34810..0cee04115773 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -4700,9 +4700,9 @@ declare module DevExpress.common.grids { export type ApplyChangesMode = 'instantly' | 'onDemand'; export type ApplyFilterMode = 'auto' | 'onClick'; /** - * [descr:BasicFilterExprObj] + * [descr:BasicFilterExpr] */ - export type BasicFilterExprObj = { + export type BasicFilterExpr = { type: 'basic'; field: string; operator: DevExpress.common.data.SearchOperation; @@ -5251,13 +5251,13 @@ declare module DevExpress.common.grids { }; export type ColumnResizeMode = 'nextColumn' | 'widget'; /** - * [descr:CombinedFilterExprObj] + * [descr:CombinedFilterExpr] */ - export type CombinedFilterExprObj = { + export type CombinedFilterExpr = { type: 'combined'; - left: FilterExprObj; combiner: 'and' | 'or'; - right: FilterExprObj; + leftId: string; + rightId: string; }; /** * [descr:CommandInfo] @@ -5265,7 +5265,10 @@ declare module DevExpress.common.grids { export type CommandInfo< TCommands extends PredefinedCommands = PredefinedCommands > = { - [K in keyof TCommands]: { name: K; args: TCommands[K] }; + [K in keyof TCommands]: { + name: K; + args: TCommands[K]; + }; }[keyof TCommands]; /** * [descr:CompositeKeyPair] @@ -5450,12 +5453,26 @@ declare module DevExpress.common.grids { export type EnterKeyAction = 'startEdit' | 'moveFocus'; export type EnterKeyDirection = 'none' | 'column' | 'row'; /** - * [descr:FilterExprObj] + * [descr:FilterExpr] + */ + export type FilterExpr = + | BasicFilterExpr + | CombinedFilterExpr + | NegatedFilterExpr; + /** + * [descr:FilterExprNode] + */ + interface FilterExprNode { + id: string; + expr: FilterExpr; + } + /** + * [descr:FilterExprTree] */ - export type FilterExprObj = - | BasicFilterExprObj - | CombinedFilterExprObj - | NegatedFilterExprObj; + interface FilterExprTree { + rootId: string; + nodes: FilterExprNode[]; + } export type FilterOperation = | '=' | '<>' @@ -6481,11 +6498,11 @@ declare module DevExpress.common.grids { width?: number | string; }; /** - * [descr:NegatedFilterExprObj] + * [descr:NegatedFilterExpr] */ - export type NegatedFilterExprObj = { + export type NegatedFilterExpr = { type: 'negated'; - expression: FilterExprObj; + expressionId: string; }; /** * [descr:NewRowInfo] @@ -6567,7 +6584,7 @@ declare module DevExpress.common.grids { width: number | string; }; filterValue: { - expression: FilterExprObj | null; + expression: FilterExprTree | null; }; clearFilter: {}; focusRowByKey: {