@wavemaker/app-runtime-wm-build 11.4.0-next.24562 → 11.4.0-next.24564
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +6 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +6 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +1 -1
|
@@ -200038,7 +200038,7 @@ window.requestAnimationFrame = function() {
|
|
|
200038
200038
|
reject(errMsg);
|
|
200039
200039
|
};
|
|
200040
200040
|
onCUDsuccess = function(data, resolve) {
|
|
200041
|
-
var response = data.body;
|
|
200041
|
+
var response = data.body || data.data;
|
|
200042
200042
|
var advancedOptions = _this.prepareCallbackOptions(data);
|
|
200043
200043
|
_util_inflight_queue__WEBPACK_IMPORTED_MODULE_4__.$queue.process(variable);
|
|
200044
200044
|
if (response && response.error) {
|
|
@@ -4275,7 +4275,7 @@ i.version="2.29.4",o(Zn),i.fn=lo,i.min=er,i.max=tr,i.now=nr,i.utc=m,i.unix=co,i.
|
|
|
4275
4275
|
/*!*******************************************************!*\
|
|
4276
4276
|
!*** ./src/manager/variable/live-variable.manager.ts ***!
|
|
4277
4277
|
\*******************************************************/
|
|
4278
|
-
(e,t,n)=>{"use strict";n.r(t),n.d(t,{LiveVariableManager:()=>v});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),a=n(/*! ./../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),s=n(/*! ../../util/variable/live-variable.utils */"./src/util/variable/live-variable.utils.ts"),u=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),l=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),c=n(/*! ../../util/variable/live-variable.http.utils */"./src/util/variable/live-variable.http.utils.ts"),d=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),p=n(/*! lodash */"./node_modules/lodash/lodash.js"),h=n.n(p),f=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),m=[],v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getFilterExprFields=function(e){var t=!1;return s.LiveVariableUtils.traverseFilterExpressions(e,(function(e,n){if(n&&n.required&&-1===h().indexOf(["null","isnotnull","empty","isnotempty","nullorempty"],n.matchMode)&&""===n.value)return t=!0,!1})),t?!t:e},t.getDataFilterObj=function(e){return t=e,{getFilterFields:function(){return t},getCriteria:function(e){var n=[];return s.LiveVariableUtils.traverseFilterExpressions(t,(function(t,r){e===r.target&&n.push(r)})),n}};var t},t}return f(t,e),t.prototype.initFilterExpressionBinding=function(e){var t=e._context;t.registerDestroyListener?t.registerDestroyListener.bind(t):h().noop},t.prototype.updateDataset=function(e,t,n,r){e.pagination=r,e.dataSet=t,Object.defineProperty(e.dataSet,"data",{get:function(){return e.dataSet}}),Object.defineProperty(e.dataSet,"pagination",{get:function(){return e.pagination}})},t.prototype.setVariableOptions=function(e,t){e._options=e._options||{},e._options.orderBy=t&&t.orderBy,e._options.filterFields=t&&t.filterFields,e._options.logicalOp=t&&t.logicalOp},t.prototype.handleError=function(e,t,n,r,o){var s;(0,i.triggerFn)(t,n),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,e,n,o),r.skipDataSetUpdate||this.updateDataset(e,m,e.propertiesMap,null),s=this.prepareCallbackOptions(r.errorDetails),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,n,s),e.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,n,o)},t.prototype.makeCall=function(e,t,n){var r=this;return new Promise((function(i,o){var s=(0,c.generateConnectionParams)(n,t);s={url:s.url,method:s.method,data:s.data,headers:s.headers},n.operation=t,r.httpCall(s,e,n).then((function(e){!function(e,t){(e&&e.type||e&&e.status)&&t(e)}(e,i)}),(function(t){!function(t,n){var i=(0,a.getErrMessage)(t,e.httpService.getLocale());r.notifyInflight(e,!1),n({error:i,details:t})}(t,o)}))}))},t.prototype.getEntityData=function(e,t,n,r){var o,c,p,f,m,v,g,y,_,b=this,w={};m=this.getFilterExprFields((0,i.getClonedObject)(e.filterExpressions||{})),p=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,this.getDataFilterObj(m),t);var S=h().isObject(p)?(0,i.getClonedObject)(p):void 0;return!1===p?(u.$queue.process(e),(0,i.triggerFn)(r,"Call stopped from the event: "+l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE),Promise.reject("Call stopped from the event: "+l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE)):(e.canUpdate=!1,o=s.LiveVariableUtils.prepareTableOptions(e,t,h().isObject(p)?p:m),t.searchWithQuery?(c="searchTableDataWithQuery",v=o.query?"q="+o.query:""):(c=o.filter&&o.filter.length?"searchTableData":"readTableData",v=o.filter),g={projectID:l.$rootScope.project.id,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:e.type,page:t.page||1,size:t.pagesize||(l.CONSTANTS.isRunMode?e.maxResults||20:e.designMaxResults||20),sort:o.sort,data:v,filter:s.LiveVariableUtils.getWhereClauseGenerator(e,t,S),url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl},y=function(o,u){if(o&&(o.type||o.status)){o=o.body||o.data,w.data=o.content,w.pagination=h().omit(o,"content");var c=b.prepareCallbackOptions(o,{pagination:w.pagination});return o&&o.error||!o||!h().isArray(o.content)?(b.handleError(e,r,o.error,t,c),Promise.reject(o.error)):((0,a.decodeData)(o.content),s.LiveVariableUtils.processBlobColumns(o.content,e),t.skipDataSetUpdate||((0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,e,w.data,c),(f=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,e,w.data,c))&&(w.data=f),b.updateDataset(e,w.data,e.propertiesMap,w.pagination),b.setVariableOptions(e,t),e.notify(d.VariableEvents.AFTER_INVOKE,[b,w.data]),setTimeout((function(){(0,i.triggerFn)(n,w.data,e.propertiesMap,w.pagination),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,w.data,c),e.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,w.data,c)}))),u({data:w.data,pagination:w.pagination}))}},_=function(n,i){return b.setVariableOptions(e,t),b.handleError(e,r,n.error,h().extend(t,{errorDetails:n.details})),i(n.error)},new Promise((function(t,n){b.makeCall(e,c,g).then((function(e){y(e,t)}),(function(e){_(e,n)}))})))},t.prototype.performCUD=function(e,t,n,r,o){var a=this;return(n=n||{}).inputFields=n.inputFields||(0,i.getClonedObject)(t.inputFields),u.$queue.submit(t).then((function(){return a.notifyInflight(t,!n.skipToggleState),a.doCUD(e,t,n,r,o).then((function(e){return u.$queue.process(t),a.notifyInflight(t,!1,e),Promise.resolve(e)}),(function(e){return u.$queue.process(t),a.notifyInflight(t,!1,e),Promise.reject(e)}))}),o)},t.prototype.doCUD=function(e,t,n,r,o){var c,p,f,m,v,g,y,_,b=this,w=l.$rootScope.project.id||l.$rootScope.projectName,S=s.LiveVariableUtils.getPrimaryKey(t),x=window.File&&window.FileReader&&window.FileList&&window.Blob,E="",k={},T={},C={},M=n.inputFields||t.inputFields;if(v=(0,i.getClonedObject)(M),!1===(g=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,t,v,n)))return(0,i.triggerFn)(o),Promise.reject("Call stopped from the event: "+l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE);switch(M=h().isObject(g)?g:v,t.canUpdate=!1,n.row?(k=n.row,h().forEach(k,(function(e,n){var r,o=s.LiveVariableUtils.getFieldType(n,t);(0,i.isDateTimeType)(o)?(r=(0,a.formatDate)(e,o),k[n]=r):h().isArray(e)&&s.LiveVariableUtils.isStringType(o)&&(r=h().join(e,","),k[n]=r)})),h().forEach(M,(function(e,t){!(0,i.isDefined)(e)||""===e||(0,i.isDefined)(k[t])&&""!==k[t]||(k[t]=e)}))):h().forEach(M,(function(n,r){var o,u=t.propertiesMap.primaryFields||t.propertiesMap.primaryKeys;h().isUndefined(n)||""===n||("deleteTableData"===e&&(E=n),"updateTableData"===e&&u.forEach((function(e){r===e&&(E=n)})),("deleteTableData"!==e||s.LiveVariableUtils.isCompositeKey(S))&&(o=s.LiveVariableUtils.getFieldType(r,t),(0,i.isDateTimeType)(o)?n=(0,a.formatDate)(n,o):h().isArray(n)&&s.LiveVariableUtils.isStringType(o)&&(n=h().join(n,",")),k[r]=n),h().isObject(n)&&!h().isArray(n)&&h().forEach(n,(function(e,i){"blob"===s.LiveVariableUtils.getFieldType(r,t,i)&&(n[i]=null===e?e:"")})))})),e){case"updateTableData":p=n.prevData||{},s.LiveVariableUtils.isCompositeKey(S)?(s.LiveVariableUtils.isNoPrimaryKey(S)?(C=p||n.rowData||k,T=k):S.forEach((function(e){T[e]=k[e],n.period?C[e]=k[e]:C[e]=p[e]||n.rowData&&n.rowData[e]||k[e]})),n.row=T,n.compositeKeysData=C):(S.forEach((function(e){-1===e.indexOf(".")?f=p[e]||n.rowData&&n.rowData[e]||k[e]:(m=e.split("."),f=p[m[0]][m[1]])})),n.id=f,n.row=k);break;case"deleteTableData":s.LiveVariableUtils.isCompositeKey(S)?(s.LiveVariableUtils.isNoPrimaryKey(S)?T=k:S.forEach((function(e){T[e]=k[e]})),n.compositeKeysData=T):h().isEmpty(k)||(S.forEach((function(e){-1===e.indexOf(".")?f=k[e]:(m=e.split("."),f=k[m[0]][m[1]])})),n.id=f)}if(("updateTableData"===e||"insertTableData"===e)&&s.LiveVariableUtils.hasBlob(t)&&x&&(e="updateTableData"===e?"updateMultiPartTableData":"insertMultiPartTableData",k=s.LiveVariableUtils.prepareFormData(t,k)),n.compositeKeysData){switch(e){case"updateTableData":e="updateCompositeTableData";break;case"deleteTableData":e="deleteCompositeTableData";break;case"updateMultiPartTableData":e="updateMultiPartCompositeTableData"}E=s.LiveVariableUtils.getCompositeIDURL(n.compositeKeysData)}c=t.liveSource,h().isEmpty(k)&&"deleteTableData"===e&&(k=void 0),"updateCompositeTableData"!==e&&"deleteCompositeTableData"!==e||!n.period||(e="period"+e.charAt(0).toUpperCase()+e.substr(1));var D={projectID:w,service:t._prefabName?"":"services",dataModelName:c,entityName:t.type,id:h().isUndefined(n.id)?E:encodeURIComponent(n.id),data:k,url:t._prefabName?l.$rootScope.project.deployedUrl+"/prefabs/"+t._prefabName:l.$rootScope.project.deployedUrl};return y=function(e,r){var s=e.error,u=b.prepareCallbackOptions(e);(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,s,u),n.skipNotification||(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,t,s,u),t.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,s,u),(0,i.triggerFn)(o,s),r(s)},_=function(e,n){var s=e.body,c=b.prepareCallbackOptions(e);if(u.$queue.process(t),s&&s.error)return(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,s,c),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,t,s.error,c),t.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,s.error,c),(0,i.triggerFn)(o,s.error),Promise.reject(s.error);if((0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,s,c),"read"!==t.operation){var p=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,s,c);p&&(s=p),t.dataSet=s}t.notify(d.VariableEvents.AFTER_INVOKE,[b,s]),setTimeout((function(){(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,s,c),t.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,s,c)})),(0,i.triggerFn)(r,s),n(s)},new Promise((function(n,r){b.makeCall(t,e,D).then((function(e){_(e,n)}),(function(e){y(e,r)}))}))},t.prototype.aggregateData=function(e,t,n,r,o){var a,u,l,c,d=this;return(n=n||{}).skipEncode=!0,t.filterFields&&(a=s.LiveVariableUtils.prepareTableOptions(t,n),n.aggregations.filter=a.query),u={dataModelName:t.liveSource,entityName:t.type,page:n.page||1,size:n.size||t.maxResults,sort:n.sort||"",url:e,data:n.aggregations},l=function(e,t){if(e&&e.type){if(e&&e.error||!e)return void(0,i.triggerFn)(o,e.error);(0,i.triggerFn)(r,e),t(e)}},c=function(e,t){(0,i.triggerFn)(o,e),t(e)},new Promise((function(e,n){d.makeCall(t,"executeAggregateQuery",u).then((function(t){l(t,e)}),(function(e){c(e,n)}))}))},t.prototype.listRecords=function(e,t,n,r){var o=this;return(t=t||{}).filterFields=t.filterFields||(0,i.getClonedObject)(e.filterFields),u.$queue.submit(e).then((function(){return o.notifyInflight(e,!t.skipToggleState,void 0,t),o.getEntityData(e,t,n,r).then((function(t){return u.$queue.process(e),o.notifyInflight(e,!1,t),Promise.resolve(t)}),(function(t){return u.$queue.process(e),o.notifyInflight(e,!1,t),Promise.reject(t)}))}),r)},t.prototype.insertRecord=function(e,t,n,r){return this.performCUD("insertTableData",e,t,n,r)},t.prototype.updateRecord=function(e,t,n,r){return this.performCUD("updateTableData",e,t,n,r)},t.prototype.deleteRecord=function(e,t,n,r){return this.performCUD("deleteTableData",e,t,n,r)},t.prototype.setInput=function(e,t,n,r){return e.inputFields=e.inputFields||{},(0,a.setInput)(e.inputFields,t,n,r)},t.prototype.setFilter=function(e,t,n){var r={},i={};return h().isObject(t)?r=t:r[t]=n,e.filterExpressions&&!h().isEmpty(e.filterExpressions)||(e.filterExpressions={condition:"AND",rules:[]}),i=e.filterExpressions,h().forEach(r,(function(e,t){var n=function(e){var t=null;return s.LiveVariableUtils.traverseFilterExpressions(i,(function(n,r){if(e===r.target)return t=r})),t}(t);null!==n?n.value=e:i.rules.push({target:t,type:"",matchMode:"",value:e,required:!1})})),i},t.prototype.download=function(e,t,n,r){var o,u,c,d,p=this;t=t||{};var h={},f=l.$rootScope.project.id||l.$rootScope.projectName;return t.data.searchWithQuery=!0,t.data.skipEncode=!0,o=s.LiveVariableUtils.prepareTableOptions(e,t.data,void 0),h.query=o.query?o.query:"",h.exportSize=t.data.exportSize,h.exportType=t.data.exportType,h.fields=(0,a.formatExportExpression)(t.data.fields),t.data.fileName&&(h.fileName=t.data.fileName),u={projectID:f,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:e.type,sort:o.sort,url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl,data:h,filter:s.LiveVariableUtils.getWhereClauseGenerator(e,t)},c=function(e,t){e&&e.type&&(window.location.href=e.body.result,(0,i.triggerFn)(n,e),t(e))},d=function(t,n){var o=p.prepareCallbackOptions(t.details);(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t.error,o),(0,i.triggerFn)(r,t.error),n(t)},new Promise((function(t,n){p.makeCall(e,"exportTableData",u).then((function(e){c(e,t)}),(function(e){d(e,n)}))}))},t.prototype.getRelatedTablePrimaryKeys=function(e,t){var n,r,i;if(e.propertiesMap&&(r=h().find(e.propertiesMap.columns||[],{fieldName:t}))){if(i=r.columns,(n=h().map(h().filter(i,"isPrimaryKey"),"fieldName")).length)return n;if(i&&i.length)return(i=h().find(i,{isRelated:!1}))&&i.fieldName}},t.prototype.getRelatedTableData=function(e,t,n,r,o){var u,c,d,p,f,m,v=this,g=l.$rootScope.project.id||l.$rootScope.projectName,y=h().find(e.relatedTables,(function(e){return e.relationName===t||e.columnName===t})),_=h().map(h().filter(e.relatedTables,(function(t){return t.type===e.type})),"relationName"),b=[];if(h().forEach(n.filterFields,(function(n,r){n.fieldName=r,n.type=s.LiveVariableUtils.getFieldType(t,e,r),n.filterCondition!==l.DB_CONSTANTS.DATABASE_MATCH_MODES.in.toLowerCase()&&n.filterCondition!==l.DB_CONSTANTS.DATABASE_MATCH_MODES.between.toLowerCase()||(n.value=n.value.split(",")),b.push(n)})),c=s.LiveVariableUtils.getFilterOptions(e,b,n),d=s.LiveVariableUtils.getSearchQuery(c," "+(n.logicalOp||"AND")+" ",e.ignoreCase),n.filterExpr){var w=(0,i.getClonedObject)(h().isObject(n.filterExpr)?n.filterExpr:JSON.parse(n.filterExpr));s.LiveVariableUtils.processFilterFields(w.rules,e,n);var S=s.LiveVariableUtils.generateSearchQuery(w.rules,w.condition,e.ignoreCase,n.skipEncode);""!==d?""!==S&&(d="("+d+") AND ("+S+")"):""!==S&&(d=S)}return d=d?"q="+d:"","searchTableDataWithQuery",u=h().isEmpty(n.orderBy)?"":"sort="+n.orderBy,p={projectID:g,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:y?y.type:"",page:n.page||1,size:n.pagesize||void 0,url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl,data:d||"",filter:s.LiveVariableUtils.getWhereClauseGenerator(e,n),sort:u},f=function(e,t){if(e&&(e.type||e.status)){var n=e.body||e.data,o=h().map(n.content,(function(e){return h().omit(e,_)})),s=Object.assign({},n);delete s.content,(0,a.decodeData)(o);var u={data:o,pagination:s};(0,i.triggerFn)(r,u),t(u)}},m=function(e,t){(0,i.triggerFn)(o,e),t(e)},new Promise((function(t,n){v.makeCall(e,"searchTableDataWithQuery",p).then((function(e){f(e,t)}),(function(e){m(e,n)}))}))},t.prototype.getDistinctDataByFields=function(e,t,n,r){var o,a,u,c,d,p=this,f=l.$rootScope.project.id||l.$rootScope.projectName,m={};return t.skipEncode=!0,t.operation="read",t=t||{},(a=s.LiveVariableUtils.prepareTableOptions(e,t)).query&&(m.filter=a.query),m.groupByFields=h().isArray(t.fields)?t.fields:[t.fields],o=(o=t.sort||m.groupByFields[0]+" asc")?"sort="+o:"",u={projectID:f,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:t.entityName||e.type,page:t.page||1,size:t.pagesize,sort:o,data:m,filter:s.LiveVariableUtils.getWhereClauseGenerator(e,t),url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl},c=function(e,t){if(e&&e.type){if(e&&e.error||!e)return(0,i.triggerFn)(r,e.error),Promise.reject(e.error);var o=e.body,a=Object.assign({},e.body);delete a.content,o={data:o.content,pagination:a},(0,i.triggerFn)(n,o),t(o)}},d=function(e,t){(0,i.triggerFn)(r,e),t(e)},new Promise((function(t,n){p.makeCall(e,"getDistinctDataByFields",u).then((function(e){c(e,t)}),(function(){d(r,n)}))}))},t.prototype.getAggregatedData=function(e,t,n,r){var i=a.appManager.getDeployedURL();if(i)return this.aggregateData(i,e,t,n,r)},t.prototype.defineFirstLastRecord=function(e){"read"===e.operation&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){return h().get(e.dataSet,"data[0]",{})}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=h().get(e.dataSet,"data",[]);return t[t.length-1]}}))},t.prototype.getPrimaryKey=function(e){return s.LiveVariableUtils.getPrimaryKey(e)},t.prototype.prepareRequestParams=function(e){var t,n=h().split(e.searchKey,","),r=h().split(e.matchMode,","),i={};return h().forEach(n,(function(t,n){i[t]={value:e.query,logicalOp:"AND",matchMode:r[n]||r[0]||"startignorecase"}})),t={filterFields:i,page:e.page,pagesize:e.limit||e.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",logicalOp:"OR",orderBy:e.orderby?h().replace(e.orderby,/:/g," "):""},e.onBeforeservicecall&&e.onBeforeservicecall(i),t},t.prototype.searchRecords=function(e,t,n,r){var i=this.prepareRequestParams(t);return this.listRecords(e,i,n,r)},t.prototype.upgradeInputDataToFilterExpressions=function(e,t,n){h().isObject(t)&&((n=t).condition="AND",n.rules=[]);var r=h().cloneDeep(n.rules);return n.rules=[],h().forEach(n,(function(e,t){if("condition"!==t&&"rules"!==t){var i=h().find(r,(function(e){return e.target===t}));i?(i.value=e.value,i.matchMode=e.matchMode||e.filterCondition||i.matchMode||"",n.rules.push(i)):n.rules.push({target:t,type:"",matchMode:e.matchMode||e.filterCondition||"",value:e.value,required:!1}),delete n[t]}})),n},t.prototype.downgradeFilterExpressionsToInputData=function(e,t){return t.hasOwnProperty("getFilterFields")&&(t=t.getFilterFields()),h().forEach(t.rules,(function(e){h().isNil(e.target)||""===e.target||(t[e.target]={value:e.value,matchMode:e.matchMode})})),t},t.prototype.cancel=function(e,t){u.$queue.requestsQueue.has(e)&&e._observable&&(e._observable.unsubscribe(),u.$queue.process(e),this.notifyInflight(e,!1))},t}(o.BaseVariableManager)},"./src/manager/variable/model-variable.manager.ts":
|
|
4278
|
+
(e,t,n)=>{"use strict";n.r(t),n.d(t,{LiveVariableManager:()=>v});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),a=n(/*! ./../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),s=n(/*! ../../util/variable/live-variable.utils */"./src/util/variable/live-variable.utils.ts"),u=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),l=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),c=n(/*! ../../util/variable/live-variable.http.utils */"./src/util/variable/live-variable.http.utils.ts"),d=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),p=n(/*! lodash */"./node_modules/lodash/lodash.js"),h=n.n(p),f=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),m=[],v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getFilterExprFields=function(e){var t=!1;return s.LiveVariableUtils.traverseFilterExpressions(e,(function(e,n){if(n&&n.required&&-1===h().indexOf(["null","isnotnull","empty","isnotempty","nullorempty"],n.matchMode)&&""===n.value)return t=!0,!1})),t?!t:e},t.getDataFilterObj=function(e){return t=e,{getFilterFields:function(){return t},getCriteria:function(e){var n=[];return s.LiveVariableUtils.traverseFilterExpressions(t,(function(t,r){e===r.target&&n.push(r)})),n}};var t},t}return f(t,e),t.prototype.initFilterExpressionBinding=function(e){var t=e._context;t.registerDestroyListener?t.registerDestroyListener.bind(t):h().noop},t.prototype.updateDataset=function(e,t,n,r){e.pagination=r,e.dataSet=t,Object.defineProperty(e.dataSet,"data",{get:function(){return e.dataSet}}),Object.defineProperty(e.dataSet,"pagination",{get:function(){return e.pagination}})},t.prototype.setVariableOptions=function(e,t){e._options=e._options||{},e._options.orderBy=t&&t.orderBy,e._options.filterFields=t&&t.filterFields,e._options.logicalOp=t&&t.logicalOp},t.prototype.handleError=function(e,t,n,r,o){var s;(0,i.triggerFn)(t,n),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,e,n,o),r.skipDataSetUpdate||this.updateDataset(e,m,e.propertiesMap,null),s=this.prepareCallbackOptions(r.errorDetails),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,n,s),e.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,n,o)},t.prototype.makeCall=function(e,t,n){var r=this;return new Promise((function(i,o){var s=(0,c.generateConnectionParams)(n,t);s={url:s.url,method:s.method,data:s.data,headers:s.headers},n.operation=t,r.httpCall(s,e,n).then((function(e){!function(e,t){(e&&e.type||e&&e.status)&&t(e)}(e,i)}),(function(t){!function(t,n){var i=(0,a.getErrMessage)(t,e.httpService.getLocale());r.notifyInflight(e,!1),n({error:i,details:t})}(t,o)}))}))},t.prototype.getEntityData=function(e,t,n,r){var o,c,p,f,m,v,g,y,_,b=this,w={};m=this.getFilterExprFields((0,i.getClonedObject)(e.filterExpressions||{})),p=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,this.getDataFilterObj(m),t);var S=h().isObject(p)?(0,i.getClonedObject)(p):void 0;return!1===p?(u.$queue.process(e),(0,i.triggerFn)(r,"Call stopped from the event: "+l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE),Promise.reject("Call stopped from the event: "+l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE)):(e.canUpdate=!1,o=s.LiveVariableUtils.prepareTableOptions(e,t,h().isObject(p)?p:m),t.searchWithQuery?(c="searchTableDataWithQuery",v=o.query?"q="+o.query:""):(c=o.filter&&o.filter.length?"searchTableData":"readTableData",v=o.filter),g={projectID:l.$rootScope.project.id,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:e.type,page:t.page||1,size:t.pagesize||(l.CONSTANTS.isRunMode?e.maxResults||20:e.designMaxResults||20),sort:o.sort,data:v,filter:s.LiveVariableUtils.getWhereClauseGenerator(e,t,S),url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl},y=function(o,u){if(o&&(o.type||o.status)){o=o.body||o.data,w.data=o.content,w.pagination=h().omit(o,"content");var c=b.prepareCallbackOptions(o,{pagination:w.pagination});return o&&o.error||!o||!h().isArray(o.content)?(b.handleError(e,r,o.error,t,c),Promise.reject(o.error)):((0,a.decodeData)(o.content),s.LiveVariableUtils.processBlobColumns(o.content,e),t.skipDataSetUpdate||((0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,e,w.data,c),(f=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,e,w.data,c))&&(w.data=f),b.updateDataset(e,w.data,e.propertiesMap,w.pagination),b.setVariableOptions(e,t),e.notify(d.VariableEvents.AFTER_INVOKE,[b,w.data]),setTimeout((function(){(0,i.triggerFn)(n,w.data,e.propertiesMap,w.pagination),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,w.data,c),e.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,w.data,c)}))),u({data:w.data,pagination:w.pagination}))}},_=function(n,i){return b.setVariableOptions(e,t),b.handleError(e,r,n.error,h().extend(t,{errorDetails:n.details})),i(n.error)},new Promise((function(t,n){b.makeCall(e,c,g).then((function(e){y(e,t)}),(function(e){_(e,n)}))})))},t.prototype.performCUD=function(e,t,n,r,o){var a=this;return(n=n||{}).inputFields=n.inputFields||(0,i.getClonedObject)(t.inputFields),u.$queue.submit(t).then((function(){return a.notifyInflight(t,!n.skipToggleState),a.doCUD(e,t,n,r,o).then((function(e){return u.$queue.process(t),a.notifyInflight(t,!1,e),Promise.resolve(e)}),(function(e){return u.$queue.process(t),a.notifyInflight(t,!1,e),Promise.reject(e)}))}),o)},t.prototype.doCUD=function(e,t,n,r,o){var c,p,f,m,v,g,y,_,b=this,w=l.$rootScope.project.id||l.$rootScope.projectName,S=s.LiveVariableUtils.getPrimaryKey(t),x=window.File&&window.FileReader&&window.FileList&&window.Blob,E="",k={},T={},C={},M=n.inputFields||t.inputFields;if(v=(0,i.getClonedObject)(M),!1===(g=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,t,v,n)))return(0,i.triggerFn)(o),Promise.reject("Call stopped from the event: "+l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE);switch(M=h().isObject(g)?g:v,t.canUpdate=!1,n.row?(k=n.row,h().forEach(k,(function(e,n){var r,o=s.LiveVariableUtils.getFieldType(n,t);(0,i.isDateTimeType)(o)?(r=(0,a.formatDate)(e,o),k[n]=r):h().isArray(e)&&s.LiveVariableUtils.isStringType(o)&&(r=h().join(e,","),k[n]=r)})),h().forEach(M,(function(e,t){!(0,i.isDefined)(e)||""===e||(0,i.isDefined)(k[t])&&""!==k[t]||(k[t]=e)}))):h().forEach(M,(function(n,r){var o,u=t.propertiesMap.primaryFields||t.propertiesMap.primaryKeys;h().isUndefined(n)||""===n||("deleteTableData"===e&&(E=n),"updateTableData"===e&&u.forEach((function(e){r===e&&(E=n)})),("deleteTableData"!==e||s.LiveVariableUtils.isCompositeKey(S))&&(o=s.LiveVariableUtils.getFieldType(r,t),(0,i.isDateTimeType)(o)?n=(0,a.formatDate)(n,o):h().isArray(n)&&s.LiveVariableUtils.isStringType(o)&&(n=h().join(n,",")),k[r]=n),h().isObject(n)&&!h().isArray(n)&&h().forEach(n,(function(e,i){"blob"===s.LiveVariableUtils.getFieldType(r,t,i)&&(n[i]=null===e?e:"")})))})),e){case"updateTableData":p=n.prevData||{},s.LiveVariableUtils.isCompositeKey(S)?(s.LiveVariableUtils.isNoPrimaryKey(S)?(C=p||n.rowData||k,T=k):S.forEach((function(e){T[e]=k[e],n.period?C[e]=k[e]:C[e]=p[e]||n.rowData&&n.rowData[e]||k[e]})),n.row=T,n.compositeKeysData=C):(S.forEach((function(e){-1===e.indexOf(".")?f=p[e]||n.rowData&&n.rowData[e]||k[e]:(m=e.split("."),f=p[m[0]][m[1]])})),n.id=f,n.row=k);break;case"deleteTableData":s.LiveVariableUtils.isCompositeKey(S)?(s.LiveVariableUtils.isNoPrimaryKey(S)?T=k:S.forEach((function(e){T[e]=k[e]})),n.compositeKeysData=T):h().isEmpty(k)||(S.forEach((function(e){-1===e.indexOf(".")?f=k[e]:(m=e.split("."),f=k[m[0]][m[1]])})),n.id=f)}if(("updateTableData"===e||"insertTableData"===e)&&s.LiveVariableUtils.hasBlob(t)&&x&&(e="updateTableData"===e?"updateMultiPartTableData":"insertMultiPartTableData",k=s.LiveVariableUtils.prepareFormData(t,k)),n.compositeKeysData){switch(e){case"updateTableData":e="updateCompositeTableData";break;case"deleteTableData":e="deleteCompositeTableData";break;case"updateMultiPartTableData":e="updateMultiPartCompositeTableData"}E=s.LiveVariableUtils.getCompositeIDURL(n.compositeKeysData)}c=t.liveSource,h().isEmpty(k)&&"deleteTableData"===e&&(k=void 0),"updateCompositeTableData"!==e&&"deleteCompositeTableData"!==e||!n.period||(e="period"+e.charAt(0).toUpperCase()+e.substr(1));var D={projectID:w,service:t._prefabName?"":"services",dataModelName:c,entityName:t.type,id:h().isUndefined(n.id)?E:encodeURIComponent(n.id),data:k,url:t._prefabName?l.$rootScope.project.deployedUrl+"/prefabs/"+t._prefabName:l.$rootScope.project.deployedUrl};return y=function(e,r){var s=e.error,u=b.prepareCallbackOptions(e);(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,s,u),n.skipNotification||(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,t,s,u),t.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,s,u),(0,i.triggerFn)(o,s),r(s)},_=function(e,n){var s=e.body||e.data,c=b.prepareCallbackOptions(e);if(u.$queue.process(t),s&&s.error)return(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,s,c),(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,t,s.error,c),t.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,s.error,c),(0,i.triggerFn)(o,s.error),Promise.reject(s.error);if((0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,s,c),"read"!==t.operation){var p=(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,s,c);p&&(s=p),t.dataSet=s}t.notify(d.VariableEvents.AFTER_INVOKE,[b,s]),setTimeout((function(){(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,s,c),t.canUpdate=!0,(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,s,c)})),(0,i.triggerFn)(r,s),n(s)},new Promise((function(n,r){b.makeCall(t,e,D).then((function(e){_(e,n)}),(function(e){y(e,r)}))}))},t.prototype.aggregateData=function(e,t,n,r,o){var a,u,l,c,d=this;return(n=n||{}).skipEncode=!0,t.filterFields&&(a=s.LiveVariableUtils.prepareTableOptions(t,n),n.aggregations.filter=a.query),u={dataModelName:t.liveSource,entityName:t.type,page:n.page||1,size:n.size||t.maxResults,sort:n.sort||"",url:e,data:n.aggregations},l=function(e,t){if(e&&e.type){if(e&&e.error||!e)return void(0,i.triggerFn)(o,e.error);(0,i.triggerFn)(r,e),t(e)}},c=function(e,t){(0,i.triggerFn)(o,e),t(e)},new Promise((function(e,n){d.makeCall(t,"executeAggregateQuery",u).then((function(t){l(t,e)}),(function(e){c(e,n)}))}))},t.prototype.listRecords=function(e,t,n,r){var o=this;return(t=t||{}).filterFields=t.filterFields||(0,i.getClonedObject)(e.filterFields),u.$queue.submit(e).then((function(){return o.notifyInflight(e,!t.skipToggleState,void 0,t),o.getEntityData(e,t,n,r).then((function(t){return u.$queue.process(e),o.notifyInflight(e,!1,t),Promise.resolve(t)}),(function(t){return u.$queue.process(e),o.notifyInflight(e,!1,t),Promise.reject(t)}))}),r)},t.prototype.insertRecord=function(e,t,n,r){return this.performCUD("insertTableData",e,t,n,r)},t.prototype.updateRecord=function(e,t,n,r){return this.performCUD("updateTableData",e,t,n,r)},t.prototype.deleteRecord=function(e,t,n,r){return this.performCUD("deleteTableData",e,t,n,r)},t.prototype.setInput=function(e,t,n,r){return e.inputFields=e.inputFields||{},(0,a.setInput)(e.inputFields,t,n,r)},t.prototype.setFilter=function(e,t,n){var r={},i={};return h().isObject(t)?r=t:r[t]=n,e.filterExpressions&&!h().isEmpty(e.filterExpressions)||(e.filterExpressions={condition:"AND",rules:[]}),i=e.filterExpressions,h().forEach(r,(function(e,t){var n=function(e){var t=null;return s.LiveVariableUtils.traverseFilterExpressions(i,(function(n,r){if(e===r.target)return t=r})),t}(t);null!==n?n.value=e:i.rules.push({target:t,type:"",matchMode:"",value:e,required:!1})})),i},t.prototype.download=function(e,t,n,r){var o,u,c,d,p=this;t=t||{};var h={},f=l.$rootScope.project.id||l.$rootScope.projectName;return t.data.searchWithQuery=!0,t.data.skipEncode=!0,o=s.LiveVariableUtils.prepareTableOptions(e,t.data,void 0),h.query=o.query?o.query:"",h.exportSize=t.data.exportSize,h.exportType=t.data.exportType,h.fields=(0,a.formatExportExpression)(t.data.fields),t.data.fileName&&(h.fileName=t.data.fileName),u={projectID:f,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:e.type,sort:o.sort,url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl,data:h,filter:s.LiveVariableUtils.getWhereClauseGenerator(e,t)},c=function(e,t){e&&e.type&&(window.location.href=e.body.result,(0,i.triggerFn)(n,e),t(e))},d=function(t,n){var o=p.prepareCallbackOptions(t.details);(0,a.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t.error,o),(0,i.triggerFn)(r,t.error),n(t)},new Promise((function(t,n){p.makeCall(e,"exportTableData",u).then((function(e){c(e,t)}),(function(e){d(e,n)}))}))},t.prototype.getRelatedTablePrimaryKeys=function(e,t){var n,r,i;if(e.propertiesMap&&(r=h().find(e.propertiesMap.columns||[],{fieldName:t}))){if(i=r.columns,(n=h().map(h().filter(i,"isPrimaryKey"),"fieldName")).length)return n;if(i&&i.length)return(i=h().find(i,{isRelated:!1}))&&i.fieldName}},t.prototype.getRelatedTableData=function(e,t,n,r,o){var u,c,d,p,f,m,v=this,g=l.$rootScope.project.id||l.$rootScope.projectName,y=h().find(e.relatedTables,(function(e){return e.relationName===t||e.columnName===t})),_=h().map(h().filter(e.relatedTables,(function(t){return t.type===e.type})),"relationName"),b=[];if(h().forEach(n.filterFields,(function(n,r){n.fieldName=r,n.type=s.LiveVariableUtils.getFieldType(t,e,r),n.filterCondition!==l.DB_CONSTANTS.DATABASE_MATCH_MODES.in.toLowerCase()&&n.filterCondition!==l.DB_CONSTANTS.DATABASE_MATCH_MODES.between.toLowerCase()||(n.value=n.value.split(",")),b.push(n)})),c=s.LiveVariableUtils.getFilterOptions(e,b,n),d=s.LiveVariableUtils.getSearchQuery(c," "+(n.logicalOp||"AND")+" ",e.ignoreCase),n.filterExpr){var w=(0,i.getClonedObject)(h().isObject(n.filterExpr)?n.filterExpr:JSON.parse(n.filterExpr));s.LiveVariableUtils.processFilterFields(w.rules,e,n);var S=s.LiveVariableUtils.generateSearchQuery(w.rules,w.condition,e.ignoreCase,n.skipEncode);""!==d?""!==S&&(d="("+d+") AND ("+S+")"):""!==S&&(d=S)}return d=d?"q="+d:"","searchTableDataWithQuery",u=h().isEmpty(n.orderBy)?"":"sort="+n.orderBy,p={projectID:g,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:y?y.type:"",page:n.page||1,size:n.pagesize||void 0,url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl,data:d||"",filter:s.LiveVariableUtils.getWhereClauseGenerator(e,n),sort:u},f=function(e,t){if(e&&(e.type||e.status)){var n=e.body||e.data,o=h().map(n.content,(function(e){return h().omit(e,_)})),s=Object.assign({},n);delete s.content,(0,a.decodeData)(o);var u={data:o,pagination:s};(0,i.triggerFn)(r,u),t(u)}},m=function(e,t){(0,i.triggerFn)(o,e),t(e)},new Promise((function(t,n){v.makeCall(e,"searchTableDataWithQuery",p).then((function(e){f(e,t)}),(function(e){m(e,n)}))}))},t.prototype.getDistinctDataByFields=function(e,t,n,r){var o,a,u,c,d,p=this,f=l.$rootScope.project.id||l.$rootScope.projectName,m={};return t.skipEncode=!0,t.operation="read",t=t||{},(a=s.LiveVariableUtils.prepareTableOptions(e,t)).query&&(m.filter=a.query),m.groupByFields=h().isArray(t.fields)?t.fields:[t.fields],o=(o=t.sort||m.groupByFields[0]+" asc")?"sort="+o:"",u={projectID:f,service:e.getPrefabName()?"":"services",dataModelName:e.liveSource,entityName:t.entityName||e.type,page:t.page||1,size:t.pagesize,sort:o,data:m,filter:s.LiveVariableUtils.getWhereClauseGenerator(e,t),url:e.getPrefabName()?l.$rootScope.project.deployedUrl+"/prefabs/"+e.getPrefabName():l.$rootScope.project.deployedUrl},c=function(e,t){if(e&&e.type){if(e&&e.error||!e)return(0,i.triggerFn)(r,e.error),Promise.reject(e.error);var o=e.body,a=Object.assign({},e.body);delete a.content,o={data:o.content,pagination:a},(0,i.triggerFn)(n,o),t(o)}},d=function(e,t){(0,i.triggerFn)(r,e),t(e)},new Promise((function(t,n){p.makeCall(e,"getDistinctDataByFields",u).then((function(e){c(e,t)}),(function(){d(r,n)}))}))},t.prototype.getAggregatedData=function(e,t,n,r){var i=a.appManager.getDeployedURL();if(i)return this.aggregateData(i,e,t,n,r)},t.prototype.defineFirstLastRecord=function(e){"read"===e.operation&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){return h().get(e.dataSet,"data[0]",{})}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=h().get(e.dataSet,"data",[]);return t[t.length-1]}}))},t.prototype.getPrimaryKey=function(e){return s.LiveVariableUtils.getPrimaryKey(e)},t.prototype.prepareRequestParams=function(e){var t,n=h().split(e.searchKey,","),r=h().split(e.matchMode,","),i={};return h().forEach(n,(function(t,n){i[t]={value:e.query,logicalOp:"AND",matchMode:r[n]||r[0]||"startignorecase"}})),t={filterFields:i,page:e.page,pagesize:e.limit||e.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",logicalOp:"OR",orderBy:e.orderby?h().replace(e.orderby,/:/g," "):""},e.onBeforeservicecall&&e.onBeforeservicecall(i),t},t.prototype.searchRecords=function(e,t,n,r){var i=this.prepareRequestParams(t);return this.listRecords(e,i,n,r)},t.prototype.upgradeInputDataToFilterExpressions=function(e,t,n){h().isObject(t)&&((n=t).condition="AND",n.rules=[]);var r=h().cloneDeep(n.rules);return n.rules=[],h().forEach(n,(function(e,t){if("condition"!==t&&"rules"!==t){var i=h().find(r,(function(e){return e.target===t}));i?(i.value=e.value,i.matchMode=e.matchMode||e.filterCondition||i.matchMode||"",n.rules.push(i)):n.rules.push({target:t,type:"",matchMode:e.matchMode||e.filterCondition||"",value:e.value,required:!1}),delete n[t]}})),n},t.prototype.downgradeFilterExpressionsToInputData=function(e,t){return t.hasOwnProperty("getFilterFields")&&(t=t.getFilterFields()),h().forEach(t.rules,(function(e){h().isNil(e.target)||""===e.target||(t[e.target]={value:e.value,matchMode:e.matchMode})})),t},t.prototype.cancel=function(e,t){u.$queue.requestsQueue.has(e)&&e._observable&&(e._observable.unsubscribe(),u.$queue.process(e),this.notifyInflight(e,!1))},t}(o.BaseVariableManager)},"./src/manager/variable/model-variable.manager.ts":
|
|
4279
4279
|
/*!********************************************************!*\
|
|
4280
4280
|
!*** ./src/manager/variable/model-variable.manager.ts ***!
|
|
4281
4281
|
\********************************************************/
|
|
@@ -5052,7 +5052,12 @@
|
|
|
5052
5052
|
fieldDefs = [];
|
|
5053
5053
|
parent.gridOptions.setCurrentPage(1);
|
|
5054
5054
|
}
|
|
5055
|
-
var currentPage
|
|
5055
|
+
var currentPage;
|
|
5056
|
+
if (parent.widgetType === "wm-table") {
|
|
5057
|
+
currentPage = parent.gridOptions.showviewlessbutton && parent.gridOptions.mode === "viewless" ? parent.gridOptions.getCurrentPage() : parent.currentPage;
|
|
5058
|
+
} else {
|
|
5059
|
+
currentPage = parent.currentPage;
|
|
5060
|
+
}
|
|
5056
5061
|
var dataNavigator = parent.dataNavigator;
|
|
5057
5062
|
var pagesize = parent.pagesize;
|
|
5058
5063
|
if (!isDefined(fieldDefs) || dataNavigator.isFirstPage()) {
|