@@ -21,7 +21,7 @@ import { IgxResourceStringsFR } from 'igniteui-angular-i18n';
2121import { CommonModule } from '@angular/common' ;
2222import { IgxQueryBuilderSearchValueTemplateDirective } from 'igniteui-angular/src/lib/query-builder/query-builder.directives' ;
2323import { FormsModule } from '@angular/forms' ;
24- import { IgxQueryBuilderTreeComponent } from "igniteui-angular/src/lib/query-builder/query-builder-tree.component" ;
24+ import { IgxQueryBuilderTreeComponent } from "igniteui-angular/src/lib/query-builder/query-builder-tree.component" ;
2525
2626@Component ( {
2727 providers : [ ] ,
@@ -72,189 +72,92 @@ export class QueryBuilderComponent implements OnInit {
7272 }
7373 ] ;
7474
75- if ( true ) {
76- const innerTree = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity B' , [ 'Number' ] ) ;
77- innerTree . filteringOperands . push ( {
78- fieldName : 'Number' ,
79- condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) ,
80- conditionName : IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) . name ,
81- searchVal : 123
82- } ) ;
83- innerTree . filteringOperands . push ( {
84- fieldName : 'String' ,
85- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) ,
86- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) . name ,
87- searchVal : 'abc'
88- } ) ;
89- innerTree . filteringOperands . push ( {
90- fieldName : 'Boolean' ,
91- condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) ,
92- conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) . name
93- } ) ;
94- innerTree . filteringOperands . push ( {
95- fieldName : 'Date' ,
96- condition : IgxDateFilteringOperand . instance ( ) . condition ( 'before' ) ,
97- conditionName : IgxDateFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
98- searchVal : new Date ( )
99- } ) ;
100- innerTree . filteringOperands . push ( {
101- fieldName : 'Time' ,
102- condition : IgxTimeFilteringOperand . instance ( ) . condition ( 'before' ) ,
103- conditionName : IgxTimeFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
104- searchVal : new Date ( )
105- } ) ;
106- innerTree . filteringOperands . push ( {
107- fieldName : 'DateTime' ,
108- condition : IgxDateTimeFilteringOperand . instance ( ) . condition ( 'before' ) ,
109- conditionName : IgxDateTimeFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
110- searchVal : new Date ( )
111- } ) ;
11275
113- const nestedGroup10 = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
114- nestedGroup10 . filteringOperands . push ( {
115- fieldName : 'Id' ,
116- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'in' ) ,
117- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'in' ) . name ,
118- searchTree : innerTree
119- } ) ;
120- nestedGroup10 . filteringOperands . push ( {
121- fieldName : 'Validated' ,
122- condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) ,
123- conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) . name
124- } ) ;
125-
126-
127- const nestedGroup20 = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
128- nestedGroup20 . filteringOperands . push ( {
129- fieldName : 'Name' ,
130- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'endsWith' ) ,
131- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'endsWith' ) . name ,
132- searchVal : 'a'
133- } ) ;
134- nestedGroup20 . filteringOperands . push ( {
135- fieldName : 'DateTime created' ,
136- condition : IgxDateFilteringOperand . instance ( ) . condition ( 'today' ) ,
137- conditionName : IgxDateFilteringOperand . instance ( ) . condition ( 'today' ) . name
138- } ) ;
139-
140- const nestedGroup21 = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity A' , [ '*' ] ) ;
141- nestedGroup21 . filteringOperands . push ( nestedGroup20 ) ;
142-
143- const nestedGroup22 = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
144- nestedGroup22 . filteringOperands . push ( nestedGroup21 ) ;
145-
146- const tree = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity A' , [ '*' ] ) ;
147- tree . filteringOperands . push ( nestedGroup10 ) ;
148- tree . filteringOperands . push ( {
149- fieldName : 'Validated' ,
150- condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'false' ) ,
151- conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'false' ) . name
152- } ) ;
153- tree . filteringOperands . push ( nestedGroup22 ) ;
154-
155-
156- const subGroup2 = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
157- subGroup2 . filteringOperands . push ( {
158- fieldName : 'Id' ,
159- condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) ,
160- conditionName : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) . name ,
161- searchVal : '3'
162- } ) ;
163- subGroup2 . filteringOperands . push ( {
164- fieldName : 'Name' ,
165- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'notNull' ) ,
166- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'notNull' ) . name
167- } ) ;
168- tree . filteringOperands . push ( subGroup2 ) ;
169-
170- this . expressionTree = tree ;
171- } else {
172- const innerTree = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity B' , [ 'Number' ] ) ;
173- innerTree . filteringOperands . push ( {
174- fieldName : 'Number' ,
175- condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) ,
176- conditionName : IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) . name ,
177- searchVal : 123
178- } ) ;
179- innerTree . filteringOperands . push ( {
180- fieldName : 'String' ,
181- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) ,
182- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) . name ,
183- searchVal : 'abc'
184- } ) ;
185- innerTree . filteringOperands . push ( {
186- fieldName : 'Boolean' ,
187- condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) ,
188- conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) . name
189- } ) ;
190- innerTree . filteringOperands . push ( {
191- fieldName : 'Date' ,
192- condition : IgxDateFilteringOperand . instance ( ) . condition ( 'before' ) ,
193- conditionName : IgxDateFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
194- searchVal : new Date ( )
195- } ) ;
196- innerTree . filteringOperands . push ( {
197- fieldName : 'Time' ,
198- condition : IgxTimeFilteringOperand . instance ( ) . condition ( 'before' ) ,
199- conditionName : IgxTimeFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
200- searchVal : new Date ( )
201- } ) ;
202- innerTree . filteringOperands . push ( {
203- fieldName : 'DateTime' ,
204- condition : IgxDateTimeFilteringOperand . instance ( ) . condition ( 'before' ) ,
205- conditionName : IgxDateTimeFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
206- searchVal : new Date ( )
207- } ) ;
208-
209- const tree = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity A' , [ '*' ] ) ;
210- tree . filteringOperands . push ( {
211- fieldName : 'Id' ,
212- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'in' ) ,
213- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'in' ) . name ,
214- searchTree : innerTree
215- } ) ;
216- tree . filteringOperands . push ( {
217- fieldName : 'Validated' ,
218- condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) ,
219- conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) . name
220- } ) ;
221-
222- const subGroup = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
223- subGroup . filteringOperands . push ( {
224- fieldName : 'Name' ,
225- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'endsWith' ) ,
226- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'endsWith' ) . name ,
227- searchVal : 'a'
228- } ) ;
229- subGroup . filteringOperands . push ( {
230- fieldName : 'DateTime created' ,
231- condition : IgxDateFilteringOperand . instance ( ) . condition ( 'today' ) ,
232- conditionName : IgxDateFilteringOperand . instance ( ) . condition ( 'today' ) . name
233- } ) ;
234- tree . filteringOperands . push ( subGroup ) ;
235-
236- tree . filteringOperands . push ( {
237- fieldName : 'Validated' ,
238- condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'false' ) ,
239- conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'false' ) . name
240- } ) ;
241-
242- const subGroup2 = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
243- subGroup2 . filteringOperands . push ( {
244- fieldName : 'Id' ,
245- condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) ,
246- conditionName : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) . name ,
247- searchVal : '3'
248- } ) ;
249- subGroup2 . filteringOperands . push ( {
250- fieldName : 'Name' ,
251- condition : IgxStringFilteringOperand . instance ( ) . condition ( 'notNull' ) ,
252- conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'notNull' ) . name
253- } ) ;
254- tree . filteringOperands . push ( subGroup2 ) ;
255-
256- this . expressionTree = tree ;
257- }
76+ const innerTree = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity B' , [ 'Number' ] ) ;
77+ innerTree . filteringOperands . push ( {
78+ fieldName : 'Number' ,
79+ condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) ,
80+ conditionName : IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) . name ,
81+ searchVal : 123
82+ } ) ;
83+ innerTree . filteringOperands . push ( {
84+ fieldName : 'String' ,
85+ condition : IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) ,
86+ conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) . name ,
87+ searchVal : 'abc'
88+ } ) ;
89+ innerTree . filteringOperands . push ( {
90+ fieldName : 'Boolean' ,
91+ condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) ,
92+ conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) . name
93+ } ) ;
94+ innerTree . filteringOperands . push ( {
95+ fieldName : 'Date' ,
96+ condition : IgxDateFilteringOperand . instance ( ) . condition ( 'before' ) ,
97+ conditionName : IgxDateFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
98+ searchVal : new Date ( )
99+ } ) ;
100+ innerTree . filteringOperands . push ( {
101+ fieldName : 'Time' ,
102+ condition : IgxTimeFilteringOperand . instance ( ) . condition ( 'before' ) ,
103+ conditionName : IgxTimeFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
104+ searchVal : new Date ( )
105+ } ) ;
106+ innerTree . filteringOperands . push ( {
107+ fieldName : 'DateTime' ,
108+ condition : IgxDateTimeFilteringOperand . instance ( ) . condition ( 'before' ) ,
109+ conditionName : IgxDateTimeFilteringOperand . instance ( ) . condition ( 'before' ) . name ,
110+ searchVal : new Date ( )
111+ } ) ;
112+
113+ const tree = new FilteringExpressionsTree ( FilteringLogic . And , undefined , 'Entity A' , [ '*' ] ) ;
114+ tree . filteringOperands . push ( {
115+ fieldName : 'Id' ,
116+ condition : IgxStringFilteringOperand . instance ( ) . condition ( 'in' ) ,
117+ conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'in' ) . name ,
118+ searchTree : innerTree
119+ } ) ;
120+ tree . filteringOperands . push ( {
121+ fieldName : 'Validated' ,
122+ condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) ,
123+ conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'true' ) . name
124+ } ) ;
125+
126+ const subGroup = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
127+ subGroup . filteringOperands . push ( {
128+ fieldName : 'Name' ,
129+ condition : IgxStringFilteringOperand . instance ( ) . condition ( 'endsWith' ) ,
130+ conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'endsWith' ) . name ,
131+ searchVal : 'a'
132+ } ) ;
133+ subGroup . filteringOperands . push ( {
134+ fieldName : 'DateTime created' ,
135+ condition : IgxDateFilteringOperand . instance ( ) . condition ( 'today' ) ,
136+ conditionName : IgxDateFilteringOperand . instance ( ) . condition ( 'today' ) . name
137+ } ) ;
138+ tree . filteringOperands . push ( subGroup ) ;
139+
140+ tree . filteringOperands . push ( {
141+ fieldName : 'Validated' ,
142+ condition : IgxBooleanFilteringOperand . instance ( ) . condition ( 'false' ) ,
143+ conditionName : IgxBooleanFilteringOperand . instance ( ) . condition ( 'false' ) . name
144+ } ) ;
145+
146+ const subGroup2 = new FilteringExpressionsTree ( FilteringLogic . Or , undefined , 'Entity A' , [ '*' ] ) ;
147+ subGroup2 . filteringOperands . push ( {
148+ fieldName : 'Id' ,
149+ condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) ,
150+ conditionName : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) . name ,
151+ searchVal : '3'
152+ } ) ;
153+ subGroup2 . filteringOperands . push ( {
154+ fieldName : 'Name' ,
155+ condition : IgxStringFilteringOperand . instance ( ) . condition ( 'notNull' ) ,
156+ conditionName : IgxStringFilteringOperand . instance ( ) . condition ( 'notNull' ) . name
157+ } ) ;
158+ tree . filteringOperands . push ( subGroup2 ) ;
159+
160+ this . expressionTree = tree ;
258161 this . lData = [ { id : 0 , field : 'a' } , { id : 1 , field : '1' } ]
259162 // this.onChange();
260163 }
0 commit comments