@@ -31,7 +31,7 @@ define([
3131class Frame extends PopupComponent {
3232_init ( ) {
3333super . _init ( ) ;
34- this . config . sizeLevel = 4 ;
34+ this . config . sizeLevel = 5 ;
3535this . config . checkModules = [ 'pd' ] ;
3636
3737// state
@@ -788,6 +788,7 @@ define([
788788if ( tab === 'apply' ) {
789789let colName = $ ( that . wrapSelector ( '.vp-inner-popup-apply-column option:selected' ) ) . text ( ) ;
790790$ ( that . wrapSelector ( '.vp-inner-popup-apply-target-name' ) ) . text ( colName ) ;
791+ $ ( that . wrapSelector ( '.vp-inner-popup-apply-column' ) ) . trigger ( 'change' ) ;
791792}
792793} ) ;
793794
@@ -828,6 +829,7 @@ define([
828829if ( tab === 'apply' ) {
829830let colName = $ ( that . wrapSelector ( '.vp-inner-popup-apply-column option:selected' ) ) . text ( ) ;
830831$ ( that . wrapSelector ( '.vp-inner-popup-apply-target-name' ) ) . text ( colName ) ;
832+ $ ( that . wrapSelector ( '.vp-inner-popup-apply-column' ) ) . trigger ( 'change' ) ;
831833}
832834} ) ;
833835}
@@ -943,10 +945,10 @@ define([
943945$ ( that . wrapSelector ( '.vp-inner-popup-apply-cond-usetext' ) ) . prop ( 'checked' , false ) ;
944946}
945947$ ( operTag ) . replaceWith ( function ( ) {
946- return that . templateForConditionOperator ( colDtype , 'vp-inner-popup-apply-oper-list' ) ;
948+ return that . templateForConditionOperator ( colDtype , 'vp-inner-popup-apply-oper-list' , $ ( this ) . val ( ) ) ;
947949} ) ;
948950$ ( condTag ) . replaceWith ( function ( ) {
949- return that . templateForConditionCondInput ( category , colDtype , 'vp-inner-popup-apply-condition' ) ;
951+ return that . templateForConditionCondInput ( category , colDtype , 'vp-inner-popup-apply-condition' , $ ( this ) . val ( ) ) ;
950952} ) ;
951953} catch {
952954$ ( that . wrapSelector ( '.vp-inner-popup-apply-cond-usetext' ) ) . prop ( 'checked' , false ) ;
@@ -981,6 +983,7 @@ define([
981983$ ( this . wrapSelector ( '.vp-inner-popup-add-case' ) ) . on ( 'click' , function ( ) {
982984// add case
983985$ ( this ) . parent ( ) . find ( '.vp-inner-popup-apply-case-box' ) . append ( $ ( that . templateForApplyCase ( ) ) ) ;
986+ $ ( that . wrapSelector ( '.vp-inner-popup-apply-column' ) ) . trigger ( 'change' ) ;
984987} ) ;
985988
986989$ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-inner-popup-apply-add-cond' ) ) ;
@@ -989,6 +992,7 @@ define([
989992$ ( this ) . parent ( ) . find ( '.vp-inner-popup-apply-cond-box' ) . append ( $ ( that . templateForApplyCondition ( ) ) ) ;
990993// show operator except last operator
991994$ ( this ) . parent ( ) . find ( '.vp-inner-popup-apply-oper-connect:not(:last)' ) . show ( ) ;
995+ $ ( that . wrapSelector ( '.vp-inner-popup-apply-column' ) ) . trigger ( 'change' ) ;
992996} ) ;
993997
994998$ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-inner-popup-apply-del-cond' ) ) ;
@@ -1538,12 +1542,12 @@ define([
15381542// content.appendFormatLine('<textarea type="text" id="{0}" class="{1}" placeholder="{2}">lambda x: x</textarea>'
15391543// , 'vp_popupAddApply', 'vp-input vp-inner-popup-apply-lambda', 'Type code manually');
15401544// render condition
1541- content . appendLine ( '<div>' ) ;
1545+ content . appendLine ( '<div>' ) ;
15421546content . appendFormatLine ( '<div class="{0}">' , 'vp-inner-popup-apply-case-box' ) ;
15431547content . appendLine ( this . templateForApplyCase ( ) ) ;
15441548content . appendLine ( '</div>' ) ;
1545- content . appendFormatLine ( '<button class="vp-button {0}">+ Case</button>' , 'vp-inner-popup-add-case' ) ;
15461549content . appendLine ( '</div>' ) ;
1550+ content . appendFormatLine ( '<button class="vp-button {0}">+ Case</button>' , 'vp-inner-popup-add-case' ) ;
15471551content . appendLine ( '<div class="vp-grid-col-120">' ) ;
15481552// else on/off
15491553content . appendFormatLine ( '<button class="vp-button {0}" data-else="off">Else On</button>' , 'vp-inner-popup-toggle-else' ) ;
@@ -2034,7 +2038,7 @@ define([
20342038return content . toString ( ) ;
20352039}
20362040
2037- templateForConditionOperator ( dtype = 'object' , className = 'vp-inner-popup-oper-list' ) {
2041+ templateForConditionOperator ( dtype = 'object' , className = 'vp-inner-popup-oper-list' , prevValue = '' ) {
20382042var content = new com_String ( ) ;
20392043content . appendFormatLine ( '<select class="{0} {1}">' , 'vp-select s' , className ) ;
20402044var operList = [ '' , '==' , '!=' , '<' , '<=' , '>' , '>=' , 'contains' , 'not contains' , 'starts with' , 'ends with' , 'isnull()' , 'notnull()' ] ;
@@ -2045,16 +2049,22 @@ define([
20452049operList = [ '' , '==' , '!=' , '<' , '<=' , '>' , '>=' , 'isnull()' , 'notnull()' ] ;
20462050}
20472051operList . forEach ( oper => {
2048- content . appendFormatLine ( '<option value="{0}">{1}</option>' , oper , oper ) ;
2052+ if ( oper === prevValue ) {
2053+ content . appendFormatLine ( '<option value="{0}" selected>{1}</option>' , oper , oper ) ;
2054+ } else {
2055+ content . appendFormatLine ( '<option value="{0}">{1}</option>' , oper , oper ) ;
2056+ }
20492057} ) ;
20502058content . appendLine ( '</select>' ) ;
20512059return content . toString ( ) ;
20522060}
20532061
2054- templateForConditionCondInput ( category , dtype = 'object' , className = 'vp-inner-popup-condition' ) {
2062+ templateForConditionCondInput ( category , dtype = 'object' , className = 'vp-inner-popup-condition' , prevValue = '' ) {
20552063var vpCondSuggest = new SuggestInput ( ) ;
20562064vpCondSuggest . addClass ( 'vp-input m ' + className ) ;
2057-
2065+ if ( prevValue !== '' ) {
2066+ vpCondSuggest . setValue ( prevValue ) ;
2067+ }
20582068if ( category && category . length > 0 ) {
20592069vpCondSuggest . setPlaceholder ( ( dtype == 'object' ?'Categorical' :dtype ) + " dtype" ) ;
20602070vpCondSuggest . setSuggestList ( function ( ) { return category ; } ) ;
@@ -3405,8 +3415,9 @@ define([
34053415code . appendLine ( codeStr ) ;
34063416code . appendFormat ( "{0}.iloc[{1}:{2}].to_json(orient='{3}')" , tempObj , prevLines , lines , 'split' ) ;
34073417
3418+
34083419this . loading = true ;
3409- vpKernel . execute ( code . toString ( ) ) . then ( function ( resultObj ) {
3420+ vpKernel . execute ( com_util . ignoreWarning ( code . toString ( ) ) ) . then ( function ( resultObj ) {
34103421let { result} = resultObj ;
34113422try {
34123423if ( ! result || result . length <= 0 ) {
@@ -3604,7 +3615,7 @@ define([
36043615vpLog . display ( VP_LOG_TYPE . ERROR , result . ename + ': ' + result . evalue , msg , code . toString ( ) ) ;
36053616if ( that . isHidden ( ) == false ) {
36063617// show alert modal only if this popup is visible
3607- com_util . renderAlertModal ( result . ename + ': ' + result . evalue ) ;
3618+ com_util . renderAlertModal ( result . ename + ': ' + result . evalue , { content : code . toString ( ) , type : 'code' } ) ;
36083619}
36093620that . loading = false ;
36103621} ) ;