@@ -526,6 +526,10 @@ export class DataGroup<
526526 private _$recUpdateLevel = 0
527527 /* @internal */
528528 private _$propertyComparer : ( ( a : DataValue , b : DataValue ) => boolean ) | null
529+ /* @internal */
530+ private _$unknownPropertyHandler :
531+ | ( ( this : GeneralComponent , name : string , value : DataValue ) => boolean | void )
532+ | null
529533
530534 /* @internal */
531535 private _$generateInnerData ( data : { [ key : string ] : DataValue } ) {
@@ -560,6 +564,9 @@ export class DataGroup<
560564 reflectToAttributes : boolean ,
561565 observerTree : DataGroupObserverTree ,
562566 propertyComparer : ( ( a : DataValue , b : DataValue ) => boolean ) | null ,
567+ unknownPropertyHandler :
568+ | ( ( this : GeneralComponent , name : string , value : DataValue ) => boolean | void )
569+ | null ,
563570 ) {
564571 this . _$comp = associatedComponent
565572 this . data = data
@@ -571,6 +578,7 @@ export class DataGroup<
571578 this . _$observerTree = observerTree
572579 this . _$observerStatus = new Array ( observerTree . observers . length ) as boolean [ ]
573580 this . _$propertyComparer = propertyComparer
581+ this . _$unknownPropertyHandler = unknownPropertyHandler
574582 this . innerData = this . _$generateInnerData ( data )
575583 }
576584
@@ -585,6 +593,7 @@ export class DataGroup<
585593 false ,
586594 new DataGroupObserverTree ( { } ) ,
587595 null ,
596+ null ,
588597 )
589598 }
590599
@@ -633,7 +642,7 @@ export class DataGroup<
633642 replaceProperty ( propName : string , newData : DataValue ) : boolean {
634643 let data = newData
635644 const prop = this . _$propFields [ propName ]
636- if ( ! prop ) return false
645+ if ( ! prop ) return this . _$unknownPropertyHandler ?. call ( this . _$comp ! , propName , newData ) ?? false
637646 if ( this . _$propertyPassingDeepCopy !== DeepCopyStrategy . None ) {
638647 if ( this . _$propertyPassingDeepCopy === DeepCopyStrategy . SimpleWithRecursion ) {
639648 data = deepCopy ( newData , true )
0 commit comments