@@ -5,186 +5,130 @@ import {
55 Component ,
66 NgModule ,
77 Host ,
8- ElementRef ,
9- Renderer2 ,
10- Inject ,
11- AfterViewInit ,
128 SkipSelf ,
13- Input ,
14- ContentChildren ,
15- QueryList
9+ Input
1610} from '@angular/core' ;
1711
18- import { DOCUMENT } from '@angular/common' ;
1912
2013
21- import { dxFormButtonItem , dxFormEmptyItem , dxFormGroupItem , dxFormSimpleItem , dxFormTabbedItem , FormItemType } from 'devextreme/ui/form' ;
14+
15+ import { SummaryType } from 'devextreme/common/grids' ;
16+ import { Format } from 'devextreme/common/core/localization' ;
2217
2318import {
2419 DxIntegrationModule ,
2520 NestedOptionHost ,
26- extractTemplate ,
27- DxTemplateDirective ,
28- IDxTemplateHost ,
29- DxTemplateHost ,
3021} from 'devextreme-angular/core' ;
3122import { CollectionNestedOption } from 'devextreme-angular/core' ;
3223
33- import {
34- PROPERTY_TOKEN_items ,
35- } from 'devextreme-angular/core/tokens' ;
24+ import { PROPERTY_TOKEN_groupItems } from 'devextreme-angular/core/tokens' ;
3625
3726@Component ( {
3827 selector : 'dxi-data-grid-group-item' ,
3928 standalone : true ,
40- template : '<ng-content></ng-content> ' ,
41- styles : [ ':host { display: block; } ' ] ,
29+ template : '' ,
30+ styles : [ '' ] ,
4231 imports : [ DxIntegrationModule ] ,
4332 providers : [
4433 NestedOptionHost ,
45- DxTemplateHost ,
4634 {
47- provide : PROPERTY_TOKEN_items ,
35+ provide : PROPERTY_TOKEN_groupItems ,
4836 useExisting : DxiDataGridGroupItemComponent ,
4937 }
5038 ]
5139} )
52- export class DxiDataGridGroupItemComponent extends CollectionNestedOption implements AfterViewInit ,
53- IDxTemplateHost {
54- @ContentChildren ( PROPERTY_TOKEN_items )
55- set _itemsContentChildren ( value : QueryList < CollectionNestedOption > ) {
56- this . setChildren ( 'items' , value ) ;
57- }
58-
59- @Input ( )
60- get alignItemLabels ( ) : boolean {
61- return this . _getOption ( 'alignItemLabels' ) ;
62- }
63- set alignItemLabels ( value : boolean ) {
64- this . _setOption ( 'alignItemLabels' , value ) ;
65- }
66-
67- @Input ( )
68- get caption ( ) : string | undefined {
69- return this . _getOption ( 'caption' ) ;
70- }
71- set caption ( value : string | undefined ) {
72- this . _setOption ( 'caption' , value ) ;
73- }
74-
75- @Input ( )
76- get captionTemplate ( ) : any {
77- return this . _getOption ( 'captionTemplate' ) ;
78- }
79- set captionTemplate ( value : any ) {
80- this . _setOption ( 'captionTemplate' , value ) ;
81- }
82-
40+ export class DxiDataGridGroupItemComponent extends CollectionNestedOption {
8341 @Input ( )
84- get colCount ( ) : number {
85- return this . _getOption ( 'colCount ' ) ;
42+ get alignByColumn ( ) : boolean {
43+ return this . _getOption ( 'alignByColumn ' ) ;
8644 }
87- set colCount ( value : number ) {
88- this . _setOption ( 'colCount ' , value ) ;
45+ set alignByColumn ( value : boolean ) {
46+ this . _setOption ( 'alignByColumn ' , value ) ;
8947 }
9048
9149 @Input ( )
92- get colCountByScreen ( ) : { lg ?: number | undefined , md ?: number | undefined , sm ?: number | undefined , xs ?: number | undefined } {
93- return this . _getOption ( 'colCountByScreen ' ) ;
50+ get column ( ) : string | undefined {
51+ return this . _getOption ( 'column ' ) ;
9452 }
95- set colCountByScreen ( value : { lg ?: number | undefined , md ?: number | undefined , sm ?: number | undefined , xs ?: number | undefined } ) {
96- this . _setOption ( 'colCountByScreen ' , value ) ;
53+ set column ( value : string | undefined ) {
54+ this . _setOption ( 'column ' , value ) ;
9755 }
9856
9957 @Input ( )
100- get colSpan ( ) : number | undefined {
101- return this . _getOption ( 'colSpan ' ) ;
58+ get customizeText ( ) : ( ( itemInfo : { value : string | number | Date , valueText : string } ) => string ) {
59+ return this . _getOption ( 'customizeText ' ) ;
10260 }
103- set colSpan ( value : number | undefined ) {
104- this . _setOption ( 'colSpan ' , value ) ;
61+ set customizeText ( value : ( ( itemInfo : { value : string | number | Date , valueText : string } ) => string ) ) {
62+ this . _setOption ( 'customizeText ' , value ) ;
10563 }
10664
10765 @Input ( )
108- get cssClass ( ) : string | undefined {
109- return this . _getOption ( 'cssClass ' ) ;
66+ get displayFormat ( ) : string | undefined {
67+ return this . _getOption ( 'displayFormat ' ) ;
11068 }
111- set cssClass ( value : string | undefined ) {
112- this . _setOption ( 'cssClass ' , value ) ;
69+ set displayFormat ( value : string | undefined ) {
70+ this . _setOption ( 'displayFormat ' , value ) ;
11371 }
11472
11573 @Input ( )
116- get items ( ) : Array < dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem > {
117- return this . _getOption ( 'items ' ) ;
74+ get name ( ) : string | undefined {
75+ return this . _getOption ( 'name ' ) ;
11876 }
119- set items ( value : Array < dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem > ) {
120- this . _setOption ( 'items ' , value ) ;
77+ set name ( value : string | undefined ) {
78+ this . _setOption ( 'name ' , value ) ;
12179 }
12280
12381 @Input ( )
124- get itemType ( ) : FormItemType {
125- return this . _getOption ( 'itemType ' ) ;
82+ get showInColumn ( ) : string | undefined {
83+ return this . _getOption ( 'showInColumn ' ) ;
12684 }
127- set itemType ( value : FormItemType ) {
128- this . _setOption ( 'itemType ' , value ) ;
85+ set showInColumn ( value : string | undefined ) {
86+ this . _setOption ( 'showInColumn ' , value ) ;
12987 }
13088
13189 @Input ( )
132- get name ( ) : string | undefined {
133- return this . _getOption ( 'name ' ) ;
90+ get showInGroupFooter ( ) : boolean {
91+ return this . _getOption ( 'showInGroupFooter ' ) ;
13492 }
135- set name ( value : string | undefined ) {
136- this . _setOption ( 'name ' , value ) ;
93+ set showInGroupFooter ( value : boolean ) {
94+ this . _setOption ( 'showInGroupFooter ' , value ) ;
13795 }
13896
13997 @Input ( )
140- get template ( ) : any {
141- return this . _getOption ( 'template ' ) ;
98+ get skipEmptyValues ( ) : boolean {
99+ return this . _getOption ( 'skipEmptyValues ' ) ;
142100 }
143- set template ( value : any ) {
144- this . _setOption ( 'template ' , value ) ;
101+ set skipEmptyValues ( value : boolean ) {
102+ this . _setOption ( 'skipEmptyValues ' , value ) ;
145103 }
146104
147105 @Input ( )
148- get visible ( ) : boolean {
149- return this . _getOption ( 'visible ' ) ;
106+ get summaryType ( ) : string | SummaryType | undefined {
107+ return this . _getOption ( 'summaryType ' ) ;
150108 }
151- set visible ( value : boolean ) {
152- this . _setOption ( 'visible ' , value ) ;
109+ set summaryType ( value : string | SummaryType | undefined ) {
110+ this . _setOption ( 'summaryType ' , value ) ;
153111 }
154112
155113 @Input ( )
156- get visibleIndex ( ) : number | undefined {
157- return this . _getOption ( 'visibleIndex ' ) ;
114+ get valueFormat ( ) : Format | undefined {
115+ return this . _getOption ( 'valueFormat ' ) ;
158116 }
159- set visibleIndex ( value : number | undefined ) {
160- this . _setOption ( 'visibleIndex ' , value ) ;
117+ set valueFormat ( value : Format | undefined ) {
118+ this . _setOption ( 'valueFormat ' , value ) ;
161119 }
162120
163121
164122 protected get _optionPath ( ) {
165- return 'items ' ;
123+ return 'groupItems ' ;
166124 }
167125
168126
169127 constructor ( @SkipSelf ( ) @Host ( ) parentOptionHost : NestedOptionHost ,
170- @Host ( ) optionHost : NestedOptionHost ,
171- private renderer : Renderer2 ,
172- @Inject ( DOCUMENT ) private document : any ,
173- @Host ( ) templateHost : DxTemplateHost ,
174- private element : ElementRef ) {
128+ @Host ( ) optionHost : NestedOptionHost ) {
175129 super ( ) ;
176130 parentOptionHost . setNestedOption ( this ) ;
177131 optionHost . setHost ( this , this . _fullOptionPath . bind ( this ) ) ;
178- templateHost . setHost ( this ) ;
179- this . itemType = 'group' ;
180-
181- }
182-
183- setTemplate ( template : DxTemplateDirective ) {
184- this . template = template ;
185- }
186- ngAfterViewInit ( ) {
187- extractTemplate ( this , this . element , this . renderer , this . document ) ;
188132 }
189133
190134
0 commit comments