Skip to content

Commit 0aa93a3

Browse files
authored
Merge branch '20.0.x' into rivanova/fix-16057-20.0.x
2 parents d5363cf + 5b2242a commit 0aa93a3

File tree

2 files changed

+96
-10
lines changed

2 files changed

+96
-10
lines changed

projects/igniteui-angular/src/lib/grids/common/grid.interface.ts

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,63 @@ export interface RowType {
295295
*/
296296
unpin?: () => void;
297297
}
298-
298+
/**
299+
* Describes a field that can be used in the Grid and QueryBuilder components.
300+
*/
299301
export interface FieldType {
302+
/**
303+
* Display label for the field.
304+
*/
300305
label?: string;
306+
307+
/**
308+
* The internal field name, used in expressions and queries.
309+
*/
301310
field: string;
311+
312+
/**
313+
* Optional column header for UI display purposes.
314+
*/
302315
header?: string;
316+
317+
/**
318+
* The data type of the field.
319+
*/
303320
/* alternateType: GridColumnDataType */
304321
dataType: DataType;
322+
323+
/**
324+
* Options for the editor associated with this field.
325+
*/
305326
editorOptions?: IFieldEditorOptions;
327+
328+
/**
329+
* Optional filtering operands that apply to this field.
330+
*/
306331
filters?: IgxFilteringOperand;
332+
333+
/**
334+
* Optional arguments for any pipe applied to the field.
335+
*/
307336
pipeArgs?: IFieldPipeArgs;
337+
338+
/**
339+
* Default time format for Date/Time fields.
340+
*/
308341
defaultTimeFormat?: string;
342+
343+
/**
344+
* Default date/time format for Date/Time fields.
345+
*/
309346
defaultDateTimeFormat?: string;
310347

348+
/**
349+
* Optional formatter function to transform the value before display.
350+
*
351+
* @param value - The value of the field.
352+
* @param rowData - Optional row data that contains this field.
353+
* @returns The formatted value.
354+
*/
311355
formatter?(value: any, rowData?: any): any;
312356
}
313357

@@ -1492,10 +1536,24 @@ export interface IClipboardOptions {
14921536
}
14931537

14941538
/**
1495-
* An interface describing entity
1539+
* Describes an entity in the QueryBuilder.
1540+
* An entity represents a logical grouping of fields and can have nested child entities.
14961541
*/
14971542
export interface EntityType {
1543+
/**
1544+
* The name of the entity.
1545+
* Typically used as an identifier in expressions.
1546+
*/
14981547
name: string;
1548+
1549+
/**
1550+
* The list of fields that belong to this entity.
1551+
*/
14991552
fields: FieldType[];
1553+
1554+
/**
1555+
* Optional child entities.
1556+
* This allows building hierarchical or nested query structures.
1557+
*/
15001558
childEntities?: EntityType[];
15011559
}

projects/igniteui-angular/src/lib/query-builder/query-builder.component.ts

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,40 @@ export class IgxQueryBuilderComponent implements OnDestroy {
5151
public showEntityChangeDialog = true;
5252

5353
/**
54-
* Returns the entities.
55-
* @hidden
54+
* Gets the list of entities available for the IgxQueryBuilderComponent.
55+
*
56+
* Each entity describes a logical group of fields that can be used in queries.
57+
* An entity can optionally have child entities, allowing nested sub-queries.
58+
*
59+
* @returns An array of {@link EntityType} objects.
5660
*/
5761
public get entities(): EntityType[] {
5862
return this._entities;
5963
}
6064

6165
/**
62-
* Sets the entities.
63-
* @hidden
66+
* Sets the list of entities for the IgxQueryBuilderComponent.
67+
* If the `expressionTree` is defined, it will be recreated with the new entities.
68+
*
69+
* Each entity should be an {@link EntityType} object describing the fields and optionally child entities.
70+
*
71+
* Example:
72+
* ```ts
73+
* [
74+
* {
75+
* name: 'Orders',
76+
* fields: [{ field: 'OrderID', dataType: 'number' }],
77+
* childEntities: [
78+
* {
79+
* name: 'OrderDetails',
80+
* fields: [{ field: 'ProductID', dataType: 'number' }]
81+
* }
82+
* ]
83+
* }
84+
* ]
85+
* ```
86+
*
87+
* @param entities - The array of entities to set.
6488
*/
6589
@Input()
6690
public set entities(entities: EntityType[]) {
@@ -73,18 +97,22 @@ export class IgxQueryBuilderComponent implements OnDestroy {
7397
}
7498

7599
/**
76-
* Returns the fields.
100+
* Gets the list of fields for the QueryBuilder.
101+
*
102+
* @deprecated since version 19.1.0. Use the `entities` property instead.
77103
* @hidden
78-
* @deprecated in version 19.1.0. Use the `entities` property instead.
79104
*/
80105
public get fields(): FieldType[] {
81106
return this._fields;
82107
}
83108

84109
/**
85-
* Sets the fields.
110+
* Sets the list of fields for the QueryBuilder.
111+
* Automatically wraps them into a single entity to maintain backward compatibility.
112+
*
113+
* @param fields - The array of fields to set.
114+
* @deprecated since version 19.1.0. Use the `entities` property instead.
86115
* @hidden
87-
* @deprecated in version 19.1.0. Use the `entities` property instead.
88116
*/
89117
@Input()
90118
public set fields(fields: FieldType[]) {

0 commit comments

Comments
 (0)