@@ -318,8 +318,8 @@ var FunctionNode = /** @class */ (function (_super) {
318318 FunctionNode . prototype . dependValues = function ( ) {
319319 return this . child . dependValues ( ) ;
320320 } ;
321- FunctionNode . prototype . fetchInfo = function ( exposingNodes ) {
322- return this . child . fetchInfo ( exposingNodes ) ;
321+ FunctionNode . prototype . fetchInfo = function ( exposingNodes , options ) {
322+ return this . child . fetchInfo ( exposingNodes , options ) ;
323323 } ;
324324 __decorate ( [
325325 memoized ( )
@@ -390,12 +390,12 @@ var RecordNode = /** @class */ (function (_super) {
390390 } ) ;
391391 return ret ;
392392 } ;
393- RecordNode . prototype . fetchInfo = function ( exposingNodes ) {
393+ RecordNode . prototype . fetchInfo = function ( exposingNodes , options ) {
394394 var isFetching = false ;
395395 var ready = true ;
396396 Object . entries ( this . children ) . forEach ( function ( _a ) {
397397 _a [ 0 ] ; var child = _a [ 1 ] ;
398- var fi = child . fetchInfo ( exposingNodes ) ;
398+ var fi = child . fetchInfo ( exposingNodes , options ) ;
399399 isFetching = fi . isFetching || isFetching ;
400400 ready = fi . ready && ready ;
401401 } ) ;
@@ -1552,6 +1552,7 @@ function string2Fn(unevaledValue, type, methods) {
15521552
15531553var IS_FETCHING_FIELD = "isFetching" ;
15541554var LATEST_END_TIME_FIELD = "latestEndTime" ;
1555+ var TRIGGER_TYPE_FIELD = "triggerType" ;
15551556/**
15561557 * user input node
15571558 *
@@ -1662,7 +1663,7 @@ var CodeNode = /** @class */ (function (_super) {
16621663 } ) ;
16631664 return ret ;
16641665 } ;
1665- CodeNode . prototype . fetchInfo = function ( exposingNodes ) {
1666+ CodeNode . prototype . fetchInfo = function ( exposingNodes , options ) {
16661667 if ( ! ! this . evalCache . inIsFetching ) {
16671668 return {
16681669 isFetching : false ,
@@ -1676,6 +1677,11 @@ var CodeNode = /** @class */ (function (_super) {
16761677 var ready_1 = true ;
16771678 topDepends . forEach ( function ( paths , depend ) {
16781679 var value = depend . evaluate ( exposingNodes ) ;
1680+ if ( ( options === null || options === void 0 ? void 0 : options . ignoreManualDepReadyStatus ) &&
1681+ ___default [ "default" ] . has ( value , TRIGGER_TYPE_FIELD ) &&
1682+ value . triggerType === "manual" ) {
1683+ return ;
1684+ }
16791685 if ( ___default [ "default" ] . has ( value , IS_FETCHING_FIELD ) ) {
16801686 isFetching_1 = isFetching_1 || value . isFetching === true ;
16811687 }
@@ -1685,7 +1691,7 @@ var CodeNode = /** @class */ (function (_super) {
16851691 } ) ;
16861692 var dependingNodeMap = this . filterNodes ( exposingNodes ) ;
16871693 dependingNodeMap . forEach ( function ( paths , depend ) {
1688- var fi = depend . fetchInfo ( exposingNodes ) ;
1694+ var fi = depend . fetchInfo ( exposingNodes , options ) ;
16891695 isFetching_1 = isFetching_1 || fi . isFetching ;
16901696 ready_1 = ready_1 && fi . ready ;
16911697 } ) ;
@@ -1727,9 +1733,10 @@ function fixCyclic(extra, exposingNodes) {
17271733 */
17281734var FetchCheckNode = /** @class */ ( function ( _super ) {
17291735 __extends ( FetchCheckNode , _super ) ;
1730- function FetchCheckNode ( child ) {
1736+ function FetchCheckNode ( child , options ) {
17311737 var _this = _super . call ( this ) || this ;
17321738 _this . child = child ;
1739+ _this . options = options ;
17331740 _this . type = "fetchCheck" ;
17341741 return _this ;
17351742 }
@@ -1746,7 +1753,7 @@ var FetchCheckNode = /** @class */ (function (_super) {
17461753 return this . child . dependValues ( ) ;
17471754 } ;
17481755 FetchCheckNode . prototype . fetchInfo = function ( exposingNodes ) {
1749- return this . child . fetchInfo ( exposingNodes ) ;
1756+ return this . child . fetchInfo ( exposingNodes , this . options ) ;
17501757 } ;
17511758 __decorate ( [
17521759 memoized ( )
@@ -3322,6 +3329,7 @@ var MultiBaseComp = /** @class */ (function (_super) {
33223329 __extends ( MultiBaseComp , _super ) ;
33233330 function MultiBaseComp ( params ) {
33243331 var _this = _super . call ( this , params ) || this ;
3332+ _this . IGNORABLE_DEFAULT_VALUE = { } ;
33253333 _this . children = _this . parseChildrenFromValue ( params ) ;
33263334 return _this ;
33273335 }
@@ -3465,16 +3473,24 @@ var MultiBaseComp = /** @class */ (function (_super) {
34653473 } ) ;
34663474 return _super . prototype . changeDispatch . call ( this , dispatch ) . setChildren ( newChildren , { keepCacheKeys : [ "node" ] } ) ;
34673475 } ;
3476+ MultiBaseComp . prototype . ignoreChildDefaultValue = function ( ) {
3477+ return false ;
3478+ } ;
34683479 MultiBaseComp . prototype . toJsonValue = function ( ) {
34693480 var _this = this ;
34703481 var result = { } ;
3482+ var ignore = this . ignoreChildDefaultValue ( ) ;
34713483 Object . keys ( this . children ) . forEach ( function ( key ) {
34723484 var comp = _this . children [ key ] ;
34733485 // FIXME: this implementation is a little tricky, better choose a encapsulated implementation
34743486 if ( comp . hasOwnProperty ( "NO_PERSISTENCE" ) ) {
34753487 return ;
34763488 }
3477- result [ key ] = comp . toJsonValue ( ) ;
3489+ var value = comp . toJsonValue ( ) ;
3490+ if ( ignore && ___default [ "default" ] . isEqual ( value , comp [ "IGNORABLE_DEFAULT_VALUE" ] ) ) {
3491+ return ;
3492+ }
3493+ result [ key ] = value ;
34783494 } ) ;
34793495 return result ;
34803496 } ;
@@ -7484,10 +7500,14 @@ var Translator = /** @class */ (function () {
74847500 this . messages = Object . assign ( { } , data , globalMessages ) ;
74857501 this . language = language ;
74867502 this . trans = this . trans . bind ( this ) ;
7503+ this . transToNode = this . transToNode . bind ( this ) ;
74877504 }
74887505 Translator . prototype . trans = function ( key , variables ) {
7506+ return this . transToNode ( key , variables ) . toString ( ) ;
7507+ } ;
7508+ Translator . prototype . transToNode = function ( key , variables ) {
74897509 var message = this . getMessage ( key ) ;
7490- return new IntlMessageFormat ( message , i18n . locale ) . format ( variables ) . toString ( ) ;
7510+ return new IntlMessageFormat ( message , i18n . locale ) . format ( variables ) ;
74917511 } ;
74927512 Translator . prototype . getMessage = function ( key ) {
74937513 var value = this . messages [ key ] ;
0 commit comments