11/**
22*
33* ModelView.js
4- * @version : 5.0.0
5- * @built on 2022-03-30 11:03:44
4+ * @version : 5.0.1
5+ * @built on 2022-04-09 14:29:23
66*
77* A simple, light-weight, versatile and fast isomorphic MVVM JavaScript framework (Browser and Server)
88* https://github.com/foo123/modelview.js
99*
1010**/ /**
1111*
1212* ModelView.js
13- * @version : 5.0.0
14- * @built on 2022-03-30 11:03:44
13+ * @version : 5.0.1
14+ * @built on 2022-04-09 14:29:23
1515*
1616* A simple, light-weight, versatile and fast isomorphic MVVM JavaScript framework (Browser and Server)
1717* https://github.com/foo123/modelview.js
@@ -36,7 +36,7 @@ var HASDOC = ('undefined' !== typeof window) && ('undefined' !== typeof document
3636/**[DOC_MARKDOWN]
3737### ModelView API
3838
39- **Version 5.0.0 **
39+ **Version 5.0.1 **
4040
4141### Contents
4242
@@ -7663,9 +7663,9 @@ function clearInvalid(view)
76637663 if ( is_instance ( comp , MVComponentInstance ) )
76647664 {
76657665 COMP = view . $components [ '#' + comp . name ] ;
7666- if ( 2 === comp . status || ! is_child_of ( comp . dom , view . $renderdom , view . $renderdom ) )
7666+ if ( ( 2 === comp . status ) || ! is_child_of ( comp . dom , view . $renderdom , view . $renderdom ) )
76677667 {
7668- if ( 1 === comp . status )
7668+ if ( 1 === comp . status || 10 === comp . status )
76697669 {
76707670 comp . status = 2 ;
76717671 if ( comp . dom && COMP && COMP . opts && 'function' === typeof COMP . opts . detached )
@@ -7683,6 +7683,12 @@ function clearInvalid(view)
76837683 if ( comp . dom && COMP && COMP . opts && 'function' === typeof COMP . opts . attached )
76847684 COMP . opts . attached . call ( comp , comp ) ;
76857685 }
7686+ else if ( 10 === comp . status )
7687+ {
7688+ comp . status = 1 ;
7689+ if ( comp . dom && COMP && COMP . opts && 'function' === typeof COMP . opts . updated )
7690+ COMP . opts . updated . call ( comp , comp ) ;
7691+ }
76867692 }
76877693 }
76887694 } ) ;
@@ -8116,6 +8122,9 @@ view.components( Object components );
81168122 out . component = component ;
81178123 out . changed = changed ;
81188124 out . simple = false ; // components are not simple nodes
8125+ // set component.status to updated
8126+ if ( changed && ( 1 === component . status ) ) component . status = 10 ;
8127+ else if ( ! changed && ( 10 === component . status ) ) component . status = 1 ;
81198128 return out ;
81208129 }
81218130 }
@@ -9148,8 +9157,9 @@ var MyComponent = ModelView.View.Component(
91489157 String name,
91499158 String htmlTpl [,
91509159 Object options = {
9151- attached: (componentInstance) => {} // component attached to DOM, for componentInstance see below
9152- ,detached: (componentInstance) => {} // component detached from DOM, for componentInstance see below
9160+ attached: (componentInstance) => {} // component has been attached to DOM, for componentInstance see below
9161+ ,updated: (componentInstance) => {} // component has been updated, for componentInstance see below
9162+ ,detached: (componentInstance) => {} // component has been detached from DOM, for componentInstance see below
91539163 ,changed: (oldData, newData, componentInstance) => false // whether component has changed given new data
91549164 ,model: () => ({clicks:0}) // initial state model data, if state model is to be used, else null
91559165 ,actions: {
@@ -9342,7 +9352,7 @@ console.log(viewText.render());
93429352// export it
93439353var ModelView = {
93449354
9345- VERSION : "5.0.0 "
9355+ VERSION : "5.0.1 "
93469356
93479357 , UUID : uuid
93489358
0 commit comments