11import { ChangeDetectionStrategy , ChangeDetectorRef , Component , HostBinding , Input , Type , ViewChild , ViewContainerRef } from '@angular/core' ;
22import { AbstractControl , FormControl , FormGroup } from '@angular/forms' ;
3- import { generateClassPrefix , WMLCustomComponent , WMLDeepPartial , WMLWrapper } from '@windmillcode/wml-components-base' ;
3+ import { generateClassPrefix , WMLCustomComponent , WMLDeepPartial , WMLUIProperty , WMLWrapper } from '@windmillcode/wml-components-base' ;
44import { addCustomComponent } from '@windmillcode/angular-wml-components-base' ;
55
66// rxjs
@@ -22,27 +22,28 @@ export class WMLFieldZeroPropsComponent {
2222 ) { }
2323
2424 classPrefix = generateClassPrefix ( 'WMLField' )
25- @Input ( "props" ) wmlField = new WMLFieldZeroProps ( )
25+ @Input ( "props" ) props = new WMLFieldZeroProps ( )
2626 @HostBinding ( 'class' ) myClass : string = this . classPrefix ( `View` ) ;
2727 @HostBinding ( 'attr.id' ) myId ?:string ;
28+ @HostBinding ( 'style' ) myStyle : Partial < CSSStyleDeclaration > = { } ;
2829 ngUnsub = new Subject < void > ( )
2930 @ViewChild ( "customLabel" , { read :ViewContainerRef , static :true } ) customLabel ! :ViewContainerRef ;
3031 @ViewChild ( "customField" , { read :ViewContainerRef , static :true } ) customField ! :ViewContainerRef ;
3132 @ViewChild ( "customError" , { read :ViewContainerRef , static :true } ) customError ! :ViewContainerRef ;
3233
3334 initComponent ( ) {
3435
35- if ( this . wmlField ) {
36- this . wmlField . view . cdref = this . cdref
36+ if ( this . props ) {
37+ this . props . view . cdref = this . cdref
3738 }
3839
3940 [ "label" , "field" , "error" ] . forEach ( ( key , index0 ) => {
40- if ( this . wmlField ?. [ key ] ?. type === "custom" ) {
41- this . wmlField [ key ] . custom . props . wmlField = this . wmlField
41+ if ( this . props ?. [ key ] ?. type === "custom" ) {
42+ this . props [ key ] . custom . props . wmlField = this . props
4243 addCustomComponent (
4344 [ this . customLabel , this . customField , this . customError ] [ index0 ] ,
44- this . wmlField [ key ] . custom . cpnt as Type < any > ,
45- this . wmlField [ key ] . custom . props
45+ this . props [ key ] . custom . cpnt as Type < any > ,
46+ this . props [ key ] . custom . props
4647 )
4748 }
4849 } )
@@ -51,7 +52,8 @@ export class WMLFieldZeroPropsComponent {
5152
5253 ngOnInit ( ) : void {
5354 this . initComponent ( )
54- this . myId = this . wmlField . view . id
55+ this . myId = this . props . view . id
56+ this . myStyle = this . props . view . style
5557 }
5658
5759 ngOnDestroy ( ) {
@@ -126,6 +128,8 @@ export class WMLFieldZeroProps<FC=any,FP=any> extends WMLWrapper {
126128 } = {
127129 type :"wml-card"
128130 }
131+
132+ parentContainer = new WMLUIProperty ( { } )
129133 label = {
130134 type :"custom" ,
131135 custom :new WMLCustomComponent < WMLLabelZeroComponent , WMLLabelZeroProps > ( {
0 commit comments