@@ -10,7 +10,10 @@ import {
1010 Inject ,
1111 AfterViewInit ,
1212 SkipSelf ,
13- Input
13+ Input ,
14+ ContentChildren ,
15+ forwardRef ,
16+ QueryList
1417} from '@angular/core' ;
1518
1619import { DOCUMENT } from '@angular/common' ;
@@ -30,6 +33,17 @@ import {
3033 DxTemplateHost
3134} from 'devextreme-angular/core' ;
3235import { CollectionNestedOption } from 'devextreme-angular/core' ;
36+ import { DxiFormAsyncRuleComponent } from './async-rule-dxi' ;
37+ import { DxiFormCompareRuleComponent } from './compare-rule-dxi' ;
38+ import { DxiFormCustomRuleComponent } from './custom-rule-dxi' ;
39+ import { DxiFormEmailRuleComponent } from './email-rule-dxi' ;
40+ import { DxiFormNumericRuleComponent } from './numeric-rule-dxi' ;
41+ import { DxiFormPatternRuleComponent } from './pattern-rule-dxi' ;
42+ import { DxiFormRangeRuleComponent } from './range-rule-dxi' ;
43+ import { DxiFormRequiredRuleComponent } from './required-rule-dxi' ;
44+ import { DxiFormStringLengthRuleComponent } from './string-length-rule-dxi' ;
45+ import { DxiFormTabComponent } from './tab-dxi' ;
46+ import { DxiFormValidationRuleComponent } from './validation-rule-dxi' ;
3347
3448
3549@Component ( {
@@ -302,6 +316,94 @@ export class DxiFormItemComponent extends CollectionNestedOption implements Afte
302316 }
303317
304318
319+ @ContentChildren ( forwardRef ( ( ) => DxiFormAsyncRuleComponent ) )
320+ get asyncRulesChildren ( ) : QueryList < DxiFormAsyncRuleComponent > {
321+ return this . _getOption ( 'validationRules' ) ;
322+ }
323+ set asyncRulesChildren ( value ) {
324+ this . setChildren ( 'validationRules' , value ) ;
325+ }
326+
327+ @ContentChildren ( forwardRef ( ( ) => DxiFormCompareRuleComponent ) )
328+ get compareRulesChildren ( ) : QueryList < DxiFormCompareRuleComponent > {
329+ return this . _getOption ( 'validationRules' ) ;
330+ }
331+ set compareRulesChildren ( value ) {
332+ this . setChildren ( 'validationRules' , value ) ;
333+ }
334+
335+ @ContentChildren ( forwardRef ( ( ) => DxiFormCustomRuleComponent ) )
336+ get customRulesChildren ( ) : QueryList < DxiFormCustomRuleComponent > {
337+ return this . _getOption ( 'validationRules' ) ;
338+ }
339+ set customRulesChildren ( value ) {
340+ this . setChildren ( 'validationRules' , value ) ;
341+ }
342+
343+ @ContentChildren ( forwardRef ( ( ) => DxiFormEmailRuleComponent ) )
344+ get emailRulesChildren ( ) : QueryList < DxiFormEmailRuleComponent > {
345+ return this . _getOption ( 'validationRules' ) ;
346+ }
347+ set emailRulesChildren ( value ) {
348+ this . setChildren ( 'validationRules' , value ) ;
349+ }
350+
351+ @ContentChildren ( forwardRef ( ( ) => DxiFormNumericRuleComponent ) )
352+ get numericRulesChildren ( ) : QueryList < DxiFormNumericRuleComponent > {
353+ return this . _getOption ( 'validationRules' ) ;
354+ }
355+ set numericRulesChildren ( value ) {
356+ this . setChildren ( 'validationRules' , value ) ;
357+ }
358+
359+ @ContentChildren ( forwardRef ( ( ) => DxiFormPatternRuleComponent ) )
360+ get patternRulesChildren ( ) : QueryList < DxiFormPatternRuleComponent > {
361+ return this . _getOption ( 'validationRules' ) ;
362+ }
363+ set patternRulesChildren ( value ) {
364+ this . setChildren ( 'validationRules' , value ) ;
365+ }
366+
367+ @ContentChildren ( forwardRef ( ( ) => DxiFormRangeRuleComponent ) )
368+ get rangeRulesChildren ( ) : QueryList < DxiFormRangeRuleComponent > {
369+ return this . _getOption ( 'validationRules' ) ;
370+ }
371+ set rangeRulesChildren ( value ) {
372+ this . setChildren ( 'validationRules' , value ) ;
373+ }
374+
375+ @ContentChildren ( forwardRef ( ( ) => DxiFormRequiredRuleComponent ) )
376+ get requiredRulesChildren ( ) : QueryList < DxiFormRequiredRuleComponent > {
377+ return this . _getOption ( 'validationRules' ) ;
378+ }
379+ set requiredRulesChildren ( value ) {
380+ this . setChildren ( 'validationRules' , value ) ;
381+ }
382+
383+ @ContentChildren ( forwardRef ( ( ) => DxiFormStringLengthRuleComponent ) )
384+ get stringLengthRulesChildren ( ) : QueryList < DxiFormStringLengthRuleComponent > {
385+ return this . _getOption ( 'validationRules' ) ;
386+ }
387+ set stringLengthRulesChildren ( value ) {
388+ this . setChildren ( 'validationRules' , value ) ;
389+ }
390+
391+ @ContentChildren ( forwardRef ( ( ) => DxiFormTabComponent ) )
392+ get tabsChildren ( ) : QueryList < DxiFormTabComponent > {
393+ return this . _getOption ( 'tabs' ) ;
394+ }
395+ set tabsChildren ( value ) {
396+ this . setChildren ( 'tabs' , value ) ;
397+ }
398+
399+ @ContentChildren ( forwardRef ( ( ) => DxiFormValidationRuleComponent ) )
400+ get validationRulesChildren ( ) : QueryList < DxiFormValidationRuleComponent > {
401+ return this . _getOption ( 'validationRules' ) ;
402+ }
403+ set validationRulesChildren ( value ) {
404+ this . setChildren ( 'validationRules' , value ) ;
405+ }
406+
305407 constructor ( @SkipSelf ( ) @Host ( ) parentOptionHost : NestedOptionHost ,
306408 @Host ( ) optionHost : NestedOptionHost ,
307409 private renderer : Renderer2 ,
0 commit comments