11/**
22*
33* ModelView.js
4- * @version : 4.0.2
5- * @built on 2022-02-22 11:13:41
4+ * @version : 4.0.3
5+ * @built on 2022-03-03 09:50:25
66*
77* A simple, light-weight, versatile and fast MVVM framework
88* optionaly integrates into both jQuery as MVVM plugin and jQueryUI as MVC widget
@@ -24,8 +24,8 @@ else if ( !(name in root) ) /* Browser/WebWorker/.. */
2424/**
2525*
2626* ModelView.js
27- * @version : 4.0.2
28- * @built on 2022-02-22 11:13:41
27+ * @version : 4.0.3
28+ * @built on 2022-03-03 09:50:25
2929*
3030* A simple, light-weight, versatile and fast MVVM framework
3131* optionaly integrates into both jQuery as MVVM plugin and jQueryUI as MVC widget
@@ -40,7 +40,7 @@ var HASDOC = ('undefined' !== typeof window) && ('undefined' !== typeof document
4040/**[DOC_MARKDOWN]
4141### ModelView API
4242
43- **Version 4.0.2 **
43+ **Version 4.0.3 **
4444
4545### Contents
4646
@@ -4960,7 +4960,7 @@ model.getVal( String dottedKey [, Boolean RAW=false ] );
49604960 if ( 0 > dottedKey . indexOf ( '.' ) )
49614961 {
49624962 // handle single key fast
4963- if ( ! RAW && ( r = getters [ dottedKey ] || getters [ WILDCARD ] ) && r . v ) return Value ( r . v . call ( model , dottedKey ) , dottedKey , true ) ;
4963+ if ( ! RAW && ( r = getters [ dottedKey ] || getters [ WILDCARD ] ) && r . v ) return Value ( r . v . call ( model , dottedKey ) , dottedKey , model . isDirty ( [ dottedKey ] ) ) ;
49644964 return is_instance ( data [ dottedKey ] , Value ) ? data [ dottedKey ] : Value ( data [ dottedKey ] , dottedKey , model . isDirty ( [ dottedKey ] ) ) ;
49654965 }
49664966 else if ( ( r = walk_and_get2 ( ks = dottedKey . split ( '.' ) , data , RAW ? null : getters , Model ) ) )
@@ -4974,7 +4974,7 @@ model.getVal( String dottedKey [, Boolean RAW=false ] );
49744974 else if ( false === r [ 0 ] )
49754975 {
49764976 ret = r [ 1 ] . call ( model , dottedKey ) ;
4977- return is_instance ( ret , Value ) ? ret : Value ( ret , dottedKey , true ) ;
4977+ return is_instance ( ret , Value ) ? ret : Value ( ret , dottedKey , model . isDirty ( ks ) ) ;
49784978 }
49794979 // model field
49804980 return is_instance ( r [ 1 ] , Value ) ? r [ 1 ] : Value ( r [ 1 ] , dottedKey , model . isDirty ( ks ) ) ;
@@ -5203,7 +5203,11 @@ model.set( String dottedKey, * val [, Boolean publish=false] );
52035203 model . setDirty ( ks ) ;
52045204
52055205 // notify any dependencies as well
5206- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5206+ if ( HAS . call ( ideps , dottedKey ) )
5207+ {
5208+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5209+ model . notify ( ideps [ dottedKey ] ) ;
5210+ }
52075211 }
52085212 return model ;
52095213 }
@@ -5287,7 +5291,11 @@ model.set( String dottedKey, * val [, Boolean publish=false] );
52875291 } ) ;
52885292 model . setDirty ( ks ) ;
52895293 // notify any dependencies as well
5290- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5294+ if ( HAS . call ( ideps , dottedKey ) )
5295+ {
5296+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5297+ model . notify ( ideps [ dottedKey ] ) ;
5298+ }
52915299 }
52925300 if ( model . $atom && dottedKey === model . $atom ) model . atomic = true ;
52935301 }
@@ -5320,7 +5328,11 @@ model.set( String dottedKey, * val [, Boolean publish=false] );
53205328 } ) ;
53215329 model . setDirty ( ks ) ;
53225330 // notify any dependencies as well
5323- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5331+ if ( HAS . call ( ideps , dottedKey ) )
5332+ {
5333+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5334+ model . notify ( ideps [ dottedKey ] ) ;
5335+ }
53245336 }
53255337
53265338 if ( model . $atom && dottedKey === model . $atom ) model . atomic = true ;
@@ -5407,7 +5419,11 @@ model.[add|append]( String dottedKey, * val [, Boolean prepend=False, Boolean pu
54075419 } ) ;
54085420 model . setDirty ( ks . concat ( index ) ) ;
54095421 // notify any dependencies as well
5410- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5422+ if ( HAS . call ( ideps , dottedKey ) )
5423+ {
5424+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5425+ model . notify ( ideps [ dottedKey ] ) ;
5426+ }
54115427 }
54125428 return model ;
54135429 }
@@ -5496,7 +5512,11 @@ model.[add|append]( String dottedKey, * val [, Boolean prepend=False, Boolean pu
54965512 } ) ;
54975513 model . setDirty ( ks ) ;
54985514 // notify any dependencies as well
5499- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5515+ if ( HAS . call ( ideps , dottedKey ) )
5516+ {
5517+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5518+ model . notify ( ideps [ dottedKey ] ) ;
5519+ }
55005520 }
55015521 if ( model . $atom && dottedKey === model . $atom ) model . atomic = true ;
55025522 }
@@ -5540,7 +5560,11 @@ model.[add|append]( String dottedKey, * val [, Boolean prepend=False, Boolean pu
55405560 } ) ;
55415561 model . setDirty ( ks . concat ( index ) ) ;
55425562 // notify any dependencies as well
5543- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5563+ if ( HAS . call ( ideps , dottedKey ) )
5564+ {
5565+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5566+ model . notify ( ideps [ dottedKey ] ) ;
5567+ }
55445568 }
55455569 if ( model . $atom && dottedKey === model . $atom ) model . atomic = true ;
55465570 }
@@ -5625,7 +5649,11 @@ model.[ins|insert]( String dottedKey, * val, Number index [, Boolean publish=fal
56255649 } ) ;
56265650 model . setDirty ( ks . concat ( index ) ) ;
56275651 // notify any dependencies as well
5628- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5652+ if ( HAS . call ( ideps , dottedKey ) )
5653+ {
5654+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5655+ model . notify ( ideps [ dottedKey ] ) ;
5656+ }
56295657 }
56305658 return model ;
56315659 }
@@ -5711,7 +5739,11 @@ model.[ins|insert]( String dottedKey, * val, Number index [, Boolean publish=fal
57115739 } ) ;
57125740 model . setDirty ( ks . concat ( index ) ) ;
57135741 // notify any dependencies as well
5714- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5742+ if ( HAS . call ( ideps , dottedKey ) )
5743+ {
5744+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5745+ model . notify ( ideps [ dottedKey ] ) ;
5746+ }
57155747 }
57165748 if ( model . $atom && dottedKey === model . $atom ) model . atomic = true ;
57175749 }
@@ -5745,7 +5777,11 @@ model.[ins|insert]( String dottedKey, * val, Number index [, Boolean publish=fal
57455777 } ) ;
57465778 model . setDirty ( ks . concat ( index ) ) ;
57475779 // notify any dependencies as well
5748- if ( HAS . call ( ideps , dottedKey ) ) model . notify ( ideps [ dottedKey ] ) ;
5780+ if ( HAS . call ( ideps , dottedKey ) )
5781+ {
5782+ ideps [ dottedKey ] . forEach ( function ( kk ) { model . setDirty ( kk . split ( '.' ) ) ; } ) ;
5783+ model . notify ( ideps [ dottedKey ] ) ;
5784+ }
57495785 }
57505786 if ( model . $atom && dottedKey === model . $atom ) model . atomic = true ;
57515787 }
@@ -8395,7 +8431,7 @@ console.log(viewText.render());
83958431// export it
83968432var ModelView = {
83978433
8398- VERSION : "4.0.2 "
8434+ VERSION : "4.0.3 "
83998435
84008436 , UUID : uuid
84018437
0 commit comments