@wavemaker/app-runtime-wm-build 11.4.0-rc.5347 → 11.4.1-next.25738

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-runtime-wm-build",
3
- "version": "11.4.0-rc.5347",
3
+ "version": "11.4.1-next.25738",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -199261,8 +199261,11 @@ window.requestAnimationFrame = function() {
199261
199261
  });
199262
199262
  };
199263
199263
  BaseVariableManager.prototype.setRequestTrackId = function(response, variable) {
199264
- var _a, _b;
199265
- var requestTrackId = ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.get) && ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b.get("x-wm-request-track-id")) || (response === null || response === void 0 ? void 0 : response.headers["x-wm-request-track-id"]);
199264
+ if (response === void 0) {
199265
+ response = {};
199266
+ }
199267
+ response.headers = response.headers || {};
199268
+ var requestTrackId = response.headers.get && response.headers.get("x-wm-request-track-id") || response.headers["x-wm-request-track-id"];
199266
199269
  if (requestTrackId) {
199267
199270
  variable._requestTrackId = requestTrackId;
199268
199271
  }
@@ -200788,38 +200791,42 @@ window.requestAnimationFrame = function() {
200788
200791
  return info;
200789
200792
  };
200790
200793
  ServiceVariableManager.prototype.handleRequestMetaError = function(info, variable, success, errorCB, options) {
200791
- var err_type = lodash__WEBPACK_IMPORTED_MODULE_10___default().get(info, "error.type");
200792
- switch (err_type) {
200793
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:
200794
- (0, _util_oAuth_utils__WEBPACK_IMPORTED_MODULE_7__.performAuthorization)(undefined, info.securityDefnObj[_constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY], this.invoke.bind(this, variable, options, success, errorCB), null, this.getProviderInfo(variable, info.securityDefnObj["x-WM-PROVIDER_ID"]));
200795
- this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, true, true);
200796
- break;
200794
+ try {
200795
+ var err_type = lodash__WEBPACK_IMPORTED_MODULE_10___default().get(info, "error.type");
200796
+ switch (err_type) {
200797
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:
200798
+ (0, _util_oAuth_utils__WEBPACK_IMPORTED_MODULE_7__.performAuthorization)(undefined, info.securityDefnObj[_constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY], this.invoke.bind(this, variable, options, success, errorCB), null, this.getProviderInfo(variable, info.securityDefnObj["x-WM-PROVIDER_ID"]));
200799
+ this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, true, true);
200800
+ break;
200797
200801
 
200798
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:
200799
- info = this.handleAuthError(variable, success, errorCB, options);
200800
- this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
200801
- break;
200802
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:
200803
+ info = this.handleAuthError(variable, success, errorCB, options);
200804
+ this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
200805
+ break;
200802
200806
 
200803
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:
200804
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:
200805
- if (info.error.message) {
200806
- info.error.message = info.error.message.replace("$variable", variable.name);
200807
- var reasons = void 0;
200808
- if (err_type === _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING) {
200809
- reasons = [ "1. You did not Preview the app after creating a Variable for the imported service.", "2. You deleted the imported service this Variable is linked to." ];
200810
- } else {
200811
- reasons = [ "1. You haven't chosen an endpoint for " + options.operation + " operation for this Entity." ];
200807
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:
200808
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:
200809
+ if (info.error.message) {
200810
+ info.error.message = info.error.message.replace("$variable", variable.name);
200811
+ var reasons = void 0;
200812
+ if (err_type === _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING) {
200813
+ reasons = [ "1. You did not Preview the app after creating a Variable for the imported service.", "2. You deleted the imported service this Variable is linked to." ];
200814
+ } else {
200815
+ reasons = [ "1. You haven't chosen an endpoint for " + options.operation + " operation for this Entity." ];
200816
+ }
200817
+ console.warn(info.error.message + "\n Possible reasons for this:\n " + reasons.join("\n "));
200812
200818
  }
200813
- console.warn(info.error.message + "\n Possible reasons for this:\n " + reasons.join("\n "));
200814
- }
200815
- this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
200816
- break;
200817
-
200818
- default:
200819
- if (info.error.message) {
200820
- console.warn(info.error.message, variable.name);
200821
200819
  this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
200820
+ break;
200821
+
200822
+ default:
200823
+ if (info.error.message) {
200824
+ console.warn(info.error.message, variable.name);
200825
+ this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
200826
+ }
200822
200827
  }
200828
+ } catch (err) {
200829
+ console.error(err);
200823
200830
  }
200824
200831
  return info;
200825
200832
  };
@@ -200940,6 +200947,7 @@ window.requestAnimationFrame = function() {
200940
200947
  var info = this.handleRequestMetaError(requestParams, variable, success, error, options);
200941
200948
  var reason = (lodash__WEBPACK_IMPORTED_MODULE_10___default().get(info, "error.message") || "An error occurred while triggering the variable: ") + ": " + variable.name;
200942
200949
  (0, _util_utils__WEBPACK_IMPORTED_MODULE_0__.triggerFn)(error);
200950
+ _util_inflight_queue__WEBPACK_IMPORTED_MODULE_3__.$queue.process(variable);
200943
200951
  return Promise.reject(reason);
200944
200952
  }
200945
200953
  if (_util_variable_service_variable_utils__WEBPACK_IMPORTED_MODULE_2__.ServiceVariableUtils.isFileUploadRequest(variable)) {
@@ -4267,7 +4267,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.
4267
4267
  /*!*******************************************************!*\
4268
4268
  !*** ./src/manager/variable/base-variable.manager.ts ***!
4269
4269
  \*******************************************************/
4270
- (e,t,n)=>{"use strict";n.r(t),n.d(t,{BaseVariableManager:()=>a});var r=n(/*! ./../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),i=n(/*! lodash */"./node_modules/lodash/lodash.js"),o=n.n(i),a=function(){function e(){}return e.prototype.initBinding=function(e,t,n){},e.prototype.notifyInflight=function(e,t,n,i){r.appManager&&r.appManager.notify("toggle-variable-state",{variable:e,active:t,data:n,options:i})},e.prototype.setRequestTrackId=function(e,t){var n,r,i=(null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.get)&&(null===(r=null==e?void 0:e.headers)||void 0===r?void 0:r.get("x-wm-request-track-id"))||(null==e?void 0:e.headers["x-wm-request-track-id"]);i&&(t._requestTrackId=i)},e.prototype.httpCall=function(e,t,n){var r=this;return new Promise((function(n,i){e._source="variable",t.httpService.sendCall(e,t).then((function(e){(e&&e.type||e&&e.status)&&(r.setRequestTrackId(e,t),n(e))}),(function(e){r.setRequestTrackId(e,t),t.httpService.isPlatformSessionTimeout&&t.httpService.isPlatformSessionTimeout(e)?(r.notifyInflight(t,!1,e),e._401Subscriber.asObservable().subscribe((function(e){return n(e)}),(function(e){return i(e)}))):i(e)}))}))},e.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&o().extend(n,t),n},e}()},"./src/manager/variable/crud-variable.manager.ts":
4270
+ (e,t,n)=>{"use strict";n.r(t),n.d(t,{BaseVariableManager:()=>a});var r=n(/*! ./../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),i=n(/*! lodash */"./node_modules/lodash/lodash.js"),o=n.n(i),a=function(){function e(){}return e.prototype.initBinding=function(e,t,n){},e.prototype.notifyInflight=function(e,t,n,i){r.appManager&&r.appManager.notify("toggle-variable-state",{variable:e,active:t,data:n,options:i})},e.prototype.setRequestTrackId=function(e,t){void 0===e&&(e={}),e.headers=e.headers||{};var n=e.headers.get&&e.headers.get("x-wm-request-track-id")||e.headers["x-wm-request-track-id"];n&&(t._requestTrackId=n)},e.prototype.httpCall=function(e,t,n){var r=this;return new Promise((function(n,i){e._source="variable",t.httpService.sendCall(e,t).then((function(e){(e&&e.type||e&&e.status)&&(r.setRequestTrackId(e,t),n(e))}),(function(e){r.setRequestTrackId(e,t),t.httpService.isPlatformSessionTimeout&&t.httpService.isPlatformSessionTimeout(e)?(r.notifyInflight(t,!1,e),e._401Subscriber.asObservable().subscribe((function(e){return n(e)}),(function(e){return i(e)}))):i(e)}))}))},e.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&o().extend(n,t),n},e}()},"./src/manager/variable/crud-variable.manager.ts":
4271
4271
  /*!*******************************************************!*\
4272
4272
  !*** ./src/manager/variable/crud-variable.manager.ts ***!
4273
4273
  \*******************************************************/
@@ -4283,7 +4283,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.
4283
4283
  /*!**********************************************************!*\
4284
4284
  !*** ./src/manager/variable/service-variable.manager.ts ***!
4285
4285
  \**********************************************************/
4286
- (e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableManager:()=>g});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ../../util/file-upload.util */"./src/util/file-upload.util.ts"),a=n(/*! ../../util/variable/service-variable.utils */"./src/util/variable/service-variable.utils.ts"),s=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),u=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),l=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),c=n(/*! ../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),d=n(/*! ../../util/oAuth.utils */"./src/util/oAuth.utils.ts"),p=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),h=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),f=n(/*! lodash */"./node_modules/lodash/lodash.js"),m=n.n(f),v=(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)}),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fileUploadResponse=[],t.fileUploadCount=0,t.totalFilesCount=0,t.successFileUploadCount=0,t.failedFileUploadCount=0,t}return v(t,e),t.prototype.processErrorResponse=function(e,t,n,r,o,a){var u=this.getMethodInfo(e,{},{}),p=m().get(u,"securityDefinitions.0"),f=this.prepareCallbackOptions(r);o||(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,f,a),m().get(p,"type")===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2&&m().includes([l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.UNAUTHORIZED,l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.FORBIDDEN],m().get(r,"status"))&&(0,d.removeAccessToken)(p["x-WM-PROVIDER_ID"]),(0,i.triggerFn)(n,t),e.notify(h.VariableEvents.AFTER_INVOKE,[this,t]),l.CONSTANTS.isStudioMode||(e.canUpdate=!0,s.$queue.process(e),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,t,f))},t.prototype.processSuccessResponse=function(e,t,n,r,o,a){var u,d,f,v={},g=(0,i.getValidJSON)(e);e=(0,i.isDefined)(g)?g:(0,i.xmlToJson)(e)||e;var y=(0,i.isPageable)(e);if("DataService"===t.serviceType||"JavaService"===t.serviceType){var _=(0,c.decodeData)(e);m().isString(e)&&(e=_)}y?(u=e.content,v=m().omit(e,"content")):u=e,f=this.prepareCallbackOptions(n.xhrObj,{pagination:v,rawData:u}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,e,f),(0,i.triggerFn)(r,e,v),t.transformationColumns&&this.transformData(e,t),u=m().isObject(u)?u:{value:u},d=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,u,f),(0,i.isDefined)(d)&&(u=d);var b=(0,i.getClonedObject)(n.inputFields||t.dataBinding),w=a||this.getMethodInfo(t,b,n),S=p.PaginationUtils.getPaginationInfo(w,t);if(S){var E=p.PaginationUtils.generatePaginationRes(w,S,e,o,n,t);m().isEmpty(E)||p.PaginationUtils.setVariablePagination(t,E,n)}return n.forceRunMode||n.skipDataSetUpdate||(t._paginationConfig||(t.pagination=v),t.dataSet=u,y&&Object.defineProperty(t.dataSet,"content",{get:function(){return t.dataSet}})),t.notify(h.VariableEvents.AFTER_INVOKE,[this,u]),setTimeout((function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,u,f),l.CONSTANTS.isStudioMode||(t.canUpdate=!0,s.$queue.process(t)),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,u,f)})),{data:t.dataSet,pagination:t.pagination}},t.prototype.uploadFileInFormData=function(e,t,n,r,i,a){var s=this,u=(0,o.upload)(i,e,a.data,{fileParamName:"files",url:a.url});return u.then((function(r){return s.fileUploadCount++,s.successFileUploadCount++,s.fileUploadResponse.push(r[0]),s.totalFilesCount===s.fileUploadCount&&(0===s.failedFileUploadCount?(s.processSuccessResponse(s.fileUploadResponse,e,t,n),s.fileUploadResponse=[],e.onSuccess||c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_SUCCESS,"success")):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,s.fileUploadResponse),s.fileUploadResponse=[],c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_ERROR,"error")),s.fileUploadCount=0,s.successFileUploadCount=0,s.totalFilesCount=0),r}),(function(n){s.fileUploadCount++,s.failedFileUploadCount++,s.fileUploadResponse.push(n);var o=(0,c.getErrMessage)(n,e.httpService.getLocale());return e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o}),s.totalFilesCount===s.fileUploadCount&&(s.processErrorResponse(e,o,r,n,t.skipNotification),s.fileUploadResponse=[],s.fileUploadCount=0,s.failedFileUploadCount=0,s.totalFilesCount=0),n}),(function(t){return e._progressObservable&&e._progressObservable.next({progress:t,status:l.VARIABLE_CONSTANTS.EVENT.PROGRESS,fileName:i.name}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PROGRESS,e,t),t})),u},t.prototype.handleAuthError=function(e,t,n,r){var i;return m().get(c.securityService.get(),"authenticated")?i={error:{message:"You're not authorised to access the resource \""+e.service+'".'}}:(i={error:{message:"You're not authenticated to access the resource \""+e.service+'".',skipDefaultNotification:!0}},c.appManager.pushToSessionFailureRequests(e.invoke.bind(e,r,t,n)),c.appManager.handle401()),console.warn(e.name+": "+i.error.message),i},t.prototype.handleRequestMetaError=function(e,t,n,r,i){var o=m().get(e,"error.type");switch(o){case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:(0,d.performAuthorization)(void 0,e.securityDefnObj[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],this.invoke.bind(this,t,i,n,r),null,this.getProviderInfo(t,e.securityDefnObj["x-WM-PROVIDER_ID"])),this.processErrorResponse(t,e.error.message,r,i.xhrObj,!0,!0);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:e=this.handleAuthError(t,n,r,i),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:if(e.error.message){e.error.message=e.error.message.replace("$variable",t.name);var a=void 0;a=o===l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING?["1. You did not Preview the app after creating a Variable for the imported service.","2. You deleted the imported service this Variable is linked to."]:["1. You haven't chosen an endpoint for "+i.operation+" operation for this Entity."],console.warn(e.error.message+"\n Possible reasons for this:\n "+a.join("\n "))}this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;default:e.error.message&&(console.warn(e.error.message,t.name),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification))}return e},t.prototype.transformData=function(e,t){e.wmTransformedData=[];var n=t.transformationColumns,r=m().get(e,t.dataField)||[],i=e.wmTransformedData;m().forEach(r,(function(e,t){i[t]={},m().forEach(n,(function(n,r){i[t][n]=e[r]}))}))},t.prototype.getMethodInfo=function(e,t,n){var r;if(m().isEmpty(c.metadataService))r=e.serviceInfo;else{var o=(0,i.getClonedObject)(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()));r=null===o?null:m().get(o,"wmServiceOperationInfo")}if(!r)return r;var a=m().get(r.securityDefinitions,"0"),s=a&&a.type===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2;return r.parameters&&r.parameters.forEach((function(r){r.readOnly||(r.sampleValue=t[r.name],-1!==l.VARIABLE_CONSTANTS.PAGINATION_PARAMS.indexOf(r.name)?"size"===r.name?r.sampleValue=n.size||r.sampleValue||parseInt(e.maxResults,10):"page"===r.name?r.sampleValue=n.page||r.sampleValue||1:"sort"===r.name&&(r.sampleValue=(0,c.getEvaluatedOrderBy)(e.orderBy,n.orderBy)||r.sampleValue||""):"access_token"===r.name&&s&&(r.sampleValue=(0,d.getAccessToken)(a[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))})),r},t.prototype.getProviderInfo=function(e,t){return(0,i.getClonedObject)(null===c.metadataService||void 0===c.metadataService?void 0:c.metadataService.getByProviderId(t,e.getPrefabName()))},t.prototype.isFileUploadInProgress=function(e){var t=!1;return m().forEach(e,(function(e){m().isArray(e)&&e[0]instanceof File&&m().forEach(e,(function(e){"onProgress"!==e.status||(t=!0)}))})),t},t.prototype.uploadFile=function(e,t,n,r,i,o){var a=this,s=0,u=[],l=[];if(m().forEach(i,(function(e){m().isArray(e)?(e[0]instanceof File&&s++,m().forEach(e,(function(e){(e instanceof File||m().find(m().values(e),(function(e){return e instanceof Blob})))&&(u.push(e),a.totalFilesCount++,s=s||1)}))):e instanceof File&&(s++,a.totalFilesCount++,u.push(e))})),1===s)return i.files.length>1?(m().forEach(u,(function(i){l.push(a.uploadFileInFormData(e,t,n,r,i,o))})),Promise.all(l)):this.uploadFileInFormData(e,t,n,r,u[0],o)},t.prototype._invoke=function(e,t,n,r){var o,u,d=this,p=(0,i.getClonedObject)(t.inputFields||e.dataBinding),h=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,p,t);if(!1===h)return s.$queue.process(e),void(0,i.triggerFn)(r);m().isObject(h)&&(p=h);var f=this.getMethodInfo(e,p,t),v=a.ServiceVariableUtils.constructRequestParams(e,f,p,t);if(v.error){var g=this.handleRequestMetaError(v,e,n,r,t),y=(m().get(g,"error.message")||"An error occurred while triggering the variable: ")+": "+e.name;return(0,i.triggerFn)(r),Promise.reject(y)}if(a.ServiceVariableUtils.isFileUploadRequest(e)){var _=this.uploadFile(e,t,n,r,p,v);if(_)return _}return f&&m().isArray(f.produces)&&m().includes(f.produces,l.WS_CONSTANTS.CONTENT_TYPES.OCTET_STREAM)?e.simulateFileDownload(v,e.dataBinding.file||e.name,e.dataBinding.exportType,(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(n)}),(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(r)})):(this.notifyInflight(e,!t.skipToggleState),o=function(r,i){if(r&&r.type||r&&r.status){var o=r.body||r.data,a=d.processSuccessResponse(o,e,m().extend(t,{xhrObj:r}),n,r.headers);d.notifyInflight(e,!1,a),i(r)}},u=function(n,i){var o=(0,c.getErrMessage)(n,e.httpService.getLocale());d.notifyInflight(e,!1),d.processErrorResponse(e,o,r,n,t.skipNotification),i({error:o,details:n})},new Promise((function(t,n){v.responseType="text",e.httpService.sendCall(v,e).then((function(e){o(e,t)}),(function(e){var t=(0,i.getValidJSON)(e.error);e.error=(0,i.isDefined)(t)?t:e.error,u(e,n)}))})))},t.prototype.invoke=function(e,t,n,r){return(t=t||{}).inputFields=t.inputFields||(0,i.getClonedObject)(e.dataBinding),s.$queue.submit(e).then(this._invoke.bind(this,e,t,n,r),r)},t.prototype.setPagination=function(e,t){e._paginationConfig=t},t.prototype.download=function(e,t,n,r){t=t||{};var o,s=(0,i.getClonedObject)(e.dataBinding),u=t.data||{},d=this.getMethodInfo(e,s,t);return d.relativePath+="/export",(o=a.ServiceVariableUtils.constructRequestParams(e,d,s)).data=u,o.data.fields=(0,c.formatExportExpression)(u.fields||[]),o.method=t.httpMethod||"POST",o.url=t.url||o.url,m().hasIn(o,"error.message")?((0,i.triggerFn)(r,o.error.message),Promise.reject(o.error.message)):e.httpService.send(o).then((function(t){t&&(0,i.isValidWebURL)(t.body.result)?(window.location.href=t.body.result,(0,i.triggerFn)(n,t)):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t),(0,i.triggerFn)(r,t))}),(function(t,n){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,n),(0,i.triggerFn)(r,t)}))},t.prototype.getInputParms=function(e){var t;return t=m().isEmpty(c.metadataService)?e.serviceInfo:m().get(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()),"wmServiceOperationInfo"),m().get(t,"parameters")},t.prototype.setInput=function(e,t,n,r){return(0,c.setInput)(e.dataBinding,t,n,r)},t.prototype.cancel=function(e,t){s.$queue.requestsQueue.has(e)&&(a.ServiceVariableUtils.isFileUploadRequest(e)?(e.httpService.cancel(e,t),t.status="abort",this.totalFilesCount--,(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ABORT,e,t),this.isFileUploadInProgress(e.dataBinding)||0!==this.totalFilesCount||(s.$queue.process(e),this.notifyInflight(e,!1))):e.httpService.cancel&&(e.httpService.cancel(e),s.$queue.process(e),this.notifyInflight(e,!1)))},t.prototype.defineFirstLastRecord=function(e){e.isList&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().head(t&&t.content)||m().head(t)||{}}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().last(t&&t.content)||m().last(t)||{}}}))},t.prototype.getQueryParams=function(e,t,n){var r=this.getInputParms(n),i=a.ServiceVariableUtils.excludePaginationParams(r),o={};return m().map(n.dataBinding,(function(e,t){o[t]=e})),m().forEach(e,(function(e){m().includes(i,e)&&(o[e]=t)})),o},t.prototype.searchRecords=function(e,t,n,r){var o=this.getQueryParams(m().split(t.searchKey,","),t.query,e),a={page:t.page,pagesize:t.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",inputFields:o};return t.onBeforeservicecall&&t.onBeforeservicecall(o),this.invoke(e,a,n,r).catch(i.noop)},t}(u.BaseVariableManager)},"./src/model/action/timer-action.ts":
4286
+ (e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableManager:()=>g});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ../../util/file-upload.util */"./src/util/file-upload.util.ts"),a=n(/*! ../../util/variable/service-variable.utils */"./src/util/variable/service-variable.utils.ts"),s=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),u=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),l=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),c=n(/*! ../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),d=n(/*! ../../util/oAuth.utils */"./src/util/oAuth.utils.ts"),p=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),h=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),f=n(/*! lodash */"./node_modules/lodash/lodash.js"),m=n.n(f),v=(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)}),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fileUploadResponse=[],t.fileUploadCount=0,t.totalFilesCount=0,t.successFileUploadCount=0,t.failedFileUploadCount=0,t}return v(t,e),t.prototype.processErrorResponse=function(e,t,n,r,o,a){var u=this.getMethodInfo(e,{},{}),p=m().get(u,"securityDefinitions.0"),f=this.prepareCallbackOptions(r);o||(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,f,a),m().get(p,"type")===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2&&m().includes([l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.UNAUTHORIZED,l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.FORBIDDEN],m().get(r,"status"))&&(0,d.removeAccessToken)(p["x-WM-PROVIDER_ID"]),(0,i.triggerFn)(n,t),e.notify(h.VariableEvents.AFTER_INVOKE,[this,t]),l.CONSTANTS.isStudioMode||(e.canUpdate=!0,s.$queue.process(e),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,t,f))},t.prototype.processSuccessResponse=function(e,t,n,r,o,a){var u,d,f,v={},g=(0,i.getValidJSON)(e);e=(0,i.isDefined)(g)?g:(0,i.xmlToJson)(e)||e;var y=(0,i.isPageable)(e);if("DataService"===t.serviceType||"JavaService"===t.serviceType){var _=(0,c.decodeData)(e);m().isString(e)&&(e=_)}y?(u=e.content,v=m().omit(e,"content")):u=e,f=this.prepareCallbackOptions(n.xhrObj,{pagination:v,rawData:u}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,e,f),(0,i.triggerFn)(r,e,v),t.transformationColumns&&this.transformData(e,t),u=m().isObject(u)?u:{value:u},d=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,u,f),(0,i.isDefined)(d)&&(u=d);var b=(0,i.getClonedObject)(n.inputFields||t.dataBinding),w=a||this.getMethodInfo(t,b,n),S=p.PaginationUtils.getPaginationInfo(w,t);if(S){var E=p.PaginationUtils.generatePaginationRes(w,S,e,o,n,t);m().isEmpty(E)||p.PaginationUtils.setVariablePagination(t,E,n)}return n.forceRunMode||n.skipDataSetUpdate||(t._paginationConfig||(t.pagination=v),t.dataSet=u,y&&Object.defineProperty(t.dataSet,"content",{get:function(){return t.dataSet}})),t.notify(h.VariableEvents.AFTER_INVOKE,[this,u]),setTimeout((function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,u,f),l.CONSTANTS.isStudioMode||(t.canUpdate=!0,s.$queue.process(t)),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,u,f)})),{data:t.dataSet,pagination:t.pagination}},t.prototype.uploadFileInFormData=function(e,t,n,r,i,a){var s=this,u=(0,o.upload)(i,e,a.data,{fileParamName:"files",url:a.url});return u.then((function(r){return s.fileUploadCount++,s.successFileUploadCount++,s.fileUploadResponse.push(r[0]),s.totalFilesCount===s.fileUploadCount&&(0===s.failedFileUploadCount?(s.processSuccessResponse(s.fileUploadResponse,e,t,n),s.fileUploadResponse=[],e.onSuccess||c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_SUCCESS,"success")):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,s.fileUploadResponse),s.fileUploadResponse=[],c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_ERROR,"error")),s.fileUploadCount=0,s.successFileUploadCount=0,s.totalFilesCount=0),r}),(function(n){s.fileUploadCount++,s.failedFileUploadCount++,s.fileUploadResponse.push(n);var o=(0,c.getErrMessage)(n,e.httpService.getLocale());return e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o}),s.totalFilesCount===s.fileUploadCount&&(s.processErrorResponse(e,o,r,n,t.skipNotification),s.fileUploadResponse=[],s.fileUploadCount=0,s.failedFileUploadCount=0,s.totalFilesCount=0),n}),(function(t){return e._progressObservable&&e._progressObservable.next({progress:t,status:l.VARIABLE_CONSTANTS.EVENT.PROGRESS,fileName:i.name}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PROGRESS,e,t),t})),u},t.prototype.handleAuthError=function(e,t,n,r){var i;return m().get(c.securityService.get(),"authenticated")?i={error:{message:"You're not authorised to access the resource \""+e.service+'".'}}:(i={error:{message:"You're not authenticated to access the resource \""+e.service+'".',skipDefaultNotification:!0}},c.appManager.pushToSessionFailureRequests(e.invoke.bind(e,r,t,n)),c.appManager.handle401()),console.warn(e.name+": "+i.error.message),i},t.prototype.handleRequestMetaError=function(e,t,n,r,i){try{var o=m().get(e,"error.type");switch(o){case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:(0,d.performAuthorization)(void 0,e.securityDefnObj[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],this.invoke.bind(this,t,i,n,r),null,this.getProviderInfo(t,e.securityDefnObj["x-WM-PROVIDER_ID"])),this.processErrorResponse(t,e.error.message,r,i.xhrObj,!0,!0);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:e=this.handleAuthError(t,n,r,i),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:if(e.error.message){e.error.message=e.error.message.replace("$variable",t.name);var a=void 0;a=o===l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING?["1. You did not Preview the app after creating a Variable for the imported service.","2. You deleted the imported service this Variable is linked to."]:["1. You haven't chosen an endpoint for "+i.operation+" operation for this Entity."],console.warn(e.error.message+"\n Possible reasons for this:\n "+a.join("\n "))}this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;default:e.error.message&&(console.warn(e.error.message,t.name),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification))}}catch(e){console.error(e)}return e},t.prototype.transformData=function(e,t){e.wmTransformedData=[];var n=t.transformationColumns,r=m().get(e,t.dataField)||[],i=e.wmTransformedData;m().forEach(r,(function(e,t){i[t]={},m().forEach(n,(function(n,r){i[t][n]=e[r]}))}))},t.prototype.getMethodInfo=function(e,t,n){var r;if(m().isEmpty(c.metadataService))r=e.serviceInfo;else{var o=(0,i.getClonedObject)(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()));r=null===o?null:m().get(o,"wmServiceOperationInfo")}if(!r)return r;var a=m().get(r.securityDefinitions,"0"),s=a&&a.type===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2;return r.parameters&&r.parameters.forEach((function(r){r.readOnly||(r.sampleValue=t[r.name],-1!==l.VARIABLE_CONSTANTS.PAGINATION_PARAMS.indexOf(r.name)?"size"===r.name?r.sampleValue=n.size||r.sampleValue||parseInt(e.maxResults,10):"page"===r.name?r.sampleValue=n.page||r.sampleValue||1:"sort"===r.name&&(r.sampleValue=(0,c.getEvaluatedOrderBy)(e.orderBy,n.orderBy)||r.sampleValue||""):"access_token"===r.name&&s&&(r.sampleValue=(0,d.getAccessToken)(a[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))})),r},t.prototype.getProviderInfo=function(e,t){return(0,i.getClonedObject)(null===c.metadataService||void 0===c.metadataService?void 0:c.metadataService.getByProviderId(t,e.getPrefabName()))},t.prototype.isFileUploadInProgress=function(e){var t=!1;return m().forEach(e,(function(e){m().isArray(e)&&e[0]instanceof File&&m().forEach(e,(function(e){"onProgress"!==e.status||(t=!0)}))})),t},t.prototype.uploadFile=function(e,t,n,r,i,o){var a=this,s=0,u=[],l=[];if(m().forEach(i,(function(e){m().isArray(e)?(e[0]instanceof File&&s++,m().forEach(e,(function(e){(e instanceof File||m().find(m().values(e),(function(e){return e instanceof Blob})))&&(u.push(e),a.totalFilesCount++,s=s||1)}))):e instanceof File&&(s++,a.totalFilesCount++,u.push(e))})),1===s)return i.files.length>1?(m().forEach(u,(function(i){l.push(a.uploadFileInFormData(e,t,n,r,i,o))})),Promise.all(l)):this.uploadFileInFormData(e,t,n,r,u[0],o)},t.prototype._invoke=function(e,t,n,r){var o,u,d=this,p=(0,i.getClonedObject)(t.inputFields||e.dataBinding),h=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,p,t);if(!1===h)return s.$queue.process(e),void(0,i.triggerFn)(r);m().isObject(h)&&(p=h);var f=this.getMethodInfo(e,p,t),v=a.ServiceVariableUtils.constructRequestParams(e,f,p,t);if(v.error){var g=this.handleRequestMetaError(v,e,n,r,t),y=(m().get(g,"error.message")||"An error occurred while triggering the variable: ")+": "+e.name;return(0,i.triggerFn)(r),s.$queue.process(e),Promise.reject(y)}if(a.ServiceVariableUtils.isFileUploadRequest(e)){var _=this.uploadFile(e,t,n,r,p,v);if(_)return _}return f&&m().isArray(f.produces)&&m().includes(f.produces,l.WS_CONSTANTS.CONTENT_TYPES.OCTET_STREAM)?e.simulateFileDownload(v,e.dataBinding.file||e.name,e.dataBinding.exportType,(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(n)}),(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(r)})):(this.notifyInflight(e,!t.skipToggleState),o=function(r,i){if(r&&r.type||r&&r.status){var o=r.body||r.data,a=d.processSuccessResponse(o,e,m().extend(t,{xhrObj:r}),n,r.headers);d.notifyInflight(e,!1,a),i(r)}},u=function(n,i){var o=(0,c.getErrMessage)(n,e.httpService.getLocale());d.notifyInflight(e,!1),d.processErrorResponse(e,o,r,n,t.skipNotification),i({error:o,details:n})},new Promise((function(t,n){v.responseType="text",e.httpService.sendCall(v,e).then((function(e){o(e,t)}),(function(e){var t=(0,i.getValidJSON)(e.error);e.error=(0,i.isDefined)(t)?t:e.error,u(e,n)}))})))},t.prototype.invoke=function(e,t,n,r){return(t=t||{}).inputFields=t.inputFields||(0,i.getClonedObject)(e.dataBinding),s.$queue.submit(e).then(this._invoke.bind(this,e,t,n,r),r)},t.prototype.setPagination=function(e,t){e._paginationConfig=t},t.prototype.download=function(e,t,n,r){t=t||{};var o,s=(0,i.getClonedObject)(e.dataBinding),u=t.data||{},d=this.getMethodInfo(e,s,t);return d.relativePath+="/export",(o=a.ServiceVariableUtils.constructRequestParams(e,d,s)).data=u,o.data.fields=(0,c.formatExportExpression)(u.fields||[]),o.method=t.httpMethod||"POST",o.url=t.url||o.url,m().hasIn(o,"error.message")?((0,i.triggerFn)(r,o.error.message),Promise.reject(o.error.message)):e.httpService.send(o).then((function(t){t&&(0,i.isValidWebURL)(t.body.result)?(window.location.href=t.body.result,(0,i.triggerFn)(n,t)):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t),(0,i.triggerFn)(r,t))}),(function(t,n){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,n),(0,i.triggerFn)(r,t)}))},t.prototype.getInputParms=function(e){var t;return t=m().isEmpty(c.metadataService)?e.serviceInfo:m().get(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()),"wmServiceOperationInfo"),m().get(t,"parameters")},t.prototype.setInput=function(e,t,n,r){return(0,c.setInput)(e.dataBinding,t,n,r)},t.prototype.cancel=function(e,t){s.$queue.requestsQueue.has(e)&&(a.ServiceVariableUtils.isFileUploadRequest(e)?(e.httpService.cancel(e,t),t.status="abort",this.totalFilesCount--,(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ABORT,e,t),this.isFileUploadInProgress(e.dataBinding)||0!==this.totalFilesCount||(s.$queue.process(e),this.notifyInflight(e,!1))):e.httpService.cancel&&(e.httpService.cancel(e),s.$queue.process(e),this.notifyInflight(e,!1)))},t.prototype.defineFirstLastRecord=function(e){e.isList&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().head(t&&t.content)||m().head(t)||{}}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().last(t&&t.content)||m().last(t)||{}}}))},t.prototype.getQueryParams=function(e,t,n){var r=this.getInputParms(n),i=a.ServiceVariableUtils.excludePaginationParams(r),o={};return m().map(n.dataBinding,(function(e,t){o[t]=e})),m().forEach(e,(function(e){m().includes(i,e)&&(o[e]=t)})),o},t.prototype.searchRecords=function(e,t,n,r){var o=this.getQueryParams(m().split(t.searchKey,","),t.query,e),a={page:t.page,pagesize:t.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",inputFields:o};return t.onBeforeservicecall&&t.onBeforeservicecall(o),this.invoke(e,a,n,r).catch(i.noop)},t}(u.BaseVariableManager)},"./src/model/action/timer-action.ts":
4287
4287
  /*!******************************************!*\
4288
4288
  !*** ./src/model/action/timer-action.ts ***!
4289
4289
  \******************************************/
@@ -23185,8 +23185,9 @@
23185
23185
  var defaultTreeIconClass = "plus-minus";
23186
23186
  var TreeComponent = function(_super) {
23187
23187
  __extends(TreeComponent, _super);
23188
- function TreeComponent(inj) {
23188
+ function TreeComponent(inj, bindnodeid) {
23189
23189
  var _this = _super.call(this, inj, WIDGET_INFO) || this;
23190
+ _this.bindnodeid = bindnodeid;
23190
23191
  _this.setting = {
23191
23192
  data: {
23192
23193
  simpleData: {
@@ -23375,14 +23376,7 @@
23375
23376
  this.expandNode(nodes[0], !nodes[0].open, true);
23376
23377
  }
23377
23378
  }
23378
- var path = this.getPath(treeNode, "");
23379
- var eventParams = {
23380
- $event: event,
23381
- $item: treeNode,
23382
- $path: path
23383
- };
23384
- this.setSelectedItem(treeNode);
23385
- this.invokeEventCallback("select", eventParams);
23379
+ this.selectNode(event, treeNode);
23386
23380
  };
23387
23381
  TreeComponent.prototype.onExpand = function(event, treeId, treeNode) {
23388
23382
  var self = this;
@@ -23552,43 +23546,72 @@
23552
23546
  this.setting.callback["onCollapse"] = this.onCollapse.bind(this);
23553
23547
  var zTree = $.fn.zTree.init($('ul[name="' + this.name + '"]'), this.setting, this.nodes);
23554
23548
  $.fn.zTreeKeyboardNavigation(zTree, $('ul[name="' + this.name + '"]'), null, this.treeicon || defaultTreeIconClass);
23549
+ this.postRenderTree();
23555
23550
  };
23556
- TreeComponent.prototype.setSelectedItem = function(treeNode) {
23557
- this.selecteditem = core.getClonedObject(treeNode) || {};
23558
- this.selecteditem.path = this.getPath(treeNode, "");
23559
- var deSelectElm = $("li[treenode].selected");
23551
+ TreeComponent.prototype.selectNode = function(event, node) {
23552
+ var deSelectElm = $(".app-tree[name=" + this.name + "] li[treenode].selected");
23560
23553
  deSelectElm.removeClass("selected");
23561
- var selectElm = $("#" + treeNode.tId + ":has(.curSelectedNode)");
23554
+ if (!node) {
23555
+ return;
23556
+ }
23557
+ var selectElm = $("#" + node.tId + ":has(.curSelectedNode)");
23562
23558
  selectElm.addClass("selected");
23559
+ var path = this.getPath(node, "");
23560
+ this.selecteditem = core.getClonedObject(node) || {};
23561
+ this.selecteditem.path = path;
23562
+ var eventParams = {
23563
+ $event: event,
23564
+ $item: node,
23565
+ $path: path
23566
+ };
23567
+ this.invokeEventCallback("select", eventParams);
23563
23568
  };
23564
23569
  TreeComponent.prototype.expandNode = function(node, expand, eventFlag) {
23565
23570
  this.treeObj.expandNode(node, expand, false, false, eventFlag);
23566
23571
  var el = $("#" + node.tId + "_switch");
23567
23572
  $(el).addClass(this.treeicon || defaultTreeIconClass);
23568
23573
  };
23569
- TreeComponent.prototype.ngAfterViewInit = function() {
23574
+ TreeComponent.prototype.postRenderTree = function() {
23570
23575
  var _this = this;
23571
23576
  setTimeout((function() {
23572
23577
  _this.changeTreeIcons(_this.treeicon || defaultTreeIconClass);
23573
- if (_this.datavalue) {
23578
+ if (_this.datavalue && !_this.selecteditem) {
23574
23579
  var nodes = _this.treeObj.getNodes();
23575
- var selectNode = void 0;
23576
- if (_this.datavalue === "FirstNode") {
23577
- if (nodes.length) {
23578
- selectNode = nodes[0];
23580
+ var node = void 0;
23581
+ if (nodes.length) {
23582
+ if (_this.datavalue === "FirstNode") {
23583
+ node = nodes[0];
23579
23584
  }
23580
- }
23581
- if (_this.datavalue === "LastNode") {
23582
- if (nodes.length) {
23583
- selectNode = nodes[nodes.length - 1];
23585
+ if (_this.datavalue === "LastNode") {
23586
+ node = nodes[nodes.length - 1];
23584
23587
  }
23585
23588
  }
23586
- _this.treeObj.selectNode(selectNode, false);
23587
- _this.setSelectedItem(selectNode);
23588
- _this.expandNode(selectNode, true, false);
23589
+ if (node) {
23590
+ _this.treeObj.selectNode(node, false);
23591
+ _this.selectNode(undefined, node);
23592
+ _this.expandNode(node, true, false);
23593
+ }
23589
23594
  }
23590
23595
  }), 200);
23591
23596
  };
23597
+ TreeComponent.prototype.selectById = function(value) {
23598
+ var _this = this;
23599
+ var simpleNodes = this.treeObj.transformToArray(this.treeObj.getNodes());
23600
+ var node = simpleNodes.find((function(node) {
23601
+ return value === base.getEvaluatedData(node, {
23602
+ field: _this.nodeid,
23603
+ bindExpression: _this.bindnodeid
23604
+ }, _this.viewParent);
23605
+ }));
23606
+ if (node) {
23607
+ this.treeObj.selectNode(node, false);
23608
+ this.selectNode(undefined, node);
23609
+ }
23610
+ };
23611
+ TreeComponent.prototype.deselectById = function(value) {
23612
+ this.selecteditem = {};
23613
+ this.selectById();
23614
+ };
23592
23615
  return TreeComponent;
23593
23616
  }(base.StylableComponent);
23594
23617
  TreeComponent.initializeProps = registerProps();
@@ -23604,6 +23627,12 @@
23604
23627
  TreeComponent.ctorParameters = function() {
23605
23628
  return [ {
23606
23629
  type: core$1.Injector
23630
+ }, {
23631
+ type: undefined,
23632
+ decorators: [ {
23633
+ type: core$1.Attribute,
23634
+ args: [ "nodeid.bind" ]
23635
+ } ]
23607
23636
  } ];
23608
23637
  };
23609
23638
  var components = [ TreeComponent ];
@@ -42468,9 +42497,6 @@
42468
42497
  var childNode = item.querySelector("span");
42469
42498
  if ((childNode === null || childNode === void 0 ? void 0 : childNode.dataset.isacitvepage) === "true") {
42470
42499
  item.setAttribute("aria-current", "true");
42471
- setTimeout((function() {
42472
- return item.focus();
42473
- }));
42474
42500
  }
42475
42501
  if ((childNode === null || childNode === void 0 ? void 0 : childNode.dataset.isdisabled) === "true") {
42476
42502
  item.setAttribute("aria-disabled", "true");
@@ -124,7 +124,7 @@
124
124
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
125
125
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
126
126
  PERFORMANCE OF THIS SOFTWARE.
127
- ***************************************************************************** */var a=function(e,t){return(a=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)};Object.create;function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function l(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var c=function(){i.register("wm-tree",new Map([["class",i.PROP_STRING],["dataset",Object.assign({value:"node1, node2, node3"},i.PROP_ANY)],["datavalue",i.PROP_STRING],["levels",Object.assign({value:0},i.PROP_NUMBER)],["name",i.PROP_STRING],["nodeaction",i.PROP_STRING],["nodechildren",i.PROP_STRING],["nodeclick",Object.assign({value:"none"},i.PROP_STRING)],["nodeicon",i.PROP_STRING],["nodeid",i.PROP_STRING],["nodelabel",i.PROP_STRING],["orderby",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["treeicons",i.PROP_STRING]]))},p={widgetType:"wm-tree",hostClass:"app-tree"},d="plus-minus",u=function(e){function t(t){var n=e.call(this,t,p)||this;return n.setting={data:{simpleData:{enable:!1},key:{children:"children",name:"label"}},view:{dblClickExpand:!1,fontCss:{"font-awesome":!0},switchIcon:{}},check:{},callback:{}},i.styler(n.nativeElement,n,i.APPLY_STYLES_TYPE.CONTAINER),n}return 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}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":this.nodes=this.getNodes(n),this.level>0&&this.expandTree(this.level,this.nodes,0),this.renderTree();break;case"levels":n>0&&(this.level=n),this.renderTree();break;case"treeicons":this.treeicon=n,this.renderTree();break;case"nodelabel":this.setting.data.key.name=this.labelKey,this.renderTree();break;case"nodechildren":this.setting.data.key.children=this.childrenKey,this.renderTree();break;case"nodeicon":this.nodeicon=this.iconKey,this.renderTree();break;case"orderby":this.renderTree();break;case"class":this.treeClass=n,this.renderTree();break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.expandTree=function(e,t,n){var i=this;t.map((function(t){var o=i.getChildren(t);o&&!("open"in t)&&n<e?(t.open=!0,i.expandTree(e,o,n+1)):n=0}))},t.prototype.setTreeTemplate=function(e){"Classic"===e?this.setting.check.enable=!1:"Checkbox"===e?(this.setting.check.enable=!0,this.setting.check.chkStyle="checkbox"):"Radio"===e&&(this.setting.check.enable=!0,this.setting.check.chkStyle="radio",this.setting.check.radioType="all")},t.prototype.getNodesFromString=function(e){return e.split(",").map((function(e){return{label:e&&e.trim()}}))},t.prototype.getNodes=function(e){var t;return _.isArray(e)?t=i.getOrderedDataset(e,this.orderby):_.isObject(e)?t=[e]:_.isString(e)&&!_.isEmpty(e)&&(e=e.trim())&&(t=this.getNodesFromString(e)),t},t.prototype.setNodeclasses=function(e,t){return t.icon?{add:[""+t.icon]}:""},t.prototype.setNodeData=function(e,t,n,i,o){var a=this;0===t?e.map((function(e){var r=a.getChildren(e);if(r&&a.setNodeData(r,t,n,i,o),e.icon&&"icon"==a.nodelabel)e[o]=e.icon;else{if(!e.name||"name"!=a.nodelabel)return;e[o]=e.name}})):e.map((function(e){var r=a.getChildren(e);return r&&n>1&&(t===n&&(i=e),a.setNodeData(r,t,n-1,i,o)),1===n&&("name"===o?a.nodelabel.includes("label")||a.nodelabel.includes("name"):a.nodeicon.includes("label")||a.nodeicon.includes("name"))?void(i[o]=e.name||e.label):1===n&&void 0!==e.icon&&("name"===o?a.nodelabel.includes("icon"):a.nodeicon.includes("icon"))?void(i[o]=e.icon):void 0}))},t.prototype.changeTreeIcons=function(e){var t=$('ul[name="'+this.name+'"] li span.button.switch');$(t).map((function(t,n){$(n).addClass(e),$(n).on("click",(function(t){setTimeout((function(){$(n).addClass(e)}),0)}))}))},t.prototype.getPath=function(e,t){return t=null===e.getParentNode()?"/"+e[this.labelKey]+t:this.getPath(e.getParentNode(),t)+"/"+e[this.labelKey]},t.prototype.onClick=function(e,t,n,i){if("expand"===this.nodeclick){var o=this.treeObj.getSelectedNodes();o.length>0&&this.expandNode(o[0],!o[0].open,!0)}var a={$event:e,$item:n,$path:this.getPath(n,"")};this.setSelectedItem(n),this.invokeEventCallback("select",a)},t.prototype.onExpand=function(e,t,n){var i=this,o={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("expand",o);var a=this.getChildren(n);null==a||a.map((function(e){if(e.isParent){var t=$("#"+e.tId+"_switch");$(t).addClass(i.treeicon||d),$(t).on("click",(function(e){setTimeout((function(){$(t).addClass(i.treeicon||d)}),0)}))}}))},t.prototype.onCollapse=function(e,t,n){var i={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("collapse",i)},t.prototype.getChildren=function(e){return e[this.childrenKey]},Object.defineProperty(t.prototype,"childrenKey",{get:function(){return this.nodechildren?this.countDepth(this.nodechildren)?this.nodechildren.split(".").pop():this.nodechildren:"children"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelKey",{get:function(){return this.nodelabel?this.countDepth(this.nodelabel)?this.nodelabel.split(".").pop():this.nodelabel:"label"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconKey",{get:function(){return this.nodeicon?this.countDepth(this.nodeicon)?this.nodeicon.split(".").pop():this.nodeicon:"icon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"treeObj",{get:function(){return $.fn.zTree.getZTreeObj(""+this.name)},enumerable:!1,configurable:!0}),t.prototype.modifyObjects=function(e){var t=this;e.forEach((function(e){e.icon=e[t.nodeicon];var n=t.getChildren(e);(null==n?void 0:n.length)&&t.modifyObjects(n)}))},t.prototype.setNodeChildren=function(e,t,n,i){var o=this;if(t<=0)return e;for(var a=0;a<e.length;a++){var r=e[a];t===n&&(i=e[a]);var s=this.getChildren(r);if(null==s?void 0:s.length){if(1===n)return void(i[this.childrenKey]=s.map((function(e){var t;return(t={})[o.labelKey]=e[o.labelKey],t[o.childrenKey]=o.getChildren(e),t.icon=e[o.iconKey],t})));this.setNodeChildren(s,t,n-1,i)}}return e},t.prototype.countDepth=function(e){var t,n,i=e.match(/\[.*?\]/g),o=1;if(null===i)return o;try{for(var a=r(i),s=a.next();!s.done;s=a.next()){s.value;o++}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},t.prototype.renderTree=function(){if(this.nodes){if(this.nativeElement.setAttribute("id",this.name),this.nodeicon&&"icon"!==this.nodeicon&&this.modifyObjects(this.nodes),this.setTreeTemplate(this.treeClass),this.nodelabel){var e=0;this.nodelabel.includes("children")&&(e=this.countDepth(this.nodelabel)),this.setNodeData(this.nodes,e,e,null,"name")}if(this.nodeicon){e=0;this.nodeicon.includes("children")&&(e=this.countDepth(this.nodeicon)),this.setNodeData(this.nodes,e,e,null,"icon")}if(this.nodechildren)(e=this.countDepth(this.nodechildren))>1&&(this.nodes=this.setNodeChildren(this.nodes,e,e,null))}this.setting.view.nodeClasses=this.setNodeclasses,this.setting.callback.onClick=this.onClick.bind(this),this.setting.callback.onExpand=this.onExpand.bind(this),this.setting.callback.onCollapse=this.onCollapse.bind(this);var t=$.fn.zTree.init($('ul[name="'+this.name+'"]'),this.setting,this.nodes);$.fn.zTreeKeyboardNavigation(t,$('ul[name="'+this.name+'"]'),null,this.treeicon||d)},t.prototype.setSelectedItem=function(e){this.selecteditem=o.getClonedObject(e)||{},this.selecteditem.path=this.getPath(e,""),$("li[treenode].selected").removeClass("selected"),$("#"+e.tId+":has(.curSelectedNode)").addClass("selected")},t.prototype.expandNode=function(e,t,n){this.treeObj.expandNode(e,t,!1,!1,n);var i=$("#"+e.tId+"_switch");$(i).addClass(this.treeicon||d)},t.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){if(e.changeTreeIcons(e.treeicon||d),e.datavalue){var t=e.treeObj.getNodes(),n=void 0;"FirstNode"===e.datavalue&&t.length&&(n=t[0]),"LastNode"===e.datavalue&&t.length&&(n=t[t.length-1]),e.treeObj.selectNode(n,!1),e.setSelectedItem(n),e.expandNode(n,!0,!1)}}),200)},t}(i.StylableComponent);u.initializeProps=c(),u.decorators=[{type:t.Component,args:[{selector:"ul[wmTree]",template:'<ul #wmTree class="ztree" id="ztree"></ul> ',providers:[i.provideAsWidgetRef(u)],encapsulation:t.ViewEncapsulation.None}]}],u.ctorParameters=function(){return[{type:t.Injector}]};var h=[u],m=function(){};m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(h)),exports:l([],s(h)),entryComponents:[]}]}],e.TreeComponent=u,e.TreeModule=m,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-bootstrap/datepicker"),require("@wm/core"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/input/calendar",["exports","@angular/core","@angular/common","@angular/forms","ngx-bootstrap/datepicker","@wm/core","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.calendar={}),e.ng.core,e.ng.common,e.ng.forms,e["ngx-bootstrap"].datepicker,e.wm.core,e.wm.components.base)}(this,(function(e,t,n,i,o,a,r){"use strict";
127
+ ***************************************************************************** */var a=function(e,t){return(a=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)};Object.create;function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function l(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var c=function(){i.register("wm-tree",new Map([["class",i.PROP_STRING],["dataset",Object.assign({value:"node1, node2, node3"},i.PROP_ANY)],["datavalue",i.PROP_STRING],["levels",Object.assign({value:0},i.PROP_NUMBER)],["name",i.PROP_STRING],["nodeaction",i.PROP_STRING],["nodechildren",i.PROP_STRING],["nodeclick",Object.assign({value:"none"},i.PROP_STRING)],["nodeicon",i.PROP_STRING],["nodeid",i.PROP_STRING],["nodelabel",i.PROP_STRING],["orderby",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["treeicons",i.PROP_STRING]]))},p={widgetType:"wm-tree",hostClass:"app-tree"},d="plus-minus",u=function(e){function t(t,n){var o=e.call(this,t,p)||this;return o.bindnodeid=n,o.setting={data:{simpleData:{enable:!1},key:{children:"children",name:"label"}},view:{dblClickExpand:!1,fontCss:{"font-awesome":!0},switchIcon:{}},check:{},callback:{}},i.styler(o.nativeElement,o,i.APPLY_STYLES_TYPE.CONTAINER),o}return 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}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":this.nodes=this.getNodes(n),this.level>0&&this.expandTree(this.level,this.nodes,0),this.renderTree();break;case"levels":n>0&&(this.level=n),this.renderTree();break;case"treeicons":this.treeicon=n,this.renderTree();break;case"nodelabel":this.setting.data.key.name=this.labelKey,this.renderTree();break;case"nodechildren":this.setting.data.key.children=this.childrenKey,this.renderTree();break;case"nodeicon":this.nodeicon=this.iconKey,this.renderTree();break;case"orderby":this.renderTree();break;case"class":this.treeClass=n,this.renderTree();break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.expandTree=function(e,t,n){var i=this;t.map((function(t){var o=i.getChildren(t);o&&!("open"in t)&&n<e?(t.open=!0,i.expandTree(e,o,n+1)):n=0}))},t.prototype.setTreeTemplate=function(e){"Classic"===e?this.setting.check.enable=!1:"Checkbox"===e?(this.setting.check.enable=!0,this.setting.check.chkStyle="checkbox"):"Radio"===e&&(this.setting.check.enable=!0,this.setting.check.chkStyle="radio",this.setting.check.radioType="all")},t.prototype.getNodesFromString=function(e){return e.split(",").map((function(e){return{label:e&&e.trim()}}))},t.prototype.getNodes=function(e){var t;return _.isArray(e)?t=i.getOrderedDataset(e,this.orderby):_.isObject(e)?t=[e]:_.isString(e)&&!_.isEmpty(e)&&(e=e.trim())&&(t=this.getNodesFromString(e)),t},t.prototype.setNodeclasses=function(e,t){return t.icon?{add:[""+t.icon]}:""},t.prototype.setNodeData=function(e,t,n,i,o){var a=this;0===t?e.map((function(e){var r=a.getChildren(e);if(r&&a.setNodeData(r,t,n,i,o),e.icon&&"icon"==a.nodelabel)e[o]=e.icon;else{if(!e.name||"name"!=a.nodelabel)return;e[o]=e.name}})):e.map((function(e){var r=a.getChildren(e);return r&&n>1&&(t===n&&(i=e),a.setNodeData(r,t,n-1,i,o)),1===n&&("name"===o?a.nodelabel.includes("label")||a.nodelabel.includes("name"):a.nodeicon.includes("label")||a.nodeicon.includes("name"))?void(i[o]=e.name||e.label):1===n&&void 0!==e.icon&&("name"===o?a.nodelabel.includes("icon"):a.nodeicon.includes("icon"))?void(i[o]=e.icon):void 0}))},t.prototype.changeTreeIcons=function(e){var t=$('ul[name="'+this.name+'"] li span.button.switch');$(t).map((function(t,n){$(n).addClass(e),$(n).on("click",(function(t){setTimeout((function(){$(n).addClass(e)}),0)}))}))},t.prototype.getPath=function(e,t){return t=null===e.getParentNode()?"/"+e[this.labelKey]+t:this.getPath(e.getParentNode(),t)+"/"+e[this.labelKey]},t.prototype.onClick=function(e,t,n,i){if("expand"===this.nodeclick){var o=this.treeObj.getSelectedNodes();o.length>0&&this.expandNode(o[0],!o[0].open,!0)}this.selectNode(e,n)},t.prototype.onExpand=function(e,t,n){var i=this,o={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("expand",o);var a=this.getChildren(n);null==a||a.map((function(e){if(e.isParent){var t=$("#"+e.tId+"_switch");$(t).addClass(i.treeicon||d),$(t).on("click",(function(e){setTimeout((function(){$(t).addClass(i.treeicon||d)}),0)}))}}))},t.prototype.onCollapse=function(e,t,n){var i={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("collapse",i)},t.prototype.getChildren=function(e){return e[this.childrenKey]},Object.defineProperty(t.prototype,"childrenKey",{get:function(){return this.nodechildren?this.countDepth(this.nodechildren)?this.nodechildren.split(".").pop():this.nodechildren:"children"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelKey",{get:function(){return this.nodelabel?this.countDepth(this.nodelabel)?this.nodelabel.split(".").pop():this.nodelabel:"label"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconKey",{get:function(){return this.nodeicon?this.countDepth(this.nodeicon)?this.nodeicon.split(".").pop():this.nodeicon:"icon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"treeObj",{get:function(){return $.fn.zTree.getZTreeObj(""+this.name)},enumerable:!1,configurable:!0}),t.prototype.modifyObjects=function(e){var t=this;e.forEach((function(e){e.icon=e[t.nodeicon];var n=t.getChildren(e);(null==n?void 0:n.length)&&t.modifyObjects(n)}))},t.prototype.setNodeChildren=function(e,t,n,i){var o=this;if(t<=0)return e;for(var a=0;a<e.length;a++){var r=e[a];t===n&&(i=e[a]);var s=this.getChildren(r);if(null==s?void 0:s.length){if(1===n)return void(i[this.childrenKey]=s.map((function(e){var t;return(t={})[o.labelKey]=e[o.labelKey],t[o.childrenKey]=o.getChildren(e),t.icon=e[o.iconKey],t})));this.setNodeChildren(s,t,n-1,i)}}return e},t.prototype.countDepth=function(e){var t,n,i=e.match(/\[.*?\]/g),o=1;if(null===i)return o;try{for(var a=r(i),s=a.next();!s.done;s=a.next()){s.value;o++}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},t.prototype.renderTree=function(){if(this.nodes){if(this.nativeElement.setAttribute("id",this.name),this.nodeicon&&"icon"!==this.nodeicon&&this.modifyObjects(this.nodes),this.setTreeTemplate(this.treeClass),this.nodelabel){var e=0;this.nodelabel.includes("children")&&(e=this.countDepth(this.nodelabel)),this.setNodeData(this.nodes,e,e,null,"name")}if(this.nodeicon){e=0;this.nodeicon.includes("children")&&(e=this.countDepth(this.nodeicon)),this.setNodeData(this.nodes,e,e,null,"icon")}if(this.nodechildren)(e=this.countDepth(this.nodechildren))>1&&(this.nodes=this.setNodeChildren(this.nodes,e,e,null))}this.setting.view.nodeClasses=this.setNodeclasses,this.setting.callback.onClick=this.onClick.bind(this),this.setting.callback.onExpand=this.onExpand.bind(this),this.setting.callback.onCollapse=this.onCollapse.bind(this);var t=$.fn.zTree.init($('ul[name="'+this.name+'"]'),this.setting,this.nodes);$.fn.zTreeKeyboardNavigation(t,$('ul[name="'+this.name+'"]'),null,this.treeicon||d),this.postRenderTree()},t.prototype.selectNode=function(e,t){if($(".app-tree[name="+this.name+"] li[treenode].selected").removeClass("selected"),t){$("#"+t.tId+":has(.curSelectedNode)").addClass("selected");var n=this.getPath(t,"");this.selecteditem=o.getClonedObject(t)||{},this.selecteditem.path=n;var i={$event:e,$item:t,$path:n};this.invokeEventCallback("select",i)}},t.prototype.expandNode=function(e,t,n){this.treeObj.expandNode(e,t,!1,!1,n);var i=$("#"+e.tId+"_switch");$(i).addClass(this.treeicon||d)},t.prototype.postRenderTree=function(){var e=this;setTimeout((function(){if(e.changeTreeIcons(e.treeicon||d),e.datavalue&&!e.selecteditem){var t=e.treeObj.getNodes(),n=void 0;t.length&&("FirstNode"===e.datavalue&&(n=t[0]),"LastNode"===e.datavalue&&(n=t[t.length-1])),n&&(e.treeObj.selectNode(n,!1),e.selectNode(void 0,n),e.expandNode(n,!0,!1))}}),200)},t.prototype.selectById=function(e){var t=this,n=this.treeObj.transformToArray(this.treeObj.getNodes()).find((function(n){return e===i.getEvaluatedData(n,{field:t.nodeid,bindExpression:t.bindnodeid},t.viewParent)}));n&&(this.treeObj.selectNode(n,!1),this.selectNode(void 0,n))},t.prototype.deselectById=function(e){this.selecteditem={},this.selectById()},t}(i.StylableComponent);u.initializeProps=c(),u.decorators=[{type:t.Component,args:[{selector:"ul[wmTree]",template:'<ul #wmTree class="ztree" id="ztree"></ul> ',providers:[i.provideAsWidgetRef(u)],encapsulation:t.ViewEncapsulation.None}]}],u.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["nodeid.bind"]}]}]};var h=[u],m=function(){};m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(h)),exports:l([],s(h)),entryComponents:[]}]}],e.TreeComponent=u,e.TreeModule=m,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-bootstrap/datepicker"),require("@wm/core"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/input/calendar",["exports","@angular/core","@angular/common","@angular/forms","ngx-bootstrap/datepicker","@wm/core","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.calendar={}),e.ng.core,e.ng.common,e.ng.forms,e["ngx-bootstrap"].datepicker,e.wm.core,e.wm.components.base)}(this,(function(e,t,n,i,o,a,r){"use strict";
128
128
  /*! *****************************************************************************
129
129
  Copyright (c) Microsoft Corporation.
130
130
 
@@ -475,7 +475,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
475
475
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
476
476
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
477
477
  PERFORMANCE OF THIS SOFTWARE.
478
- ***************************************************************************** */var s=function(e,t){return(s=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)};Object.create;function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){a.register("wm-pagination",new Map([["boundarylinks",Object.assign({value:!1},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["dataset",a.PROP_ANY],["directionlinks",Object.assign({value:!0},a.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},a.PROP_BOOLEAN)],["maxResults",a.PROP_NUMBER],["maxsize",Object.assign({value:5},a.PROP_NUMBER)],["name",a.PROP_STRING],["navigation",Object.assign({value:"Basic"},a.PROP_STRING)],["navigationalign",Object.assign({value:"left"},a.PROP_STRING)],["navigationsize",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showrecordcount",a.PROP_BOOLEAN],["tabindex",Object.assign({value:0},a.PROP_NUMBER)]]))},d={widgetType:"wm-pagination",hostClass:"app-datanavigator clearfix"},u={Pager:{small:"pager-sm",large:"pager-lg"},Basic:{small:"pagination-sm",large:"pagination-lg"},Classic:{small:"pagination-sm",large:"pagination-lg"}},h=function(e){function n(n,i){var o=e.call(this,n,d)||this;return o.parent=i,o.resultEmitter=new t.EventEmitter,o.maxResultsEmitter=new t.EventEmitter,o.dn={currentPage:1},o.pageCount=0,o.isDisableNext=!0,o.isDisablePrevious=!0,o.isDisableFirst=!0,o.isDisableLast=!0,o._debouncedApplyDataset=r.debounce((function(){return o.widget.dataset=o.dataset}),a.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),o._debouncedPageChanged=r.debounce((function(e){var t=e&&e.page;if(t!==o.dn.currentPage){var n=o.parent||o;o.dn.currentPage=t,n.invokeEventCallback("paginationchange",{$event:void 0,$index:o.dn.currentPage}),o.goToPage(),"Basic"===o.navigation&&o._setAriaForBasicNavigation()}}),a.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),a.styler(o.nativeElement,o),o}return 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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype._setAriaForBasicNavigation=function(){_.forEach(this.nativeElement.getElementsByTagName("a"),(function(e){e.setAttribute("href","javascript:void(0);");var t=e.querySelector("span");"true"===(null==t?void 0:t.dataset.isacitvepage)&&(e.setAttribute("aria-current","true"),setTimeout((function(){return e.focus()}))),"true"===(null==t?void 0:t.dataset.isdisabled)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}))},n.prototype.setResult=function(e){this.result=e,this.resultEmitter.emit(this.result)},n.prototype.updateNavSize=function(){var e=u[this.navcontrols];e&&this.navigationsize?this.navigationClass=e[this.navigationsize]:this.navigationClass=""},n.prototype.resetPageNavigation=function(){this.pageCount=0,this.dn.currentPage=1,this.dataSize=0},n.prototype.calculatePagingValues=function(){this.pageCount=this.dataSize>this.maxResults?Math.ceil(this.dataSize/this.maxResults):this.dataSize<0?0:1,this.dn.currentPage=this.dn.currentPage||1},n.prototype.setDefaultPagingValues=function(e,t,n){e||t?(this.maxResults=t||this.maxResults,this.dataSize=r.isDefined(e)?e:this.dataSize,this.dn.currentPage=n||this.dn.currentPage,this.calculatePagingValues()):(this.pageCount=1,this.dn.currentPage=1,this.maxResults=e,this.dataSize=e),this.maxResultsEmitter.emit(this.maxResults)},n.prototype.checkDataSize=function(e,t,n){-1===e||e===r.AppConstants.INT_MAX_VALUE?(this.prevshowrecordcount=this.showrecordcount,this.isDisableLast=!0,this.isDisableCount=!0,this.showrecordcount=!1,t<n&&(this.isDisableNext=!0)):(this.isDisableCount=!1,this.showrecordcount=this.prevshowrecordcount||this.showrecordcount)},n.prototype.disableNavigation=function(){var e,t=1===this.dn.currentPage,n=this.dn.currentPage===this.pageCount;(null===(e=this.pagination)||void 0===e?void 0:e.next)?(this.isDisableFirst=this.isDisablePrevious=!this.pagination.prev,this.isDisableNext=this.isDisableLast=!this.pagination.next):(this.isDisableFirst=this.isDisablePrevious=t,this.isDisableNext=this.isDisableLast=n),this.isDisableCurrent=t&&n,this.dataset&&this.dataset.length&&this.isDisableNext&&this.parent.onDemandLoad&&"wm-table"===this.parent.widgetType&&this.parent.callDataGridMethod("hideLoadingIndicator",this.isDisableNext,this.parent.infScroll)},n.prototype.isDataSourceHasPaging=function(){return this.datasource&&this.datasource.execute(r.DataSource.Operation.IS_PAGEABLE)},n.prototype.setNonPageableData=function(e){var t,n,i,o;t=_.isArray(e)?e.length:_.isEmpty(e)?0:1,n=this.options&&this.options.maxResults||t,i=this.datasource&&(this.datasource.execute(r.DataSource.Operation.IS_API_AWARE)||"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(_.get(this.parent,"gridOptions.lastActionPerformed")===this.parent.gridOptions.ACTIONS.DATASET_UPDATE||!_.get(this.parent,"gridOptions.isNextPageData")))?1:this.dn.currentPage||1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),o=(this.dn.currentPage-1)*this.maxResults,this.setResult(_.isArray(e)?e.slice(o,o+this.maxResults):e)},n.prototype.setPagingValues=function(e){var t,n,i,o={};this.__fullData=e,this.binddataset?(o=(this.datasource||{})._options||{},e?this.isDataSourceHasPaging()?(this.pagination=this.datasource.execute(r.DataSource.Operation.GET_PAGING_OPTIONS)||{},this.filterFields=o.filterFields||{},this.logicalOp=o.logicalOp||"",this.sortOptions=o.orderBy||(_.isArray(this.pagination.sort)?a.getOrderByExpr(this.pagination.sort):""),t=this.pagination.totalElements,n=this.pagination.size,this.pagination.numberOfElements>0?(r.isDefined(this.pagination.number)&&(this.dn.currentPage=this.pagination.number+1),i=this.dn.currentPage||1):i=1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),this.checkDataSize(t,this.pagination.numberOfElements,this.pagination.size),this.setResult(e)):_.isString(e)||this.setNonPageableData(e):(this.setResult(e),this.resetPageNavigation()),"Basic"===this.navigation&&this._setAriaForBasicNavigation()):e&&!_.isString(e)&&this.setNonPageableData(e)},n.prototype.isFirstPage=function(){return 1===this.dn.currentPage||!this.dn.currentPage},n.prototype.isLastPage=function(){return this.dn.currentPage===this.pageCount},n.prototype.goToLastPage=function(e,t,n){this.isLastPage()?e&&this.goToPage(t,n):(this.dn.currentPage=this.pageCount,this.goToPage(t,n))},n.prototype.goToFirstPage=function(e,t,n){this.isFirstPage()?e&&this.goToPage(t,n):(this.dn.currentPage=1,this.goToPage(t,n))},n.prototype.goToPage=function(e,t){this.firstRow=(this.dn.currentPage-1)*this.maxResults;var n=this.parent.statePersistence.computeMode(this.statehandler);!n||"none"===n.toLowerCase()||"wm-table"!==this.parent.widgetType&&"wm-list"!==this.parent.widgetType||(this.parent._selectedItemsExist=!0,this.isFirstPage()?this.parent.statePersistence.removeWidgetState(this.parent,"pagination"):a.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation)<0?this.parent.statePersistence.setWidgetState(this.parent,{pagination:this.dn.currentPage}):"wm-list"!==this.parent.widgetType&&"wm-table"!==this.parent.widgetType||console.warn("Retain State handling on Widget "+this.parent.name+" is not supported for current pagination type.")),this.getPageData(e,t)},n.prototype.onPageDataReady=function(e,t,n){this.disableNavigation(),this.invokeSetRecord(e,t),r.triggerFn(n)},n.prototype.getPageData=function(e,t){var n,i,o=this;if(this.isDataSourceHasPaging()){var a=this.dn.currentPage;this.isEditNotInCurrentPage()&&"delete"!==this.parent.gridOptions.lastActionPerformed&&(a=this.parent.actionRowPage),this.datasource.execute(r.DataSource.Operation.LIST_RECORDS,{page:a,filterFields:this.filterFields,orderBy:this.sortOptions,logicalOp:this.logicalOp,matchMode:"anywhereignorecase"}).then((function(n){o.onPageDataReady(e,n&&n.data,t),r.$appDigest()}),(function(e){}))}else i=this.isEditNotInCurrentPage()?(this.parent.actionRowPage-1)*this.maxResults:(this.dn.currentPage-1)*this.maxResults,n=_.isArray(this.__fullData)?this.__fullData.slice(i,i+this.maxResults):this.__fullData,this.setResult(n),this.onPageDataReady(e,n,t)},n.prototype.isEditNotInCurrentPage=function(){var e=this.dn.currentPage;return"wm-table"===this.parent.widgetType&&e===this.parent.currentPage&&this.parent.actionRowPage&&this.parent.actionRowPage<e},n.prototype.invokeSetRecord=function(e,t){var n={currentPage:this.dn.currentPage,size:this.maxResults,totalElements:this.dataSize,totalPages:this.pageCount};this.parent?this.parent.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t}):this.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t})},n.prototype.validateCurrentPage=function(e,t){return!e||!(isNaN(this.dn.currentPage)||this.dn.currentPage<=0||this.pageCount&&(this.dn.currentPage>this.pageCount||_.isNull(this.dn.currentPage)))||(this.dn.currentPage<=0?this.dn.currentPage=1:this.dn.currentPage>this.pageCount&&(this.dn.currentPage=this.pageCount),!1)},n.prototype.onModelChange=function(e){this.validateCurrentPage(e)&&this.goToPage(e)},n.prototype.onKeyDown=function(e){var t=$(e.target).closest("a");return"KeyE"===e.code?(t.addClass("ng-invalid"),!1):(t.removeClass("ng-invalid"),!0)},n.prototype.pageChanged=function(e){this._debouncedPageChanged(e)},n.prototype.navigatePage=function(e,t,n,i){var o,a,s,l;switch(r.isDefined(this.parent.isDataLoading)&&!this.isDisableNext&&(this.parent.isDataLoading=!0,this.parent.infScroll&&(this.parent.variableInflight=!0,this.parent.callDataGridMethod("showLoadingIndicator",this.parent.loadingdatamsg,!0))),"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT),this.parent.gridOptions.setIsDatasetUpdated(!1)),this.invokeEventCallback("paginationchange",{$event:void 0,$index:this.dn.currentPage}),this.dn.currentPage=+this.dn.currentPage,e){case"first":return void this.goToFirstPage(n,t,i);case"prev":if(!((null===(o=this.pagination)||void 0===o?void 0:o.next)||!this.isFirstPage()&&this.validateCurrentPage(t,i)))return;(null===(a=this.pagination)||void 0===a?void 0:a.next)&&(this.datasource.pagination.isNext=!1,this.datasource.pagination.isPrev=!0),this.dn.currentPage-=1;break;case"next":if(!((null===(s=this.pagination)||void 0===s?void 0:s.next)||!this.isLastPage()&&this.validateCurrentPage(t,i)))return;(null===(l=this.pagination)||void 0===l?void 0:l.next)&&(this.datasource.pagination.isNext=!0,this.datasource.pagination.isPrev=!1),this.dn.currentPage+=1;break;case"last":return void this.goToLastPage(n,t,i)}this.goToPage(t,i)},n.prototype.setBindDataSet=function(e,t,n,i,o,a,s){var l,c=this,p=e.split(".");if(this.statehandler=s,"Variables"!==p[0]&&"Widgets"!==p[0]||(l=p[0]+"."+p[1]+".pagination"),!o&&i&&!a)return this.dataset=i,void this._debouncedApplyDataset();this.binddataset=e,setTimeout((function(){c.registerDestroyListener(r.$watch(e,t,a?n:{},(function(e){e?(c.dataset=e,c._debouncedApplyDataset()):c.widget.dataset=e}))),l&&c.registerDestroyListener(r.$watch(l,t,{},(function(){return c._debouncedApplyDataset()})))})),a||(this.datasource=n)},n.prototype.setDataSource=function(e){this.datasource=e},n.prototype.onPropertyChange=function(t,n,i){if("dataset"===t){var o=void 0;o=this.parent&&this.parent.onDataNavigatorDataSetChange?this.parent.onDataNavigatorDataSetChange(n):n,"wm-table"===this.parent.widgetType&&(this.parent._triggeredByUser=!1),this.isEditNotInCurrentPage()?this.setResult(o):this.setPagingValues(o)}else"navigation"===t?("Advanced"===n&&(this.navigation="Classic"),this.updateNavSize(),this.navcontrols=n):"navigationsize"===t?this.updateNavSize():"navigationalign"===t?r.switchClass(this.nativeElement,"text-"+n,"text-"+i):"maxResults"===t?this.setPagingValues(this.dataset):e.prototype.onPropertyChange.call(this,t,n,i)},n.prototype.ngAfterViewInit=function(){this.nativeElement.onclick=function(e){e.stopPropagation()}},n}(a.StylableComponent);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"[wmPagination]",template:'\n<ul class="pagination advanced {{navigationClass}}" *ngIf="navcontrols === \'Classic\'">\n <li [ngClass]="{\'disabled\':isDisableFirst}">\n <a [title]="appLocale.LABEL_FIRST" name="first" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableFirst"\n (click)="navigatePage(\'first\', $event)">\n <span aria-hidden="true"><i class="wi wi-first-page"></i></span>\n <span class="sr-only">Go to first page {{ isDisableFirst ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisablePrevious}">\n <a [title]="appLocale.LABEL_PREVIOUS" name="prev" href="javascript:void(0);"\n [attr.aria-disabled]="isDisablePrevious"\n (click)="navigatePage(\'prev\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n <span class="sr-only">Go to previous page {{ isDisablePrevious ? \', Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="pagecount disabled">\n <a href="javascript:void(0);">\n <input type="number" [disabled]="isDisableCurrent" [(ngModel)]="dn.currentPage" [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount"\n (keydown)="onKeyDown($event)" (change)="onModelChange($event)" class="form-control"/>\n </a>\n </li>\n <li class="disabled">\n <a [hidden]="isDisableCount"> / {{pageCount}}</a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableNext}">\n <a [title]="appLocale.LABEL_NEXT" name="next" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableNext"\n (click)="navigatePage(\'next\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n <span class="sr-only">Go to next page {{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableLast}">\n <a [title]="appLocale.LABEL_LAST" name="last" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableLast"\n (click)="navigatePage(\'last\', $event)">\n <span aria-hidden="true"><i class="wi wi-last-page"></i></span>\n <span class="sr-only">Go to last page {{ isDisableLast ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li *ngIf="showrecordcount" class="totalcount disabled">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n<ul class="pager {{navigationClass}}" *ngIf="navcontrols === \'Pager\'">\n <li class="previous" [ngClass]="{\'disabled\':isDisablePrevious}">\n <a href="javascript:void(0);" (click)="navigatePage(\'prev\', $event)"\n [attr.aria-disabled]="isDisablePrevious">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class="sr-only">{{ isDisablePrevious ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="next" [ngClass]="{\'disabled\':isDisableNext}">\n <a href="javascript:void(0);" (click)="navigatePage(\'next\', $event)"\n [attr.aria-disabled]="isDisableNext">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class="sr-only">{{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n</ul>\n\n<pagination class="pagination basic" [ngClass]="navigationClass" *ngIf="navcontrols === \'Basic\'" role="navigation"\n [itemsPerPage]="maxResults" [totalItems]="dataSize"\n [ngModel]="dn.currentPage" (pageChanged)="pageChanged($event)"\n [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount + \' pages\'"\n [boundaryLinks]="boundarylinks" [maxSize]="maxsize"\n [directionLinks]="directionlinks"\n firstText="Firtst" lastText="Last"\n [customPreviousTemplate]="prevTemplate"\n [customNextTemplate]="nextTemplate"\n [customPageTemplate]="pageTemplate"></pagination>\n\n<ul *ngIf="navcontrols === \'Basic\' && showrecordcount" class="pagination">\n <li class="totalcount disabled basiccount">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n\n<ng-template #pageTemplate let-page>\n <span class="sr-only" [attr.data-isacitvepage]="page.active">{{\'Page \'}}</span>\n {{page.number}}\n <span class="sr-only" *ngIf="page.active"> {{\', Showing page \' + page.number + \' of \' + pageCount}}</span>\n</ng-template>\n<ng-template #prevTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Previous page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Next page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n',providers:[a.provideAsWidgetRef(h)]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.SkipSelf},{type:t.Inject,args:[a.WidgetRef]}]}]},h.propDecorators={resultEmitter:[{type:t.Output}],maxResultsEmitter:[{type:t.Output}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.PaginationModule,a.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.PaginationComponent=h,e.PaginationModule=f,e["\u0275a"]=p,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/navigation/menu"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/data/card",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/navigation/menu","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.card={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.navigation.menu,e.wm.core)}(this,(function(e,t,n,i,o,a,r,s){"use strict";
478
+ ***************************************************************************** */var s=function(e,t){return(s=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)};Object.create;function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){a.register("wm-pagination",new Map([["boundarylinks",Object.assign({value:!1},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["dataset",a.PROP_ANY],["directionlinks",Object.assign({value:!0},a.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},a.PROP_BOOLEAN)],["maxResults",a.PROP_NUMBER],["maxsize",Object.assign({value:5},a.PROP_NUMBER)],["name",a.PROP_STRING],["navigation",Object.assign({value:"Basic"},a.PROP_STRING)],["navigationalign",Object.assign({value:"left"},a.PROP_STRING)],["navigationsize",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showrecordcount",a.PROP_BOOLEAN],["tabindex",Object.assign({value:0},a.PROP_NUMBER)]]))},d={widgetType:"wm-pagination",hostClass:"app-datanavigator clearfix"},u={Pager:{small:"pager-sm",large:"pager-lg"},Basic:{small:"pagination-sm",large:"pagination-lg"},Classic:{small:"pagination-sm",large:"pagination-lg"}},h=function(e){function n(n,i){var o=e.call(this,n,d)||this;return o.parent=i,o.resultEmitter=new t.EventEmitter,o.maxResultsEmitter=new t.EventEmitter,o.dn={currentPage:1},o.pageCount=0,o.isDisableNext=!0,o.isDisablePrevious=!0,o.isDisableFirst=!0,o.isDisableLast=!0,o._debouncedApplyDataset=r.debounce((function(){return o.widget.dataset=o.dataset}),a.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),o._debouncedPageChanged=r.debounce((function(e){var t=e&&e.page;if(t!==o.dn.currentPage){var n=o.parent||o;o.dn.currentPage=t,n.invokeEventCallback("paginationchange",{$event:void 0,$index:o.dn.currentPage}),o.goToPage(),"Basic"===o.navigation&&o._setAriaForBasicNavigation()}}),a.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),a.styler(o.nativeElement,o),o}return 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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype._setAriaForBasicNavigation=function(){_.forEach(this.nativeElement.getElementsByTagName("a"),(function(e){e.setAttribute("href","javascript:void(0);");var t=e.querySelector("span");"true"===(null==t?void 0:t.dataset.isacitvepage)&&e.setAttribute("aria-current","true"),"true"===(null==t?void 0:t.dataset.isdisabled)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}))},n.prototype.setResult=function(e){this.result=e,this.resultEmitter.emit(this.result)},n.prototype.updateNavSize=function(){var e=u[this.navcontrols];e&&this.navigationsize?this.navigationClass=e[this.navigationsize]:this.navigationClass=""},n.prototype.resetPageNavigation=function(){this.pageCount=0,this.dn.currentPage=1,this.dataSize=0},n.prototype.calculatePagingValues=function(){this.pageCount=this.dataSize>this.maxResults?Math.ceil(this.dataSize/this.maxResults):this.dataSize<0?0:1,this.dn.currentPage=this.dn.currentPage||1},n.prototype.setDefaultPagingValues=function(e,t,n){e||t?(this.maxResults=t||this.maxResults,this.dataSize=r.isDefined(e)?e:this.dataSize,this.dn.currentPage=n||this.dn.currentPage,this.calculatePagingValues()):(this.pageCount=1,this.dn.currentPage=1,this.maxResults=e,this.dataSize=e),this.maxResultsEmitter.emit(this.maxResults)},n.prototype.checkDataSize=function(e,t,n){-1===e||e===r.AppConstants.INT_MAX_VALUE?(this.prevshowrecordcount=this.showrecordcount,this.isDisableLast=!0,this.isDisableCount=!0,this.showrecordcount=!1,t<n&&(this.isDisableNext=!0)):(this.isDisableCount=!1,this.showrecordcount=this.prevshowrecordcount||this.showrecordcount)},n.prototype.disableNavigation=function(){var e,t=1===this.dn.currentPage,n=this.dn.currentPage===this.pageCount;(null===(e=this.pagination)||void 0===e?void 0:e.next)?(this.isDisableFirst=this.isDisablePrevious=!this.pagination.prev,this.isDisableNext=this.isDisableLast=!this.pagination.next):(this.isDisableFirst=this.isDisablePrevious=t,this.isDisableNext=this.isDisableLast=n),this.isDisableCurrent=t&&n,this.dataset&&this.dataset.length&&this.isDisableNext&&this.parent.onDemandLoad&&"wm-table"===this.parent.widgetType&&this.parent.callDataGridMethod("hideLoadingIndicator",this.isDisableNext,this.parent.infScroll)},n.prototype.isDataSourceHasPaging=function(){return this.datasource&&this.datasource.execute(r.DataSource.Operation.IS_PAGEABLE)},n.prototype.setNonPageableData=function(e){var t,n,i,o;t=_.isArray(e)?e.length:_.isEmpty(e)?0:1,n=this.options&&this.options.maxResults||t,i=this.datasource&&(this.datasource.execute(r.DataSource.Operation.IS_API_AWARE)||"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(_.get(this.parent,"gridOptions.lastActionPerformed")===this.parent.gridOptions.ACTIONS.DATASET_UPDATE||!_.get(this.parent,"gridOptions.isNextPageData")))?1:this.dn.currentPage||1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),o=(this.dn.currentPage-1)*this.maxResults,this.setResult(_.isArray(e)?e.slice(o,o+this.maxResults):e)},n.prototype.setPagingValues=function(e){var t,n,i,o={};this.__fullData=e,this.binddataset?(o=(this.datasource||{})._options||{},e?this.isDataSourceHasPaging()?(this.pagination=this.datasource.execute(r.DataSource.Operation.GET_PAGING_OPTIONS)||{},this.filterFields=o.filterFields||{},this.logicalOp=o.logicalOp||"",this.sortOptions=o.orderBy||(_.isArray(this.pagination.sort)?a.getOrderByExpr(this.pagination.sort):""),t=this.pagination.totalElements,n=this.pagination.size,this.pagination.numberOfElements>0?(r.isDefined(this.pagination.number)&&(this.dn.currentPage=this.pagination.number+1),i=this.dn.currentPage||1):i=1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),this.checkDataSize(t,this.pagination.numberOfElements,this.pagination.size),this.setResult(e)):_.isString(e)||this.setNonPageableData(e):(this.setResult(e),this.resetPageNavigation()),"Basic"===this.navigation&&this._setAriaForBasicNavigation()):e&&!_.isString(e)&&this.setNonPageableData(e)},n.prototype.isFirstPage=function(){return 1===this.dn.currentPage||!this.dn.currentPage},n.prototype.isLastPage=function(){return this.dn.currentPage===this.pageCount},n.prototype.goToLastPage=function(e,t,n){this.isLastPage()?e&&this.goToPage(t,n):(this.dn.currentPage=this.pageCount,this.goToPage(t,n))},n.prototype.goToFirstPage=function(e,t,n){this.isFirstPage()?e&&this.goToPage(t,n):(this.dn.currentPage=1,this.goToPage(t,n))},n.prototype.goToPage=function(e,t){this.firstRow=(this.dn.currentPage-1)*this.maxResults;var n=this.parent.statePersistence.computeMode(this.statehandler);!n||"none"===n.toLowerCase()||"wm-table"!==this.parent.widgetType&&"wm-list"!==this.parent.widgetType||(this.parent._selectedItemsExist=!0,this.isFirstPage()?this.parent.statePersistence.removeWidgetState(this.parent,"pagination"):a.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation)<0?this.parent.statePersistence.setWidgetState(this.parent,{pagination:this.dn.currentPage}):"wm-list"!==this.parent.widgetType&&"wm-table"!==this.parent.widgetType||console.warn("Retain State handling on Widget "+this.parent.name+" is not supported for current pagination type.")),this.getPageData(e,t)},n.prototype.onPageDataReady=function(e,t,n){this.disableNavigation(),this.invokeSetRecord(e,t),r.triggerFn(n)},n.prototype.getPageData=function(e,t){var n,i,o=this;if(this.isDataSourceHasPaging()){var a=this.dn.currentPage;this.isEditNotInCurrentPage()&&"delete"!==this.parent.gridOptions.lastActionPerformed&&(a=this.parent.actionRowPage),this.datasource.execute(r.DataSource.Operation.LIST_RECORDS,{page:a,filterFields:this.filterFields,orderBy:this.sortOptions,logicalOp:this.logicalOp,matchMode:"anywhereignorecase"}).then((function(n){o.onPageDataReady(e,n&&n.data,t),r.$appDigest()}),(function(e){}))}else i=this.isEditNotInCurrentPage()?(this.parent.actionRowPage-1)*this.maxResults:(this.dn.currentPage-1)*this.maxResults,n=_.isArray(this.__fullData)?this.__fullData.slice(i,i+this.maxResults):this.__fullData,this.setResult(n),this.onPageDataReady(e,n,t)},n.prototype.isEditNotInCurrentPage=function(){var e=this.dn.currentPage;return"wm-table"===this.parent.widgetType&&e===this.parent.currentPage&&this.parent.actionRowPage&&this.parent.actionRowPage<e},n.prototype.invokeSetRecord=function(e,t){var n={currentPage:this.dn.currentPage,size:this.maxResults,totalElements:this.dataSize,totalPages:this.pageCount};this.parent?this.parent.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t}):this.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t})},n.prototype.validateCurrentPage=function(e,t){return!e||!(isNaN(this.dn.currentPage)||this.dn.currentPage<=0||this.pageCount&&(this.dn.currentPage>this.pageCount||_.isNull(this.dn.currentPage)))||(this.dn.currentPage<=0?this.dn.currentPage=1:this.dn.currentPage>this.pageCount&&(this.dn.currentPage=this.pageCount),!1)},n.prototype.onModelChange=function(e){this.validateCurrentPage(e)&&this.goToPage(e)},n.prototype.onKeyDown=function(e){var t=$(e.target).closest("a");return"KeyE"===e.code?(t.addClass("ng-invalid"),!1):(t.removeClass("ng-invalid"),!0)},n.prototype.pageChanged=function(e){this._debouncedPageChanged(e)},n.prototype.navigatePage=function(e,t,n,i){var o,a,s,l;switch(r.isDefined(this.parent.isDataLoading)&&!this.isDisableNext&&(this.parent.isDataLoading=!0,this.parent.infScroll&&(this.parent.variableInflight=!0,this.parent.callDataGridMethod("showLoadingIndicator",this.parent.loadingdatamsg,!0))),"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT),this.parent.gridOptions.setIsDatasetUpdated(!1)),this.invokeEventCallback("paginationchange",{$event:void 0,$index:this.dn.currentPage}),this.dn.currentPage=+this.dn.currentPage,e){case"first":return void this.goToFirstPage(n,t,i);case"prev":if(!((null===(o=this.pagination)||void 0===o?void 0:o.next)||!this.isFirstPage()&&this.validateCurrentPage(t,i)))return;(null===(a=this.pagination)||void 0===a?void 0:a.next)&&(this.datasource.pagination.isNext=!1,this.datasource.pagination.isPrev=!0),this.dn.currentPage-=1;break;case"next":if(!((null===(s=this.pagination)||void 0===s?void 0:s.next)||!this.isLastPage()&&this.validateCurrentPage(t,i)))return;(null===(l=this.pagination)||void 0===l?void 0:l.next)&&(this.datasource.pagination.isNext=!0,this.datasource.pagination.isPrev=!1),this.dn.currentPage+=1;break;case"last":return void this.goToLastPage(n,t,i)}this.goToPage(t,i)},n.prototype.setBindDataSet=function(e,t,n,i,o,a,s){var l,c=this,p=e.split(".");if(this.statehandler=s,"Variables"!==p[0]&&"Widgets"!==p[0]||(l=p[0]+"."+p[1]+".pagination"),!o&&i&&!a)return this.dataset=i,void this._debouncedApplyDataset();this.binddataset=e,setTimeout((function(){c.registerDestroyListener(r.$watch(e,t,a?n:{},(function(e){e?(c.dataset=e,c._debouncedApplyDataset()):c.widget.dataset=e}))),l&&c.registerDestroyListener(r.$watch(l,t,{},(function(){return c._debouncedApplyDataset()})))})),a||(this.datasource=n)},n.prototype.setDataSource=function(e){this.datasource=e},n.prototype.onPropertyChange=function(t,n,i){if("dataset"===t){var o=void 0;o=this.parent&&this.parent.onDataNavigatorDataSetChange?this.parent.onDataNavigatorDataSetChange(n):n,"wm-table"===this.parent.widgetType&&(this.parent._triggeredByUser=!1),this.isEditNotInCurrentPage()?this.setResult(o):this.setPagingValues(o)}else"navigation"===t?("Advanced"===n&&(this.navigation="Classic"),this.updateNavSize(),this.navcontrols=n):"navigationsize"===t?this.updateNavSize():"navigationalign"===t?r.switchClass(this.nativeElement,"text-"+n,"text-"+i):"maxResults"===t?this.setPagingValues(this.dataset):e.prototype.onPropertyChange.call(this,t,n,i)},n.prototype.ngAfterViewInit=function(){this.nativeElement.onclick=function(e){e.stopPropagation()}},n}(a.StylableComponent);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"[wmPagination]",template:'\n<ul class="pagination advanced {{navigationClass}}" *ngIf="navcontrols === \'Classic\'">\n <li [ngClass]="{\'disabled\':isDisableFirst}">\n <a [title]="appLocale.LABEL_FIRST" name="first" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableFirst"\n (click)="navigatePage(\'first\', $event)">\n <span aria-hidden="true"><i class="wi wi-first-page"></i></span>\n <span class="sr-only">Go to first page {{ isDisableFirst ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisablePrevious}">\n <a [title]="appLocale.LABEL_PREVIOUS" name="prev" href="javascript:void(0);"\n [attr.aria-disabled]="isDisablePrevious"\n (click)="navigatePage(\'prev\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n <span class="sr-only">Go to previous page {{ isDisablePrevious ? \', Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="pagecount disabled">\n <a href="javascript:void(0);">\n <input type="number" [disabled]="isDisableCurrent" [(ngModel)]="dn.currentPage" [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount"\n (keydown)="onKeyDown($event)" (change)="onModelChange($event)" class="form-control"/>\n </a>\n </li>\n <li class="disabled">\n <a [hidden]="isDisableCount"> / {{pageCount}}</a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableNext}">\n <a [title]="appLocale.LABEL_NEXT" name="next" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableNext"\n (click)="navigatePage(\'next\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n <span class="sr-only">Go to next page {{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableLast}">\n <a [title]="appLocale.LABEL_LAST" name="last" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableLast"\n (click)="navigatePage(\'last\', $event)">\n <span aria-hidden="true"><i class="wi wi-last-page"></i></span>\n <span class="sr-only">Go to last page {{ isDisableLast ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li *ngIf="showrecordcount" class="totalcount disabled">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n<ul class="pager {{navigationClass}}" *ngIf="navcontrols === \'Pager\'">\n <li class="previous" [ngClass]="{\'disabled\':isDisablePrevious}">\n <a href="javascript:void(0);" (click)="navigatePage(\'prev\', $event)"\n [attr.aria-disabled]="isDisablePrevious">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class="sr-only">{{ isDisablePrevious ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="next" [ngClass]="{\'disabled\':isDisableNext}">\n <a href="javascript:void(0);" (click)="navigatePage(\'next\', $event)"\n [attr.aria-disabled]="isDisableNext">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class="sr-only">{{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n</ul>\n\n<pagination class="pagination basic" [ngClass]="navigationClass" *ngIf="navcontrols === \'Basic\'" role="navigation"\n [itemsPerPage]="maxResults" [totalItems]="dataSize"\n [ngModel]="dn.currentPage" (pageChanged)="pageChanged($event)"\n [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount + \' pages\'"\n [boundaryLinks]="boundarylinks" [maxSize]="maxsize"\n [directionLinks]="directionlinks"\n firstText="Firtst" lastText="Last"\n [customPreviousTemplate]="prevTemplate"\n [customNextTemplate]="nextTemplate"\n [customPageTemplate]="pageTemplate"></pagination>\n\n<ul *ngIf="navcontrols === \'Basic\' && showrecordcount" class="pagination">\n <li class="totalcount disabled basiccount">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n\n<ng-template #pageTemplate let-page>\n <span class="sr-only" [attr.data-isacitvepage]="page.active">{{\'Page \'}}</span>\n {{page.number}}\n <span class="sr-only" *ngIf="page.active"> {{\', Showing page \' + page.number + \' of \' + pageCount}}</span>\n</ng-template>\n<ng-template #prevTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Previous page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Next page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n',providers:[a.provideAsWidgetRef(h)]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.SkipSelf},{type:t.Inject,args:[a.WidgetRef]}]}]},h.propDecorators={resultEmitter:[{type:t.Output}],maxResultsEmitter:[{type:t.Output}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.PaginationModule,a.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.PaginationComponent=h,e.PaginationModule=f,e["\u0275a"]=p,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/navigation/menu"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/data/card",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/navigation/menu","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.card={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.navigation.menu,e.wm.core)}(this,(function(e,t,n,i,o,a,r,s){"use strict";
479
479
  /*! *****************************************************************************
480
480
  Copyright (c) Microsoft Corporation.
481
481
 
@@ -227302,8 +227302,11 @@ window.requestAnimationFrame = function() {
227302
227302
  });
227303
227303
  };
227304
227304
  BaseVariableManager.prototype.setRequestTrackId = function(response, variable) {
227305
- var _a, _b;
227306
- var requestTrackId = ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.get) && ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b.get("x-wm-request-track-id")) || (response === null || response === void 0 ? void 0 : response.headers["x-wm-request-track-id"]);
227305
+ if (response === void 0) {
227306
+ response = {};
227307
+ }
227308
+ response.headers = response.headers || {};
227309
+ var requestTrackId = response.headers.get && response.headers.get("x-wm-request-track-id") || response.headers["x-wm-request-track-id"];
227307
227310
  if (requestTrackId) {
227308
227311
  variable._requestTrackId = requestTrackId;
227309
227312
  }
@@ -228829,38 +228832,42 @@ window.requestAnimationFrame = function() {
228829
228832
  return info;
228830
228833
  };
228831
228834
  ServiceVariableManager.prototype.handleRequestMetaError = function(info, variable, success, errorCB, options) {
228832
- var err_type = lodash__WEBPACK_IMPORTED_MODULE_10___default().get(info, "error.type");
228833
- switch (err_type) {
228834
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:
228835
- (0, _util_oAuth_utils__WEBPACK_IMPORTED_MODULE_7__.performAuthorization)(undefined, info.securityDefnObj[_constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY], this.invoke.bind(this, variable, options, success, errorCB), null, this.getProviderInfo(variable, info.securityDefnObj["x-WM-PROVIDER_ID"]));
228836
- this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, true, true);
228837
- break;
228835
+ try {
228836
+ var err_type = lodash__WEBPACK_IMPORTED_MODULE_10___default().get(info, "error.type");
228837
+ switch (err_type) {
228838
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:
228839
+ (0, _util_oAuth_utils__WEBPACK_IMPORTED_MODULE_7__.performAuthorization)(undefined, info.securityDefnObj[_constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY], this.invoke.bind(this, variable, options, success, errorCB), null, this.getProviderInfo(variable, info.securityDefnObj["x-WM-PROVIDER_ID"]));
228840
+ this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, true, true);
228841
+ break;
228838
228842
 
228839
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:
228840
- info = this.handleAuthError(variable, success, errorCB, options);
228841
- this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
228842
- break;
228843
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:
228844
+ info = this.handleAuthError(variable, success, errorCB, options);
228845
+ this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
228846
+ break;
228843
228847
 
228844
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:
228845
- case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:
228846
- if (info.error.message) {
228847
- info.error.message = info.error.message.replace("$variable", variable.name);
228848
- var reasons = void 0;
228849
- if (err_type === _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING) {
228850
- reasons = [ "1. You did not Preview the app after creating a Variable for the imported service.", "2. You deleted the imported service this Variable is linked to." ];
228851
- } else {
228852
- reasons = [ "1. You haven't chosen an endpoint for " + options.operation + " operation for this Entity." ];
228848
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:
228849
+ case _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:
228850
+ if (info.error.message) {
228851
+ info.error.message = info.error.message.replace("$variable", variable.name);
228852
+ var reasons = void 0;
228853
+ if (err_type === _constants_variables_constants__WEBPACK_IMPORTED_MODULE_5__.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING) {
228854
+ reasons = [ "1. You did not Preview the app after creating a Variable for the imported service.", "2. You deleted the imported service this Variable is linked to." ];
228855
+ } else {
228856
+ reasons = [ "1. You haven't chosen an endpoint for " + options.operation + " operation for this Entity." ];
228857
+ }
228858
+ console.warn(info.error.message + "\n Possible reasons for this:\n " + reasons.join("\n "));
228853
228859
  }
228854
- console.warn(info.error.message + "\n Possible reasons for this:\n " + reasons.join("\n "));
228855
- }
228856
- this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
228857
- break;
228858
-
228859
- default:
228860
- if (info.error.message) {
228861
- console.warn(info.error.message, variable.name);
228862
228860
  this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
228861
+ break;
228862
+
228863
+ default:
228864
+ if (info.error.message) {
228865
+ console.warn(info.error.message, variable.name);
228866
+ this.processErrorResponse(variable, info.error.message, errorCB, options.xhrObj, options.skipNotification, info.error.skipDefaultNotification);
228867
+ }
228863
228868
  }
228869
+ } catch (err) {
228870
+ console.error(err);
228864
228871
  }
228865
228872
  return info;
228866
228873
  };
@@ -228981,6 +228988,7 @@ window.requestAnimationFrame = function() {
228981
228988
  var info = this.handleRequestMetaError(requestParams, variable, success, error, options);
228982
228989
  var reason = (lodash__WEBPACK_IMPORTED_MODULE_10___default().get(info, "error.message") || "An error occurred while triggering the variable: ") + ": " + variable.name;
228983
228990
  (0, _util_utils__WEBPACK_IMPORTED_MODULE_0__.triggerFn)(error);
228991
+ _util_inflight_queue__WEBPACK_IMPORTED_MODULE_3__.$queue.process(variable);
228984
228992
  return Promise.reject(reason);
228985
228993
  }
228986
228994
  if (_util_variable_service_variable_utils__WEBPACK_IMPORTED_MODULE_2__.ServiceVariableUtils.isFileUploadRequest(variable)) {
@@ -4483,7 +4483,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.
4483
4483
  /*!*******************************************************!*\
4484
4484
  !*** ./src/manager/variable/base-variable.manager.ts ***!
4485
4485
  \*******************************************************/
4486
- (e,t,n)=>{"use strict";n.r(t),n.d(t,{BaseVariableManager:()=>a});var r=n(/*! ./../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),i=n(/*! lodash */"./node_modules/lodash/lodash.js"),o=n.n(i),a=function(){function e(){}return e.prototype.initBinding=function(e,t,n){},e.prototype.notifyInflight=function(e,t,n,i){r.appManager&&r.appManager.notify("toggle-variable-state",{variable:e,active:t,data:n,options:i})},e.prototype.setRequestTrackId=function(e,t){var n,r,i=(null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.get)&&(null===(r=null==e?void 0:e.headers)||void 0===r?void 0:r.get("x-wm-request-track-id"))||(null==e?void 0:e.headers["x-wm-request-track-id"]);i&&(t._requestTrackId=i)},e.prototype.httpCall=function(e,t,n){var r=this;return new Promise((function(n,i){e._source="variable",t.httpService.sendCall(e,t).then((function(e){(e&&e.type||e&&e.status)&&(r.setRequestTrackId(e,t),n(e))}),(function(e){r.setRequestTrackId(e,t),t.httpService.isPlatformSessionTimeout&&t.httpService.isPlatformSessionTimeout(e)?(r.notifyInflight(t,!1,e),e._401Subscriber.asObservable().subscribe((function(e){return n(e)}),(function(e){return i(e)}))):i(e)}))}))},e.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&o().extend(n,t),n},e}()},"./src/manager/variable/crud-variable.manager.ts":
4486
+ (e,t,n)=>{"use strict";n.r(t),n.d(t,{BaseVariableManager:()=>a});var r=n(/*! ./../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),i=n(/*! lodash */"./node_modules/lodash/lodash.js"),o=n.n(i),a=function(){function e(){}return e.prototype.initBinding=function(e,t,n){},e.prototype.notifyInflight=function(e,t,n,i){r.appManager&&r.appManager.notify("toggle-variable-state",{variable:e,active:t,data:n,options:i})},e.prototype.setRequestTrackId=function(e,t){void 0===e&&(e={}),e.headers=e.headers||{};var n=e.headers.get&&e.headers.get("x-wm-request-track-id")||e.headers["x-wm-request-track-id"];n&&(t._requestTrackId=n)},e.prototype.httpCall=function(e,t,n){var r=this;return new Promise((function(n,i){e._source="variable",t.httpService.sendCall(e,t).then((function(e){(e&&e.type||e&&e.status)&&(r.setRequestTrackId(e,t),n(e))}),(function(e){r.setRequestTrackId(e,t),t.httpService.isPlatformSessionTimeout&&t.httpService.isPlatformSessionTimeout(e)?(r.notifyInflight(t,!1,e),e._401Subscriber.asObservable().subscribe((function(e){return n(e)}),(function(e){return i(e)}))):i(e)}))}))},e.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&o().extend(n,t),n},e}()},"./src/manager/variable/crud-variable.manager.ts":
4487
4487
  /*!*******************************************************!*\
4488
4488
  !*** ./src/manager/variable/crud-variable.manager.ts ***!
4489
4489
  \*******************************************************/
@@ -4499,7 +4499,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.
4499
4499
  /*!**********************************************************!*\
4500
4500
  !*** ./src/manager/variable/service-variable.manager.ts ***!
4501
4501
  \**********************************************************/
4502
- (e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableManager:()=>g});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ../../util/file-upload.util */"./src/util/file-upload.util.ts"),a=n(/*! ../../util/variable/service-variable.utils */"./src/util/variable/service-variable.utils.ts"),s=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),u=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),l=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),c=n(/*! ../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),d=n(/*! ../../util/oAuth.utils */"./src/util/oAuth.utils.ts"),p=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),h=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),f=n(/*! lodash */"./node_modules/lodash/lodash.js"),m=n.n(f),v=(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)}),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fileUploadResponse=[],t.fileUploadCount=0,t.totalFilesCount=0,t.successFileUploadCount=0,t.failedFileUploadCount=0,t}return v(t,e),t.prototype.processErrorResponse=function(e,t,n,r,o,a){var u=this.getMethodInfo(e,{},{}),p=m().get(u,"securityDefinitions.0"),f=this.prepareCallbackOptions(r);o||(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,f,a),m().get(p,"type")===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2&&m().includes([l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.UNAUTHORIZED,l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.FORBIDDEN],m().get(r,"status"))&&(0,d.removeAccessToken)(p["x-WM-PROVIDER_ID"]),(0,i.triggerFn)(n,t),e.notify(h.VariableEvents.AFTER_INVOKE,[this,t]),l.CONSTANTS.isStudioMode||(e.canUpdate=!0,s.$queue.process(e),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,t,f))},t.prototype.processSuccessResponse=function(e,t,n,r,o,a){var u,d,f,v={},g=(0,i.getValidJSON)(e);e=(0,i.isDefined)(g)?g:(0,i.xmlToJson)(e)||e;var y=(0,i.isPageable)(e);if("DataService"===t.serviceType||"JavaService"===t.serviceType){var _=(0,c.decodeData)(e);m().isString(e)&&(e=_)}y?(u=e.content,v=m().omit(e,"content")):u=e,f=this.prepareCallbackOptions(n.xhrObj,{pagination:v,rawData:u}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,e,f),(0,i.triggerFn)(r,e,v),t.transformationColumns&&this.transformData(e,t),u=m().isObject(u)?u:{value:u},d=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,u,f),(0,i.isDefined)(d)&&(u=d);var b=(0,i.getClonedObject)(n.inputFields||t.dataBinding),w=a||this.getMethodInfo(t,b,n),S=p.PaginationUtils.getPaginationInfo(w,t);if(S){var E=p.PaginationUtils.generatePaginationRes(w,S,e,o,n,t);m().isEmpty(E)||p.PaginationUtils.setVariablePagination(t,E,n)}return n.forceRunMode||n.skipDataSetUpdate||(t._paginationConfig||(t.pagination=v),t.dataSet=u,y&&Object.defineProperty(t.dataSet,"content",{get:function(){return t.dataSet}})),t.notify(h.VariableEvents.AFTER_INVOKE,[this,u]),setTimeout((function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,u,f),l.CONSTANTS.isStudioMode||(t.canUpdate=!0,s.$queue.process(t)),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,u,f)})),{data:t.dataSet,pagination:t.pagination}},t.prototype.uploadFileInFormData=function(e,t,n,r,i,a){var s=this,u=(0,o.upload)(i,e,a.data,{fileParamName:"files",url:a.url});return u.then((function(r){return s.fileUploadCount++,s.successFileUploadCount++,s.fileUploadResponse.push(r[0]),s.totalFilesCount===s.fileUploadCount&&(0===s.failedFileUploadCount?(s.processSuccessResponse(s.fileUploadResponse,e,t,n),s.fileUploadResponse=[],e.onSuccess||c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_SUCCESS,"success")):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,s.fileUploadResponse),s.fileUploadResponse=[],c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_ERROR,"error")),s.fileUploadCount=0,s.successFileUploadCount=0,s.totalFilesCount=0),r}),(function(n){s.fileUploadCount++,s.failedFileUploadCount++,s.fileUploadResponse.push(n);var o=(0,c.getErrMessage)(n,e.httpService.getLocale());return e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o}),s.totalFilesCount===s.fileUploadCount&&(s.processErrorResponse(e,o,r,n,t.skipNotification),s.fileUploadResponse=[],s.fileUploadCount=0,s.failedFileUploadCount=0,s.totalFilesCount=0),n}),(function(t){return e._progressObservable&&e._progressObservable.next({progress:t,status:l.VARIABLE_CONSTANTS.EVENT.PROGRESS,fileName:i.name}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PROGRESS,e,t),t})),u},t.prototype.handleAuthError=function(e,t,n,r){var i;return m().get(c.securityService.get(),"authenticated")?i={error:{message:"You're not authorised to access the resource \""+e.service+'".'}}:(i={error:{message:"You're not authenticated to access the resource \""+e.service+'".',skipDefaultNotification:!0}},c.appManager.pushToSessionFailureRequests(e.invoke.bind(e,r,t,n)),c.appManager.handle401()),console.warn(e.name+": "+i.error.message),i},t.prototype.handleRequestMetaError=function(e,t,n,r,i){var o=m().get(e,"error.type");switch(o){case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:(0,d.performAuthorization)(void 0,e.securityDefnObj[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],this.invoke.bind(this,t,i,n,r),null,this.getProviderInfo(t,e.securityDefnObj["x-WM-PROVIDER_ID"])),this.processErrorResponse(t,e.error.message,r,i.xhrObj,!0,!0);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:e=this.handleAuthError(t,n,r,i),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:if(e.error.message){e.error.message=e.error.message.replace("$variable",t.name);var a=void 0;a=o===l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING?["1. You did not Preview the app after creating a Variable for the imported service.","2. You deleted the imported service this Variable is linked to."]:["1. You haven't chosen an endpoint for "+i.operation+" operation for this Entity."],console.warn(e.error.message+"\n Possible reasons for this:\n "+a.join("\n "))}this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;default:e.error.message&&(console.warn(e.error.message,t.name),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification))}return e},t.prototype.transformData=function(e,t){e.wmTransformedData=[];var n=t.transformationColumns,r=m().get(e,t.dataField)||[],i=e.wmTransformedData;m().forEach(r,(function(e,t){i[t]={},m().forEach(n,(function(n,r){i[t][n]=e[r]}))}))},t.prototype.getMethodInfo=function(e,t,n){var r;if(m().isEmpty(c.metadataService))r=e.serviceInfo;else{var o=(0,i.getClonedObject)(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()));r=null===o?null:m().get(o,"wmServiceOperationInfo")}if(!r)return r;var a=m().get(r.securityDefinitions,"0"),s=a&&a.type===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2;return r.parameters&&r.parameters.forEach((function(r){r.readOnly||(r.sampleValue=t[r.name],-1!==l.VARIABLE_CONSTANTS.PAGINATION_PARAMS.indexOf(r.name)?"size"===r.name?r.sampleValue=n.size||r.sampleValue||parseInt(e.maxResults,10):"page"===r.name?r.sampleValue=n.page||r.sampleValue||1:"sort"===r.name&&(r.sampleValue=(0,c.getEvaluatedOrderBy)(e.orderBy,n.orderBy)||r.sampleValue||""):"access_token"===r.name&&s&&(r.sampleValue=(0,d.getAccessToken)(a[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))})),r},t.prototype.getProviderInfo=function(e,t){return(0,i.getClonedObject)(null===c.metadataService||void 0===c.metadataService?void 0:c.metadataService.getByProviderId(t,e.getPrefabName()))},t.prototype.isFileUploadInProgress=function(e){var t=!1;return m().forEach(e,(function(e){m().isArray(e)&&e[0]instanceof File&&m().forEach(e,(function(e){"onProgress"!==e.status||(t=!0)}))})),t},t.prototype.uploadFile=function(e,t,n,r,i,o){var a=this,s=0,u=[],l=[];if(m().forEach(i,(function(e){m().isArray(e)?(e[0]instanceof File&&s++,m().forEach(e,(function(e){(e instanceof File||m().find(m().values(e),(function(e){return e instanceof Blob})))&&(u.push(e),a.totalFilesCount++,s=s||1)}))):e instanceof File&&(s++,a.totalFilesCount++,u.push(e))})),1===s)return i.files.length>1?(m().forEach(u,(function(i){l.push(a.uploadFileInFormData(e,t,n,r,i,o))})),Promise.all(l)):this.uploadFileInFormData(e,t,n,r,u[0],o)},t.prototype._invoke=function(e,t,n,r){var o,u,d=this,p=(0,i.getClonedObject)(t.inputFields||e.dataBinding),h=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,p,t);if(!1===h)return s.$queue.process(e),void(0,i.triggerFn)(r);m().isObject(h)&&(p=h);var f=this.getMethodInfo(e,p,t),v=a.ServiceVariableUtils.constructRequestParams(e,f,p,t);if(v.error){var g=this.handleRequestMetaError(v,e,n,r,t),y=(m().get(g,"error.message")||"An error occurred while triggering the variable: ")+": "+e.name;return(0,i.triggerFn)(r),Promise.reject(y)}if(a.ServiceVariableUtils.isFileUploadRequest(e)){var _=this.uploadFile(e,t,n,r,p,v);if(_)return _}return f&&m().isArray(f.produces)&&m().includes(f.produces,l.WS_CONSTANTS.CONTENT_TYPES.OCTET_STREAM)?e.simulateFileDownload(v,e.dataBinding.file||e.name,e.dataBinding.exportType,(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(n)}),(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(r)})):(this.notifyInflight(e,!t.skipToggleState),o=function(r,i){if(r&&r.type||r&&r.status){var o=r.body||r.data,a=d.processSuccessResponse(o,e,m().extend(t,{xhrObj:r}),n,r.headers);d.notifyInflight(e,!1,a),i(r)}},u=function(n,i){var o=(0,c.getErrMessage)(n,e.httpService.getLocale());d.notifyInflight(e,!1),d.processErrorResponse(e,o,r,n,t.skipNotification),i({error:o,details:n})},new Promise((function(t,n){v.responseType="text",e.httpService.sendCall(v,e).then((function(e){o(e,t)}),(function(e){var t=(0,i.getValidJSON)(e.error);e.error=(0,i.isDefined)(t)?t:e.error,u(e,n)}))})))},t.prototype.invoke=function(e,t,n,r){return(t=t||{}).inputFields=t.inputFields||(0,i.getClonedObject)(e.dataBinding),s.$queue.submit(e).then(this._invoke.bind(this,e,t,n,r),r)},t.prototype.setPagination=function(e,t){e._paginationConfig=t},t.prototype.download=function(e,t,n,r){t=t||{};var o,s=(0,i.getClonedObject)(e.dataBinding),u=t.data||{},d=this.getMethodInfo(e,s,t);return d.relativePath+="/export",(o=a.ServiceVariableUtils.constructRequestParams(e,d,s)).data=u,o.data.fields=(0,c.formatExportExpression)(u.fields||[]),o.method=t.httpMethod||"POST",o.url=t.url||o.url,m().hasIn(o,"error.message")?((0,i.triggerFn)(r,o.error.message),Promise.reject(o.error.message)):e.httpService.send(o).then((function(t){t&&(0,i.isValidWebURL)(t.body.result)?(window.location.href=t.body.result,(0,i.triggerFn)(n,t)):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t),(0,i.triggerFn)(r,t))}),(function(t,n){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,n),(0,i.triggerFn)(r,t)}))},t.prototype.getInputParms=function(e){var t;return t=m().isEmpty(c.metadataService)?e.serviceInfo:m().get(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()),"wmServiceOperationInfo"),m().get(t,"parameters")},t.prototype.setInput=function(e,t,n,r){return(0,c.setInput)(e.dataBinding,t,n,r)},t.prototype.cancel=function(e,t){s.$queue.requestsQueue.has(e)&&(a.ServiceVariableUtils.isFileUploadRequest(e)?(e.httpService.cancel(e,t),t.status="abort",this.totalFilesCount--,(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ABORT,e,t),this.isFileUploadInProgress(e.dataBinding)||0!==this.totalFilesCount||(s.$queue.process(e),this.notifyInflight(e,!1))):e.httpService.cancel&&(e.httpService.cancel(e),s.$queue.process(e),this.notifyInflight(e,!1)))},t.prototype.defineFirstLastRecord=function(e){e.isList&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().head(t&&t.content)||m().head(t)||{}}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().last(t&&t.content)||m().last(t)||{}}}))},t.prototype.getQueryParams=function(e,t,n){var r=this.getInputParms(n),i=a.ServiceVariableUtils.excludePaginationParams(r),o={};return m().map(n.dataBinding,(function(e,t){o[t]=e})),m().forEach(e,(function(e){m().includes(i,e)&&(o[e]=t)})),o},t.prototype.searchRecords=function(e,t,n,r){var o=this.getQueryParams(m().split(t.searchKey,","),t.query,e),a={page:t.page,pagesize:t.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",inputFields:o};return t.onBeforeservicecall&&t.onBeforeservicecall(o),this.invoke(e,a,n,r).catch(i.noop)},t}(u.BaseVariableManager)},"./src/model/action/timer-action.ts":
4502
+ (e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableManager:()=>g});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ../../util/file-upload.util */"./src/util/file-upload.util.ts"),a=n(/*! ../../util/variable/service-variable.utils */"./src/util/variable/service-variable.utils.ts"),s=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),u=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),l=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),c=n(/*! ../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),d=n(/*! ../../util/oAuth.utils */"./src/util/oAuth.utils.ts"),p=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),h=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),f=n(/*! lodash */"./node_modules/lodash/lodash.js"),m=n.n(f),v=(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)}),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fileUploadResponse=[],t.fileUploadCount=0,t.totalFilesCount=0,t.successFileUploadCount=0,t.failedFileUploadCount=0,t}return v(t,e),t.prototype.processErrorResponse=function(e,t,n,r,o,a){var u=this.getMethodInfo(e,{},{}),p=m().get(u,"securityDefinitions.0"),f=this.prepareCallbackOptions(r);o||(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,f,a),m().get(p,"type")===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2&&m().includes([l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.UNAUTHORIZED,l.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.FORBIDDEN],m().get(r,"status"))&&(0,d.removeAccessToken)(p["x-WM-PROVIDER_ID"]),(0,i.triggerFn)(n,t),e.notify(h.VariableEvents.AFTER_INVOKE,[this,t]),l.CONSTANTS.isStudioMode||(e.canUpdate=!0,s.$queue.process(e),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,t,f))},t.prototype.processSuccessResponse=function(e,t,n,r,o,a){var u,d,f,v={},g=(0,i.getValidJSON)(e);e=(0,i.isDefined)(g)?g:(0,i.xmlToJson)(e)||e;var y=(0,i.isPageable)(e);if("DataService"===t.serviceType||"JavaService"===t.serviceType){var _=(0,c.decodeData)(e);m().isString(e)&&(e=_)}y?(u=e.content,v=m().omit(e,"content")):u=e,f=this.prepareCallbackOptions(n.xhrObj,{pagination:v,rawData:u}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.RESULT,t,e,f),(0,i.triggerFn)(r,e,v),t.transformationColumns&&this.transformData(e,t),u=m().isObject(u)?u:{value:u},d=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,u,f),(0,i.isDefined)(d)&&(u=d);var b=(0,i.getClonedObject)(n.inputFields||t.dataBinding),w=a||this.getMethodInfo(t,b,n),S=p.PaginationUtils.getPaginationInfo(w,t);if(S){var E=p.PaginationUtils.generatePaginationRes(w,S,e,o,n,t);m().isEmpty(E)||p.PaginationUtils.setVariablePagination(t,E,n)}return n.forceRunMode||n.skipDataSetUpdate||(t._paginationConfig||(t.pagination=v),t.dataSet=u,y&&Object.defineProperty(t.dataSet,"content",{get:function(){return t.dataSet}})),t.notify(h.VariableEvents.AFTER_INVOKE,[this,u]),setTimeout((function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,u,f),l.CONSTANTS.isStudioMode||(t.canUpdate=!0,s.$queue.process(t)),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,u,f)})),{data:t.dataSet,pagination:t.pagination}},t.prototype.uploadFileInFormData=function(e,t,n,r,i,a){var s=this,u=(0,o.upload)(i,e,a.data,{fileParamName:"files",url:a.url});return u.then((function(r){return s.fileUploadCount++,s.successFileUploadCount++,s.fileUploadResponse.push(r[0]),s.totalFilesCount===s.fileUploadCount&&(0===s.failedFileUploadCount?(s.processSuccessResponse(s.fileUploadResponse,e,t,n),s.fileUploadResponse=[],e.onSuccess||c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_SUCCESS,"success")):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,s.fileUploadResponse),s.fileUploadResponse=[],c.appManager&&c.appManager.notifyApp(c.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_ERROR,"error")),s.fileUploadCount=0,s.successFileUploadCount=0,s.totalFilesCount=0),r}),(function(n){s.fileUploadCount++,s.failedFileUploadCount++,s.fileUploadResponse.push(n);var o=(0,c.getErrMessage)(n,e.httpService.getLocale());return e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o}),s.totalFilesCount===s.fileUploadCount&&(s.processErrorResponse(e,o,r,n,t.skipNotification),s.fileUploadResponse=[],s.fileUploadCount=0,s.failedFileUploadCount=0,s.totalFilesCount=0),n}),(function(t){return e._progressObservable&&e._progressObservable.next({progress:t,status:l.VARIABLE_CONSTANTS.EVENT.PROGRESS,fileName:i.name}),(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.PROGRESS,e,t),t})),u},t.prototype.handleAuthError=function(e,t,n,r){var i;return m().get(c.securityService.get(),"authenticated")?i={error:{message:"You're not authorised to access the resource \""+e.service+'".'}}:(i={error:{message:"You're not authenticated to access the resource \""+e.service+'".',skipDefaultNotification:!0}},c.appManager.pushToSessionFailureRequests(e.invoke.bind(e,r,t,n)),c.appManager.handle401()),console.warn(e.name+": "+i.error.message),i},t.prototype.handleRequestMetaError=function(e,t,n,r,i){try{var o=m().get(e,"error.type");switch(o){case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:(0,d.performAuthorization)(void 0,e.securityDefnObj[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],this.invoke.bind(this,t,i,n,r),null,this.getProviderInfo(t,e.securityDefnObj["x-WM-PROVIDER_ID"])),this.processErrorResponse(t,e.error.message,r,i.xhrObj,!0,!0);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:e=this.handleAuthError(t,n,r,i),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:case l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:if(e.error.message){e.error.message=e.error.message.replace("$variable",t.name);var a=void 0;a=o===l.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING?["1. You did not Preview the app after creating a Variable for the imported service.","2. You deleted the imported service this Variable is linked to."]:["1. You haven't chosen an endpoint for "+i.operation+" operation for this Entity."],console.warn(e.error.message+"\n Possible reasons for this:\n "+a.join("\n "))}this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;default:e.error.message&&(console.warn(e.error.message,t.name),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification))}}catch(e){console.error(e)}return e},t.prototype.transformData=function(e,t){e.wmTransformedData=[];var n=t.transformationColumns,r=m().get(e,t.dataField)||[],i=e.wmTransformedData;m().forEach(r,(function(e,t){i[t]={},m().forEach(n,(function(n,r){i[t][n]=e[r]}))}))},t.prototype.getMethodInfo=function(e,t,n){var r;if(m().isEmpty(c.metadataService))r=e.serviceInfo;else{var o=(0,i.getClonedObject)(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()));r=null===o?null:m().get(o,"wmServiceOperationInfo")}if(!r)return r;var a=m().get(r.securityDefinitions,"0"),s=a&&a.type===l.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2;return r.parameters&&r.parameters.forEach((function(r){r.readOnly||(r.sampleValue=t[r.name],-1!==l.VARIABLE_CONSTANTS.PAGINATION_PARAMS.indexOf(r.name)?"size"===r.name?r.sampleValue=n.size||r.sampleValue||parseInt(e.maxResults,10):"page"===r.name?r.sampleValue=n.page||r.sampleValue||1:"sort"===r.name&&(r.sampleValue=(0,c.getEvaluatedOrderBy)(e.orderBy,n.orderBy)||r.sampleValue||""):"access_token"===r.name&&s&&(r.sampleValue=(0,d.getAccessToken)(a[l.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))})),r},t.prototype.getProviderInfo=function(e,t){return(0,i.getClonedObject)(null===c.metadataService||void 0===c.metadataService?void 0:c.metadataService.getByProviderId(t,e.getPrefabName()))},t.prototype.isFileUploadInProgress=function(e){var t=!1;return m().forEach(e,(function(e){m().isArray(e)&&e[0]instanceof File&&m().forEach(e,(function(e){"onProgress"!==e.status||(t=!0)}))})),t},t.prototype.uploadFile=function(e,t,n,r,i,o){var a=this,s=0,u=[],l=[];if(m().forEach(i,(function(e){m().isArray(e)?(e[0]instanceof File&&s++,m().forEach(e,(function(e){(e instanceof File||m().find(m().values(e),(function(e){return e instanceof Blob})))&&(u.push(e),a.totalFilesCount++,s=s||1)}))):e instanceof File&&(s++,a.totalFilesCount++,u.push(e))})),1===s)return i.files.length>1?(m().forEach(u,(function(i){l.push(a.uploadFileInFormData(e,t,n,r,i,o))})),Promise.all(l)):this.uploadFileInFormData(e,t,n,r,u[0],o)},t.prototype._invoke=function(e,t,n,r){var o,u,d=this,p=(0,i.getClonedObject)(t.inputFields||e.dataBinding),h=(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,p,t);if(!1===h)return s.$queue.process(e),void(0,i.triggerFn)(r);m().isObject(h)&&(p=h);var f=this.getMethodInfo(e,p,t),v=a.ServiceVariableUtils.constructRequestParams(e,f,p,t);if(v.error){var g=this.handleRequestMetaError(v,e,n,r,t),y=(m().get(g,"error.message")||"An error occurred while triggering the variable: ")+": "+e.name;return(0,i.triggerFn)(r),s.$queue.process(e),Promise.reject(y)}if(a.ServiceVariableUtils.isFileUploadRequest(e)){var _=this.uploadFile(e,t,n,r,p,v);if(_)return _}return f&&m().isArray(f.produces)&&m().includes(f.produces,l.WS_CONSTANTS.CONTENT_TYPES.OCTET_STREAM)?e.simulateFileDownload(v,e.dataBinding.file||e.name,e.dataBinding.exportType,(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(n)}),(function(){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,null,null,null),s.$queue.process(e),(0,i.triggerFn)(r)})):(this.notifyInflight(e,!t.skipToggleState),o=function(r,i){if(r&&r.type||r&&r.status){var o=r.body||r.data,a=d.processSuccessResponse(o,e,m().extend(t,{xhrObj:r}),n,r.headers);d.notifyInflight(e,!1,a),i(r)}},u=function(n,i){var o=(0,c.getErrMessage)(n,e.httpService.getLocale());d.notifyInflight(e,!1),d.processErrorResponse(e,o,r,n,t.skipNotification),i({error:o,details:n})},new Promise((function(t,n){v.responseType="text",e.httpService.sendCall(v,e).then((function(e){o(e,t)}),(function(e){var t=(0,i.getValidJSON)(e.error);e.error=(0,i.isDefined)(t)?t:e.error,u(e,n)}))})))},t.prototype.invoke=function(e,t,n,r){return(t=t||{}).inputFields=t.inputFields||(0,i.getClonedObject)(e.dataBinding),s.$queue.submit(e).then(this._invoke.bind(this,e,t,n,r),r)},t.prototype.setPagination=function(e,t){e._paginationConfig=t},t.prototype.download=function(e,t,n,r){t=t||{};var o,s=(0,i.getClonedObject)(e.dataBinding),u=t.data||{},d=this.getMethodInfo(e,s,t);return d.relativePath+="/export",(o=a.ServiceVariableUtils.constructRequestParams(e,d,s)).data=u,o.data.fields=(0,c.formatExportExpression)(u.fields||[]),o.method=t.httpMethod||"POST",o.url=t.url||o.url,m().hasIn(o,"error.message")?((0,i.triggerFn)(r,o.error.message),Promise.reject(o.error.message)):e.httpService.send(o).then((function(t){t&&(0,i.isValidWebURL)(t.body.result)?(window.location.href=t.body.result,(0,i.triggerFn)(n,t)):((0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t),(0,i.triggerFn)(r,t))}),(function(t,n){(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,n),(0,i.triggerFn)(r,t)}))},t.prototype.getInputParms=function(e){var t;return t=m().isEmpty(c.metadataService)?e.serviceInfo:m().get(c.metadataService.getByOperationId(e.operationId,e.getPrefabName()),"wmServiceOperationInfo"),m().get(t,"parameters")},t.prototype.setInput=function(e,t,n,r){return(0,c.setInput)(e.dataBinding,t,n,r)},t.prototype.cancel=function(e,t){s.$queue.requestsQueue.has(e)&&(a.ServiceVariableUtils.isFileUploadRequest(e)?(e.httpService.cancel(e,t),t.status="abort",this.totalFilesCount--,(0,c.initiateCallback)(l.VARIABLE_CONSTANTS.EVENT.ABORT,e,t),this.isFileUploadInProgress(e.dataBinding)||0!==this.totalFilesCount||(s.$queue.process(e),this.notifyInflight(e,!1))):e.httpService.cancel&&(e.httpService.cancel(e),s.$queue.process(e),this.notifyInflight(e,!1)))},t.prototype.defineFirstLastRecord=function(e){e.isList&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().head(t&&t.content)||m().head(t)||{}}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().last(t&&t.content)||m().last(t)||{}}}))},t.prototype.getQueryParams=function(e,t,n){var r=this.getInputParms(n),i=a.ServiceVariableUtils.excludePaginationParams(r),o={};return m().map(n.dataBinding,(function(e,t){o[t]=e})),m().forEach(e,(function(e){m().includes(i,e)&&(o[e]=t)})),o},t.prototype.searchRecords=function(e,t,n,r){var o=this.getQueryParams(m().split(t.searchKey,","),t.query,e),a={page:t.page,pagesize:t.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",inputFields:o};return t.onBeforeservicecall&&t.onBeforeservicecall(o),this.invoke(e,a,n,r).catch(i.noop)},t}(u.BaseVariableManager)},"./src/model/action/timer-action.ts":
4503
4503
  /*!******************************************!*\
4504
4504
  !*** ./src/model/action/timer-action.ts ***!
4505
4505
  \******************************************/
@@ -23185,8 +23185,9 @@
23185
23185
  var defaultTreeIconClass = "plus-minus";
23186
23186
  var TreeComponent = function(_super) {
23187
23187
  __extends(TreeComponent, _super);
23188
- function TreeComponent(inj) {
23188
+ function TreeComponent(inj, bindnodeid) {
23189
23189
  var _this = _super.call(this, inj, WIDGET_INFO) || this;
23190
+ _this.bindnodeid = bindnodeid;
23190
23191
  _this.setting = {
23191
23192
  data: {
23192
23193
  simpleData: {
@@ -23375,14 +23376,7 @@
23375
23376
  this.expandNode(nodes[0], !nodes[0].open, true);
23376
23377
  }
23377
23378
  }
23378
- var path = this.getPath(treeNode, "");
23379
- var eventParams = {
23380
- $event: event,
23381
- $item: treeNode,
23382
- $path: path
23383
- };
23384
- this.setSelectedItem(treeNode);
23385
- this.invokeEventCallback("select", eventParams);
23379
+ this.selectNode(event, treeNode);
23386
23380
  };
23387
23381
  TreeComponent.prototype.onExpand = function(event, treeId, treeNode) {
23388
23382
  var self = this;
@@ -23552,43 +23546,72 @@
23552
23546
  this.setting.callback["onCollapse"] = this.onCollapse.bind(this);
23553
23547
  var zTree = $.fn.zTree.init($('ul[name="' + this.name + '"]'), this.setting, this.nodes);
23554
23548
  $.fn.zTreeKeyboardNavigation(zTree, $('ul[name="' + this.name + '"]'), null, this.treeicon || defaultTreeIconClass);
23549
+ this.postRenderTree();
23555
23550
  };
23556
- TreeComponent.prototype.setSelectedItem = function(treeNode) {
23557
- this.selecteditem = core.getClonedObject(treeNode) || {};
23558
- this.selecteditem.path = this.getPath(treeNode, "");
23559
- var deSelectElm = $("li[treenode].selected");
23551
+ TreeComponent.prototype.selectNode = function(event, node) {
23552
+ var deSelectElm = $(".app-tree[name=" + this.name + "] li[treenode].selected");
23560
23553
  deSelectElm.removeClass("selected");
23561
- var selectElm = $("#" + treeNode.tId + ":has(.curSelectedNode)");
23554
+ if (!node) {
23555
+ return;
23556
+ }
23557
+ var selectElm = $("#" + node.tId + ":has(.curSelectedNode)");
23562
23558
  selectElm.addClass("selected");
23559
+ var path = this.getPath(node, "");
23560
+ this.selecteditem = core.getClonedObject(node) || {};
23561
+ this.selecteditem.path = path;
23562
+ var eventParams = {
23563
+ $event: event,
23564
+ $item: node,
23565
+ $path: path
23566
+ };
23567
+ this.invokeEventCallback("select", eventParams);
23563
23568
  };
23564
23569
  TreeComponent.prototype.expandNode = function(node, expand, eventFlag) {
23565
23570
  this.treeObj.expandNode(node, expand, false, false, eventFlag);
23566
23571
  var el = $("#" + node.tId + "_switch");
23567
23572
  $(el).addClass(this.treeicon || defaultTreeIconClass);
23568
23573
  };
23569
- TreeComponent.prototype.ngAfterViewInit = function() {
23574
+ TreeComponent.prototype.postRenderTree = function() {
23570
23575
  var _this = this;
23571
23576
  setTimeout((function() {
23572
23577
  _this.changeTreeIcons(_this.treeicon || defaultTreeIconClass);
23573
- if (_this.datavalue) {
23578
+ if (_this.datavalue && !_this.selecteditem) {
23574
23579
  var nodes = _this.treeObj.getNodes();
23575
- var selectNode = void 0;
23576
- if (_this.datavalue === "FirstNode") {
23577
- if (nodes.length) {
23578
- selectNode = nodes[0];
23580
+ var node = void 0;
23581
+ if (nodes.length) {
23582
+ if (_this.datavalue === "FirstNode") {
23583
+ node = nodes[0];
23579
23584
  }
23580
- }
23581
- if (_this.datavalue === "LastNode") {
23582
- if (nodes.length) {
23583
- selectNode = nodes[nodes.length - 1];
23585
+ if (_this.datavalue === "LastNode") {
23586
+ node = nodes[nodes.length - 1];
23584
23587
  }
23585
23588
  }
23586
- _this.treeObj.selectNode(selectNode, false);
23587
- _this.setSelectedItem(selectNode);
23588
- _this.expandNode(selectNode, true, false);
23589
+ if (node) {
23590
+ _this.treeObj.selectNode(node, false);
23591
+ _this.selectNode(undefined, node);
23592
+ _this.expandNode(node, true, false);
23593
+ }
23589
23594
  }
23590
23595
  }), 200);
23591
23596
  };
23597
+ TreeComponent.prototype.selectById = function(value) {
23598
+ var _this = this;
23599
+ var simpleNodes = this.treeObj.transformToArray(this.treeObj.getNodes());
23600
+ var node = simpleNodes.find((function(node) {
23601
+ return value === base.getEvaluatedData(node, {
23602
+ field: _this.nodeid,
23603
+ bindExpression: _this.bindnodeid
23604
+ }, _this.viewParent);
23605
+ }));
23606
+ if (node) {
23607
+ this.treeObj.selectNode(node, false);
23608
+ this.selectNode(undefined, node);
23609
+ }
23610
+ };
23611
+ TreeComponent.prototype.deselectById = function(value) {
23612
+ this.selecteditem = {};
23613
+ this.selectById();
23614
+ };
23592
23615
  return TreeComponent;
23593
23616
  }(base.StylableComponent);
23594
23617
  TreeComponent.initializeProps = registerProps();
@@ -23604,6 +23627,12 @@
23604
23627
  TreeComponent.ctorParameters = function() {
23605
23628
  return [ {
23606
23629
  type: core$1.Injector
23630
+ }, {
23631
+ type: undefined,
23632
+ decorators: [ {
23633
+ type: core$1.Attribute,
23634
+ args: [ "nodeid.bind" ]
23635
+ } ]
23607
23636
  } ];
23608
23637
  };
23609
23638
  var components = [ TreeComponent ];
@@ -42468,9 +42497,6 @@
42468
42497
  var childNode = item.querySelector("span");
42469
42498
  if ((childNode === null || childNode === void 0 ? void 0 : childNode.dataset.isacitvepage) === "true") {
42470
42499
  item.setAttribute("aria-current", "true");
42471
- setTimeout((function() {
42472
- return item.focus();
42473
- }));
42474
42500
  }
42475
42501
  if ((childNode === null || childNode === void 0 ? void 0 : childNode.dataset.isdisabled) === "true") {
42476
42502
  item.setAttribute("aria-disabled", "true");
@@ -124,7 +124,7 @@
124
124
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
125
125
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
126
126
  PERFORMANCE OF THIS SOFTWARE.
127
- ***************************************************************************** */var 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)};Object.create;function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var c=function(){i.register("wm-tree",new Map([["class",i.PROP_STRING],["dataset",Object.assign({value:"node1, node2, node3"},i.PROP_ANY)],["datavalue",i.PROP_STRING],["levels",Object.assign({value:0},i.PROP_NUMBER)],["name",i.PROP_STRING],["nodeaction",i.PROP_STRING],["nodechildren",i.PROP_STRING],["nodeclick",Object.assign({value:"none"},i.PROP_STRING)],["nodeicon",i.PROP_STRING],["nodeid",i.PROP_STRING],["nodelabel",i.PROP_STRING],["orderby",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["treeicons",i.PROP_STRING]]))},p={widgetType:"wm-tree",hostClass:"app-tree"},u="plus-minus",d=function(e){function t(t){var n=e.call(this,t,p)||this;return n.setting={data:{simpleData:{enable:!1},key:{children:"children",name:"label"}},view:{dblClickExpand:!1,fontCss:{"font-awesome":!0},switchIcon:{}},check:{},callback:{}},i.styler(n.nativeElement,n,i.APPLY_STYLES_TYPE.CONTAINER),n}return 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)}(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":this.nodes=this.getNodes(n),this.level>0&&this.expandTree(this.level,this.nodes,0),this.renderTree();break;case"levels":n>0&&(this.level=n),this.renderTree();break;case"treeicons":this.treeicon=n,this.renderTree();break;case"nodelabel":this.setting.data.key.name=this.labelKey,this.renderTree();break;case"nodechildren":this.setting.data.key.children=this.childrenKey,this.renderTree();break;case"nodeicon":this.nodeicon=this.iconKey,this.renderTree();break;case"orderby":this.renderTree();break;case"class":this.treeClass=n,this.renderTree();break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.expandTree=function(e,t,n){var i=this;t.map((function(t){var o=i.getChildren(t);o&&!("open"in t)&&n<e?(t.open=!0,i.expandTree(e,o,n+1)):n=0}))},t.prototype.setTreeTemplate=function(e){"Classic"===e?this.setting.check.enable=!1:"Checkbox"===e?(this.setting.check.enable=!0,this.setting.check.chkStyle="checkbox"):"Radio"===e&&(this.setting.check.enable=!0,this.setting.check.chkStyle="radio",this.setting.check.radioType="all")},t.prototype.getNodesFromString=function(e){return e.split(",").map((function(e){return{label:e&&e.trim()}}))},t.prototype.getNodes=function(e){var t;return _.isArray(e)?t=i.getOrderedDataset(e,this.orderby):_.isObject(e)?t=[e]:_.isString(e)&&!_.isEmpty(e)&&(e=e.trim())&&(t=this.getNodesFromString(e)),t},t.prototype.setNodeclasses=function(e,t){return t.icon?{add:[""+t.icon]}:""},t.prototype.setNodeData=function(e,t,n,i,o){var r=this;0===t?e.map((function(e){var a=r.getChildren(e);if(a&&r.setNodeData(a,t,n,i,o),e.icon&&"icon"==r.nodelabel)e[o]=e.icon;else{if(!e.name||"name"!=r.nodelabel)return;e[o]=e.name}})):e.map((function(e){var a=r.getChildren(e);return a&&n>1&&(t===n&&(i=e),r.setNodeData(a,t,n-1,i,o)),1===n&&("name"===o?r.nodelabel.includes("label")||r.nodelabel.includes("name"):r.nodeicon.includes("label")||r.nodeicon.includes("name"))?void(i[o]=e.name||e.label):1===n&&void 0!==e.icon&&("name"===o?r.nodelabel.includes("icon"):r.nodeicon.includes("icon"))?void(i[o]=e.icon):void 0}))},t.prototype.changeTreeIcons=function(e){var t=$('ul[name="'+this.name+'"] li span.button.switch');$(t).map((function(t,n){$(n).addClass(e),$(n).on("click",(function(t){setTimeout((function(){$(n).addClass(e)}),0)}))}))},t.prototype.getPath=function(e,t){return t=null===e.getParentNode()?"/"+e[this.labelKey]+t:this.getPath(e.getParentNode(),t)+"/"+e[this.labelKey]},t.prototype.onClick=function(e,t,n,i){if("expand"===this.nodeclick){var o=this.treeObj.getSelectedNodes();o.length>0&&this.expandNode(o[0],!o[0].open,!0)}var r={$event:e,$item:n,$path:this.getPath(n,"")};this.setSelectedItem(n),this.invokeEventCallback("select",r)},t.prototype.onExpand=function(e,t,n){var i=this,o={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("expand",o);var r=this.getChildren(n);null==r||r.map((function(e){if(e.isParent){var t=$("#"+e.tId+"_switch");$(t).addClass(i.treeicon||u),$(t).on("click",(function(e){setTimeout((function(){$(t).addClass(i.treeicon||u)}),0)}))}}))},t.prototype.onCollapse=function(e,t,n){var i={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("collapse",i)},t.prototype.getChildren=function(e){return e[this.childrenKey]},Object.defineProperty(t.prototype,"childrenKey",{get:function(){return this.nodechildren?this.countDepth(this.nodechildren)?this.nodechildren.split(".").pop():this.nodechildren:"children"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelKey",{get:function(){return this.nodelabel?this.countDepth(this.nodelabel)?this.nodelabel.split(".").pop():this.nodelabel:"label"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconKey",{get:function(){return this.nodeicon?this.countDepth(this.nodeicon)?this.nodeicon.split(".").pop():this.nodeicon:"icon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"treeObj",{get:function(){return $.fn.zTree.getZTreeObj(""+this.name)},enumerable:!1,configurable:!0}),t.prototype.modifyObjects=function(e){var t=this;e.forEach((function(e){e.icon=e[t.nodeicon];var n=t.getChildren(e);(null==n?void 0:n.length)&&t.modifyObjects(n)}))},t.prototype.setNodeChildren=function(e,t,n,i){var o=this;if(t<=0)return e;for(var r=0;r<e.length;r++){var a=e[r];t===n&&(i=e[r]);var s=this.getChildren(a);if(null==s?void 0:s.length){if(1===n)return void(i[this.childrenKey]=s.map((function(e){var t;return(t={})[o.labelKey]=e[o.labelKey],t[o.childrenKey]=o.getChildren(e),t.icon=e[o.iconKey],t})));this.setNodeChildren(s,t,n-1,i)}}return e},t.prototype.countDepth=function(e){var t,n,i=e.match(/\[.*?\]/g),o=1;if(null===i)return o;try{for(var r=a(i),s=r.next();!s.done;s=r.next()){s.value;o++}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o},t.prototype.renderTree=function(){if(this.nodes){if(this.nativeElement.setAttribute("id",this.name),this.nodeicon&&"icon"!==this.nodeicon&&this.modifyObjects(this.nodes),this.setTreeTemplate(this.treeClass),this.nodelabel){var e=0;this.nodelabel.includes("children")&&(e=this.countDepth(this.nodelabel)),this.setNodeData(this.nodes,e,e,null,"name")}if(this.nodeicon){e=0;this.nodeicon.includes("children")&&(e=this.countDepth(this.nodeicon)),this.setNodeData(this.nodes,e,e,null,"icon")}if(this.nodechildren)(e=this.countDepth(this.nodechildren))>1&&(this.nodes=this.setNodeChildren(this.nodes,e,e,null))}this.setting.view.nodeClasses=this.setNodeclasses,this.setting.callback.onClick=this.onClick.bind(this),this.setting.callback.onExpand=this.onExpand.bind(this),this.setting.callback.onCollapse=this.onCollapse.bind(this);var t=$.fn.zTree.init($('ul[name="'+this.name+'"]'),this.setting,this.nodes);$.fn.zTreeKeyboardNavigation(t,$('ul[name="'+this.name+'"]'),null,this.treeicon||u)},t.prototype.setSelectedItem=function(e){this.selecteditem=o.getClonedObject(e)||{},this.selecteditem.path=this.getPath(e,""),$("li[treenode].selected").removeClass("selected"),$("#"+e.tId+":has(.curSelectedNode)").addClass("selected")},t.prototype.expandNode=function(e,t,n){this.treeObj.expandNode(e,t,!1,!1,n);var i=$("#"+e.tId+"_switch");$(i).addClass(this.treeicon||u)},t.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){if(e.changeTreeIcons(e.treeicon||u),e.datavalue){var t=e.treeObj.getNodes(),n=void 0;"FirstNode"===e.datavalue&&t.length&&(n=t[0]),"LastNode"===e.datavalue&&t.length&&(n=t[t.length-1]),e.treeObj.selectNode(n,!1),e.setSelectedItem(n),e.expandNode(n,!0,!1)}}),200)},t}(i.StylableComponent);d.initializeProps=c(),d.decorators=[{type:t.Component,args:[{selector:"ul[wmTree]",template:'<ul #wmTree class="ztree" id="ztree"></ul> ',providers:[i.provideAsWidgetRef(d)],encapsulation:t.ViewEncapsulation.None}]}],d.ctorParameters=function(){return[{type:t.Injector}]};var h=[d],m=function(){};m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(h)),exports:l([],s(h)),entryComponents:[]}]}],e.TreeComponent=d,e.TreeModule=m,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-bootstrap/datepicker"),require("@wm/core"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/input/calendar",["exports","@angular/core","@angular/common","@angular/forms","ngx-bootstrap/datepicker","@wm/core","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.calendar={}),e.ng.core,e.ng.common,e.ng.forms,e["ngx-bootstrap"].datepicker,e.wm.core,e.wm.components.base)}(this,(function(e,t,n,i,o,r,a){"use strict";
127
+ ***************************************************************************** */var 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)};Object.create;function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var c=function(){i.register("wm-tree",new Map([["class",i.PROP_STRING],["dataset",Object.assign({value:"node1, node2, node3"},i.PROP_ANY)],["datavalue",i.PROP_STRING],["levels",Object.assign({value:0},i.PROP_NUMBER)],["name",i.PROP_STRING],["nodeaction",i.PROP_STRING],["nodechildren",i.PROP_STRING],["nodeclick",Object.assign({value:"none"},i.PROP_STRING)],["nodeicon",i.PROP_STRING],["nodeid",i.PROP_STRING],["nodelabel",i.PROP_STRING],["orderby",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["treeicons",i.PROP_STRING]]))},p={widgetType:"wm-tree",hostClass:"app-tree"},u="plus-minus",d=function(e){function t(t,n){var o=e.call(this,t,p)||this;return o.bindnodeid=n,o.setting={data:{simpleData:{enable:!1},key:{children:"children",name:"label"}},view:{dblClickExpand:!1,fontCss:{"font-awesome":!0},switchIcon:{}},check:{},callback:{}},i.styler(o.nativeElement,o,i.APPLY_STYLES_TYPE.CONTAINER),o}return 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)}(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":this.nodes=this.getNodes(n),this.level>0&&this.expandTree(this.level,this.nodes,0),this.renderTree();break;case"levels":n>0&&(this.level=n),this.renderTree();break;case"treeicons":this.treeicon=n,this.renderTree();break;case"nodelabel":this.setting.data.key.name=this.labelKey,this.renderTree();break;case"nodechildren":this.setting.data.key.children=this.childrenKey,this.renderTree();break;case"nodeicon":this.nodeicon=this.iconKey,this.renderTree();break;case"orderby":this.renderTree();break;case"class":this.treeClass=n,this.renderTree();break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.expandTree=function(e,t,n){var i=this;t.map((function(t){var o=i.getChildren(t);o&&!("open"in t)&&n<e?(t.open=!0,i.expandTree(e,o,n+1)):n=0}))},t.prototype.setTreeTemplate=function(e){"Classic"===e?this.setting.check.enable=!1:"Checkbox"===e?(this.setting.check.enable=!0,this.setting.check.chkStyle="checkbox"):"Radio"===e&&(this.setting.check.enable=!0,this.setting.check.chkStyle="radio",this.setting.check.radioType="all")},t.prototype.getNodesFromString=function(e){return e.split(",").map((function(e){return{label:e&&e.trim()}}))},t.prototype.getNodes=function(e){var t;return _.isArray(e)?t=i.getOrderedDataset(e,this.orderby):_.isObject(e)?t=[e]:_.isString(e)&&!_.isEmpty(e)&&(e=e.trim())&&(t=this.getNodesFromString(e)),t},t.prototype.setNodeclasses=function(e,t){return t.icon?{add:[""+t.icon]}:""},t.prototype.setNodeData=function(e,t,n,i,o){var r=this;0===t?e.map((function(e){var a=r.getChildren(e);if(a&&r.setNodeData(a,t,n,i,o),e.icon&&"icon"==r.nodelabel)e[o]=e.icon;else{if(!e.name||"name"!=r.nodelabel)return;e[o]=e.name}})):e.map((function(e){var a=r.getChildren(e);return a&&n>1&&(t===n&&(i=e),r.setNodeData(a,t,n-1,i,o)),1===n&&("name"===o?r.nodelabel.includes("label")||r.nodelabel.includes("name"):r.nodeicon.includes("label")||r.nodeicon.includes("name"))?void(i[o]=e.name||e.label):1===n&&void 0!==e.icon&&("name"===o?r.nodelabel.includes("icon"):r.nodeicon.includes("icon"))?void(i[o]=e.icon):void 0}))},t.prototype.changeTreeIcons=function(e){var t=$('ul[name="'+this.name+'"] li span.button.switch');$(t).map((function(t,n){$(n).addClass(e),$(n).on("click",(function(t){setTimeout((function(){$(n).addClass(e)}),0)}))}))},t.prototype.getPath=function(e,t){return t=null===e.getParentNode()?"/"+e[this.labelKey]+t:this.getPath(e.getParentNode(),t)+"/"+e[this.labelKey]},t.prototype.onClick=function(e,t,n,i){if("expand"===this.nodeclick){var o=this.treeObj.getSelectedNodes();o.length>0&&this.expandNode(o[0],!o[0].open,!0)}this.selectNode(e,n)},t.prototype.onExpand=function(e,t,n){var i=this,o={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("expand",o);var r=this.getChildren(n);null==r||r.map((function(e){if(e.isParent){var t=$("#"+e.tId+"_switch");$(t).addClass(i.treeicon||u),$(t).on("click",(function(e){setTimeout((function(){$(t).addClass(i.treeicon||u)}),0)}))}}))},t.prototype.onCollapse=function(e,t,n){var i={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("collapse",i)},t.prototype.getChildren=function(e){return e[this.childrenKey]},Object.defineProperty(t.prototype,"childrenKey",{get:function(){return this.nodechildren?this.countDepth(this.nodechildren)?this.nodechildren.split(".").pop():this.nodechildren:"children"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelKey",{get:function(){return this.nodelabel?this.countDepth(this.nodelabel)?this.nodelabel.split(".").pop():this.nodelabel:"label"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconKey",{get:function(){return this.nodeicon?this.countDepth(this.nodeicon)?this.nodeicon.split(".").pop():this.nodeicon:"icon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"treeObj",{get:function(){return $.fn.zTree.getZTreeObj(""+this.name)},enumerable:!1,configurable:!0}),t.prototype.modifyObjects=function(e){var t=this;e.forEach((function(e){e.icon=e[t.nodeicon];var n=t.getChildren(e);(null==n?void 0:n.length)&&t.modifyObjects(n)}))},t.prototype.setNodeChildren=function(e,t,n,i){var o=this;if(t<=0)return e;for(var r=0;r<e.length;r++){var a=e[r];t===n&&(i=e[r]);var s=this.getChildren(a);if(null==s?void 0:s.length){if(1===n)return void(i[this.childrenKey]=s.map((function(e){var t;return(t={})[o.labelKey]=e[o.labelKey],t[o.childrenKey]=o.getChildren(e),t.icon=e[o.iconKey],t})));this.setNodeChildren(s,t,n-1,i)}}return e},t.prototype.countDepth=function(e){var t,n,i=e.match(/\[.*?\]/g),o=1;if(null===i)return o;try{for(var r=a(i),s=r.next();!s.done;s=r.next()){s.value;o++}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o},t.prototype.renderTree=function(){if(this.nodes){if(this.nativeElement.setAttribute("id",this.name),this.nodeicon&&"icon"!==this.nodeicon&&this.modifyObjects(this.nodes),this.setTreeTemplate(this.treeClass),this.nodelabel){var e=0;this.nodelabel.includes("children")&&(e=this.countDepth(this.nodelabel)),this.setNodeData(this.nodes,e,e,null,"name")}if(this.nodeicon){e=0;this.nodeicon.includes("children")&&(e=this.countDepth(this.nodeicon)),this.setNodeData(this.nodes,e,e,null,"icon")}if(this.nodechildren)(e=this.countDepth(this.nodechildren))>1&&(this.nodes=this.setNodeChildren(this.nodes,e,e,null))}this.setting.view.nodeClasses=this.setNodeclasses,this.setting.callback.onClick=this.onClick.bind(this),this.setting.callback.onExpand=this.onExpand.bind(this),this.setting.callback.onCollapse=this.onCollapse.bind(this);var t=$.fn.zTree.init($('ul[name="'+this.name+'"]'),this.setting,this.nodes);$.fn.zTreeKeyboardNavigation(t,$('ul[name="'+this.name+'"]'),null,this.treeicon||u),this.postRenderTree()},t.prototype.selectNode=function(e,t){if($(".app-tree[name="+this.name+"] li[treenode].selected").removeClass("selected"),t){$("#"+t.tId+":has(.curSelectedNode)").addClass("selected");var n=this.getPath(t,"");this.selecteditem=o.getClonedObject(t)||{},this.selecteditem.path=n;var i={$event:e,$item:t,$path:n};this.invokeEventCallback("select",i)}},t.prototype.expandNode=function(e,t,n){this.treeObj.expandNode(e,t,!1,!1,n);var i=$("#"+e.tId+"_switch");$(i).addClass(this.treeicon||u)},t.prototype.postRenderTree=function(){var e=this;setTimeout((function(){if(e.changeTreeIcons(e.treeicon||u),e.datavalue&&!e.selecteditem){var t=e.treeObj.getNodes(),n=void 0;t.length&&("FirstNode"===e.datavalue&&(n=t[0]),"LastNode"===e.datavalue&&(n=t[t.length-1])),n&&(e.treeObj.selectNode(n,!1),e.selectNode(void 0,n),e.expandNode(n,!0,!1))}}),200)},t.prototype.selectById=function(e){var t=this,n=this.treeObj.transformToArray(this.treeObj.getNodes()).find((function(n){return e===i.getEvaluatedData(n,{field:t.nodeid,bindExpression:t.bindnodeid},t.viewParent)}));n&&(this.treeObj.selectNode(n,!1),this.selectNode(void 0,n))},t.prototype.deselectById=function(e){this.selecteditem={},this.selectById()},t}(i.StylableComponent);d.initializeProps=c(),d.decorators=[{type:t.Component,args:[{selector:"ul[wmTree]",template:'<ul #wmTree class="ztree" id="ztree"></ul> ',providers:[i.provideAsWidgetRef(d)],encapsulation:t.ViewEncapsulation.None}]}],d.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["nodeid.bind"]}]}]};var h=[d],m=function(){};m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(h)),exports:l([],s(h)),entryComponents:[]}]}],e.TreeComponent=d,e.TreeModule=m,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-bootstrap/datepicker"),require("@wm/core"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/input/calendar",["exports","@angular/core","@angular/common","@angular/forms","ngx-bootstrap/datepicker","@wm/core","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.calendar={}),e.ng.core,e.ng.common,e.ng.forms,e["ngx-bootstrap"].datepicker,e.wm.core,e.wm.components.base)}(this,(function(e,t,n,i,o,r,a){"use strict";
128
128
  /*! *****************************************************************************
129
129
  Copyright (c) Microsoft Corporation.
130
130
 
@@ -475,7 +475,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
475
475
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
476
476
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
477
477
  PERFORMANCE OF THIS SOFTWARE.
478
- ***************************************************************************** */var s=function(e,t){return(s=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)};Object.create;function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){r.register("wm-pagination",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["dataset",r.PROP_ANY],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["maxResults",r.PROP_NUMBER],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["navigationsize",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]))},u={widgetType:"wm-pagination",hostClass:"app-datanavigator clearfix"},d={Pager:{small:"pager-sm",large:"pager-lg"},Basic:{small:"pagination-sm",large:"pagination-lg"},Classic:{small:"pagination-sm",large:"pagination-lg"}},h=function(e){function n(n,i){var o=e.call(this,n,u)||this;return o.parent=i,o.resultEmitter=new t.EventEmitter,o.maxResultsEmitter=new t.EventEmitter,o.dn={currentPage:1},o.pageCount=0,o.isDisableNext=!0,o.isDisablePrevious=!0,o.isDisableFirst=!0,o.isDisableLast=!0,o._debouncedApplyDataset=a.debounce((function(){return o.widget.dataset=o.dataset}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),o._debouncedPageChanged=a.debounce((function(e){var t=e&&e.page;if(t!==o.dn.currentPage){var n=o.parent||o;o.dn.currentPage=t,n.invokeEventCallback("paginationchange",{$event:void 0,$index:o.dn.currentPage}),o.goToPage(),"Basic"===o.navigation&&o._setAriaForBasicNavigation()}}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),r.styler(o.nativeElement,o),o}return 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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype._setAriaForBasicNavigation=function(){_.forEach(this.nativeElement.getElementsByTagName("a"),(function(e){e.setAttribute("href","javascript:void(0);");var t=e.querySelector("span");"true"===(null==t?void 0:t.dataset.isacitvepage)&&(e.setAttribute("aria-current","true"),setTimeout((function(){return e.focus()}))),"true"===(null==t?void 0:t.dataset.isdisabled)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}))},n.prototype.setResult=function(e){this.result=e,this.resultEmitter.emit(this.result)},n.prototype.updateNavSize=function(){var e=d[this.navcontrols];e&&this.navigationsize?this.navigationClass=e[this.navigationsize]:this.navigationClass=""},n.prototype.resetPageNavigation=function(){this.pageCount=0,this.dn.currentPage=1,this.dataSize=0},n.prototype.calculatePagingValues=function(){this.pageCount=this.dataSize>this.maxResults?Math.ceil(this.dataSize/this.maxResults):this.dataSize<0?0:1,this.dn.currentPage=this.dn.currentPage||1},n.prototype.setDefaultPagingValues=function(e,t,n){e||t?(this.maxResults=t||this.maxResults,this.dataSize=a.isDefined(e)?e:this.dataSize,this.dn.currentPage=n||this.dn.currentPage,this.calculatePagingValues()):(this.pageCount=1,this.dn.currentPage=1,this.maxResults=e,this.dataSize=e),this.maxResultsEmitter.emit(this.maxResults)},n.prototype.checkDataSize=function(e,t,n){-1===e||e===a.AppConstants.INT_MAX_VALUE?(this.prevshowrecordcount=this.showrecordcount,this.isDisableLast=!0,this.isDisableCount=!0,this.showrecordcount=!1,t<n&&(this.isDisableNext=!0)):(this.isDisableCount=!1,this.showrecordcount=this.prevshowrecordcount||this.showrecordcount)},n.prototype.disableNavigation=function(){var e,t=1===this.dn.currentPage,n=this.dn.currentPage===this.pageCount;(null===(e=this.pagination)||void 0===e?void 0:e.next)?(this.isDisableFirst=this.isDisablePrevious=!this.pagination.prev,this.isDisableNext=this.isDisableLast=!this.pagination.next):(this.isDisableFirst=this.isDisablePrevious=t,this.isDisableNext=this.isDisableLast=n),this.isDisableCurrent=t&&n,this.dataset&&this.dataset.length&&this.isDisableNext&&this.parent.onDemandLoad&&"wm-table"===this.parent.widgetType&&this.parent.callDataGridMethod("hideLoadingIndicator",this.isDisableNext,this.parent.infScroll)},n.prototype.isDataSourceHasPaging=function(){return this.datasource&&this.datasource.execute(a.DataSource.Operation.IS_PAGEABLE)},n.prototype.setNonPageableData=function(e){var t,n,i,o;t=_.isArray(e)?e.length:_.isEmpty(e)?0:1,n=this.options&&this.options.maxResults||t,i=this.datasource&&(this.datasource.execute(a.DataSource.Operation.IS_API_AWARE)||"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(_.get(this.parent,"gridOptions.lastActionPerformed")===this.parent.gridOptions.ACTIONS.DATASET_UPDATE||!_.get(this.parent,"gridOptions.isNextPageData")))?1:this.dn.currentPage||1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),o=(this.dn.currentPage-1)*this.maxResults,this.setResult(_.isArray(e)?e.slice(o,o+this.maxResults):e)},n.prototype.setPagingValues=function(e){var t,n,i,o={};this.__fullData=e,this.binddataset?(o=(this.datasource||{})._options||{},e?this.isDataSourceHasPaging()?(this.pagination=this.datasource.execute(a.DataSource.Operation.GET_PAGING_OPTIONS)||{},this.filterFields=o.filterFields||{},this.logicalOp=o.logicalOp||"",this.sortOptions=o.orderBy||(_.isArray(this.pagination.sort)?r.getOrderByExpr(this.pagination.sort):""),t=this.pagination.totalElements,n=this.pagination.size,this.pagination.numberOfElements>0?(a.isDefined(this.pagination.number)&&(this.dn.currentPage=this.pagination.number+1),i=this.dn.currentPage||1):i=1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),this.checkDataSize(t,this.pagination.numberOfElements,this.pagination.size),this.setResult(e)):_.isString(e)||this.setNonPageableData(e):(this.setResult(e),this.resetPageNavigation()),"Basic"===this.navigation&&this._setAriaForBasicNavigation()):e&&!_.isString(e)&&this.setNonPageableData(e)},n.prototype.isFirstPage=function(){return 1===this.dn.currentPage||!this.dn.currentPage},n.prototype.isLastPage=function(){return this.dn.currentPage===this.pageCount},n.prototype.goToLastPage=function(e,t,n){this.isLastPage()?e&&this.goToPage(t,n):(this.dn.currentPage=this.pageCount,this.goToPage(t,n))},n.prototype.goToFirstPage=function(e,t,n){this.isFirstPage()?e&&this.goToPage(t,n):(this.dn.currentPage=1,this.goToPage(t,n))},n.prototype.goToPage=function(e,t){this.firstRow=(this.dn.currentPage-1)*this.maxResults;var n=this.parent.statePersistence.computeMode(this.statehandler);!n||"none"===n.toLowerCase()||"wm-table"!==this.parent.widgetType&&"wm-list"!==this.parent.widgetType||(this.parent._selectedItemsExist=!0,this.isFirstPage()?this.parent.statePersistence.removeWidgetState(this.parent,"pagination"):r.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation)<0?this.parent.statePersistence.setWidgetState(this.parent,{pagination:this.dn.currentPage}):"wm-list"!==this.parent.widgetType&&"wm-table"!==this.parent.widgetType||console.warn("Retain State handling on Widget "+this.parent.name+" is not supported for current pagination type.")),this.getPageData(e,t)},n.prototype.onPageDataReady=function(e,t,n){this.disableNavigation(),this.invokeSetRecord(e,t),a.triggerFn(n)},n.prototype.getPageData=function(e,t){var n,i,o=this;if(this.isDataSourceHasPaging()){var r=this.dn.currentPage;this.isEditNotInCurrentPage()&&"delete"!==this.parent.gridOptions.lastActionPerformed&&(r=this.parent.actionRowPage),this.datasource.execute(a.DataSource.Operation.LIST_RECORDS,{page:r,filterFields:this.filterFields,orderBy:this.sortOptions,logicalOp:this.logicalOp,matchMode:"anywhereignorecase"}).then((function(n){o.onPageDataReady(e,n&&n.data,t),a.$appDigest()}),(function(e){}))}else i=this.isEditNotInCurrentPage()?(this.parent.actionRowPage-1)*this.maxResults:(this.dn.currentPage-1)*this.maxResults,n=_.isArray(this.__fullData)?this.__fullData.slice(i,i+this.maxResults):this.__fullData,this.setResult(n),this.onPageDataReady(e,n,t)},n.prototype.isEditNotInCurrentPage=function(){var e=this.dn.currentPage;return"wm-table"===this.parent.widgetType&&e===this.parent.currentPage&&this.parent.actionRowPage&&this.parent.actionRowPage<e},n.prototype.invokeSetRecord=function(e,t){var n={currentPage:this.dn.currentPage,size:this.maxResults,totalElements:this.dataSize,totalPages:this.pageCount};this.parent?this.parent.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t}):this.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t})},n.prototype.validateCurrentPage=function(e,t){return!e||!(isNaN(this.dn.currentPage)||this.dn.currentPage<=0||this.pageCount&&(this.dn.currentPage>this.pageCount||_.isNull(this.dn.currentPage)))||(this.dn.currentPage<=0?this.dn.currentPage=1:this.dn.currentPage>this.pageCount&&(this.dn.currentPage=this.pageCount),!1)},n.prototype.onModelChange=function(e){this.validateCurrentPage(e)&&this.goToPage(e)},n.prototype.onKeyDown=function(e){var t=$(e.target).closest("a");return"KeyE"===e.code?(t.addClass("ng-invalid"),!1):(t.removeClass("ng-invalid"),!0)},n.prototype.pageChanged=function(e){this._debouncedPageChanged(e)},n.prototype.navigatePage=function(e,t,n,i){var o,r,s,l;switch(a.isDefined(this.parent.isDataLoading)&&!this.isDisableNext&&(this.parent.isDataLoading=!0,this.parent.infScroll&&(this.parent.variableInflight=!0,this.parent.callDataGridMethod("showLoadingIndicator",this.parent.loadingdatamsg,!0))),"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT),this.parent.gridOptions.setIsDatasetUpdated(!1)),this.invokeEventCallback("paginationchange",{$event:void 0,$index:this.dn.currentPage}),this.dn.currentPage=+this.dn.currentPage,e){case"first":return void this.goToFirstPage(n,t,i);case"prev":if(!((null===(o=this.pagination)||void 0===o?void 0:o.next)||!this.isFirstPage()&&this.validateCurrentPage(t,i)))return;(null===(r=this.pagination)||void 0===r?void 0:r.next)&&(this.datasource.pagination.isNext=!1,this.datasource.pagination.isPrev=!0),this.dn.currentPage-=1;break;case"next":if(!((null===(s=this.pagination)||void 0===s?void 0:s.next)||!this.isLastPage()&&this.validateCurrentPage(t,i)))return;(null===(l=this.pagination)||void 0===l?void 0:l.next)&&(this.datasource.pagination.isNext=!0,this.datasource.pagination.isPrev=!1),this.dn.currentPage+=1;break;case"last":return void this.goToLastPage(n,t,i)}this.goToPage(t,i)},n.prototype.setBindDataSet=function(e,t,n,i,o,r,s){var l,c=this,p=e.split(".");if(this.statehandler=s,"Variables"!==p[0]&&"Widgets"!==p[0]||(l=p[0]+"."+p[1]+".pagination"),!o&&i&&!r)return this.dataset=i,void this._debouncedApplyDataset();this.binddataset=e,setTimeout((function(){c.registerDestroyListener(a.$watch(e,t,r?n:{},(function(e){e?(c.dataset=e,c._debouncedApplyDataset()):c.widget.dataset=e}))),l&&c.registerDestroyListener(a.$watch(l,t,{},(function(){return c._debouncedApplyDataset()})))})),r||(this.datasource=n)},n.prototype.setDataSource=function(e){this.datasource=e},n.prototype.onPropertyChange=function(t,n,i){if("dataset"===t){var o=void 0;o=this.parent&&this.parent.onDataNavigatorDataSetChange?this.parent.onDataNavigatorDataSetChange(n):n,"wm-table"===this.parent.widgetType&&(this.parent._triggeredByUser=!1),this.isEditNotInCurrentPage()?this.setResult(o):this.setPagingValues(o)}else"navigation"===t?("Advanced"===n&&(this.navigation="Classic"),this.updateNavSize(),this.navcontrols=n):"navigationsize"===t?this.updateNavSize():"navigationalign"===t?a.switchClass(this.nativeElement,"text-"+n,"text-"+i):"maxResults"===t?this.setPagingValues(this.dataset):e.prototype.onPropertyChange.call(this,t,n,i)},n.prototype.ngAfterViewInit=function(){this.nativeElement.onclick=function(e){e.stopPropagation()}},n}(r.StylableComponent);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"[wmPagination]",template:'\n<ul class="pagination advanced {{navigationClass}}" *ngIf="navcontrols === \'Classic\'">\n <li [ngClass]="{\'disabled\':isDisableFirst}">\n <a [title]="appLocale.LABEL_FIRST" name="first" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableFirst"\n (click)="navigatePage(\'first\', $event)">\n <span aria-hidden="true"><i class="wi wi-first-page"></i></span>\n <span class="sr-only">Go to first page {{ isDisableFirst ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisablePrevious}">\n <a [title]="appLocale.LABEL_PREVIOUS" name="prev" href="javascript:void(0);"\n [attr.aria-disabled]="isDisablePrevious"\n (click)="navigatePage(\'prev\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n <span class="sr-only">Go to previous page {{ isDisablePrevious ? \', Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="pagecount disabled">\n <a href="javascript:void(0);">\n <input type="number" [disabled]="isDisableCurrent" [(ngModel)]="dn.currentPage" [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount"\n (keydown)="onKeyDown($event)" (change)="onModelChange($event)" class="form-control"/>\n </a>\n </li>\n <li class="disabled">\n <a [hidden]="isDisableCount"> / {{pageCount}}</a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableNext}">\n <a [title]="appLocale.LABEL_NEXT" name="next" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableNext"\n (click)="navigatePage(\'next\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n <span class="sr-only">Go to next page {{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableLast}">\n <a [title]="appLocale.LABEL_LAST" name="last" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableLast"\n (click)="navigatePage(\'last\', $event)">\n <span aria-hidden="true"><i class="wi wi-last-page"></i></span>\n <span class="sr-only">Go to last page {{ isDisableLast ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li *ngIf="showrecordcount" class="totalcount disabled">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n<ul class="pager {{navigationClass}}" *ngIf="navcontrols === \'Pager\'">\n <li class="previous" [ngClass]="{\'disabled\':isDisablePrevious}">\n <a href="javascript:void(0);" (click)="navigatePage(\'prev\', $event)"\n [attr.aria-disabled]="isDisablePrevious">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class="sr-only">{{ isDisablePrevious ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="next" [ngClass]="{\'disabled\':isDisableNext}">\n <a href="javascript:void(0);" (click)="navigatePage(\'next\', $event)"\n [attr.aria-disabled]="isDisableNext">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class="sr-only">{{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n</ul>\n\n<pagination class="pagination basic" [ngClass]="navigationClass" *ngIf="navcontrols === \'Basic\'" role="navigation"\n [itemsPerPage]="maxResults" [totalItems]="dataSize"\n [ngModel]="dn.currentPage" (pageChanged)="pageChanged($event)"\n [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount + \' pages\'"\n [boundaryLinks]="boundarylinks" [maxSize]="maxsize"\n [directionLinks]="directionlinks"\n firstText="Firtst" lastText="Last"\n [customPreviousTemplate]="prevTemplate"\n [customNextTemplate]="nextTemplate"\n [customPageTemplate]="pageTemplate"></pagination>\n\n<ul *ngIf="navcontrols === \'Basic\' && showrecordcount" class="pagination">\n <li class="totalcount disabled basiccount">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n\n<ng-template #pageTemplate let-page>\n <span class="sr-only" [attr.data-isacitvepage]="page.active">{{\'Page \'}}</span>\n {{page.number}}\n <span class="sr-only" *ngIf="page.active"> {{\', Showing page \' + page.number + \' of \' + pageCount}}</span>\n</ng-template>\n<ng-template #prevTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Previous page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Next page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n',providers:[r.provideAsWidgetRef(h)]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.SkipSelf},{type:t.Inject,args:[r.WidgetRef]}]}]},h.propDecorators={resultEmitter:[{type:t.Output}],maxResultsEmitter:[{type:t.Output}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.PaginationModule,r.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.PaginationComponent=h,e.PaginationModule=f,e["\u0275a"]=p,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/navigation/menu"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/data/card",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/navigation/menu","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.card={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.navigation.menu,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
478
+ ***************************************************************************** */var s=function(e,t){return(s=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)};Object.create;function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){r.register("wm-pagination",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["dataset",r.PROP_ANY],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["maxResults",r.PROP_NUMBER],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["navigationsize",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]))},u={widgetType:"wm-pagination",hostClass:"app-datanavigator clearfix"},d={Pager:{small:"pager-sm",large:"pager-lg"},Basic:{small:"pagination-sm",large:"pagination-lg"},Classic:{small:"pagination-sm",large:"pagination-lg"}},h=function(e){function n(n,i){var o=e.call(this,n,u)||this;return o.parent=i,o.resultEmitter=new t.EventEmitter,o.maxResultsEmitter=new t.EventEmitter,o.dn={currentPage:1},o.pageCount=0,o.isDisableNext=!0,o.isDisablePrevious=!0,o.isDisableFirst=!0,o.isDisableLast=!0,o._debouncedApplyDataset=a.debounce((function(){return o.widget.dataset=o.dataset}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),o._debouncedPageChanged=a.debounce((function(e){var t=e&&e.page;if(t!==o.dn.currentPage){var n=o.parent||o;o.dn.currentPage=t,n.invokeEventCallback("paginationchange",{$event:void 0,$index:o.dn.currentPage}),o.goToPage(),"Basic"===o.navigation&&o._setAriaForBasicNavigation()}}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),r.styler(o.nativeElement,o),o}return 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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype._setAriaForBasicNavigation=function(){_.forEach(this.nativeElement.getElementsByTagName("a"),(function(e){e.setAttribute("href","javascript:void(0);");var t=e.querySelector("span");"true"===(null==t?void 0:t.dataset.isacitvepage)&&e.setAttribute("aria-current","true"),"true"===(null==t?void 0:t.dataset.isdisabled)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}))},n.prototype.setResult=function(e){this.result=e,this.resultEmitter.emit(this.result)},n.prototype.updateNavSize=function(){var e=d[this.navcontrols];e&&this.navigationsize?this.navigationClass=e[this.navigationsize]:this.navigationClass=""},n.prototype.resetPageNavigation=function(){this.pageCount=0,this.dn.currentPage=1,this.dataSize=0},n.prototype.calculatePagingValues=function(){this.pageCount=this.dataSize>this.maxResults?Math.ceil(this.dataSize/this.maxResults):this.dataSize<0?0:1,this.dn.currentPage=this.dn.currentPage||1},n.prototype.setDefaultPagingValues=function(e,t,n){e||t?(this.maxResults=t||this.maxResults,this.dataSize=a.isDefined(e)?e:this.dataSize,this.dn.currentPage=n||this.dn.currentPage,this.calculatePagingValues()):(this.pageCount=1,this.dn.currentPage=1,this.maxResults=e,this.dataSize=e),this.maxResultsEmitter.emit(this.maxResults)},n.prototype.checkDataSize=function(e,t,n){-1===e||e===a.AppConstants.INT_MAX_VALUE?(this.prevshowrecordcount=this.showrecordcount,this.isDisableLast=!0,this.isDisableCount=!0,this.showrecordcount=!1,t<n&&(this.isDisableNext=!0)):(this.isDisableCount=!1,this.showrecordcount=this.prevshowrecordcount||this.showrecordcount)},n.prototype.disableNavigation=function(){var e,t=1===this.dn.currentPage,n=this.dn.currentPage===this.pageCount;(null===(e=this.pagination)||void 0===e?void 0:e.next)?(this.isDisableFirst=this.isDisablePrevious=!this.pagination.prev,this.isDisableNext=this.isDisableLast=!this.pagination.next):(this.isDisableFirst=this.isDisablePrevious=t,this.isDisableNext=this.isDisableLast=n),this.isDisableCurrent=t&&n,this.dataset&&this.dataset.length&&this.isDisableNext&&this.parent.onDemandLoad&&"wm-table"===this.parent.widgetType&&this.parent.callDataGridMethod("hideLoadingIndicator",this.isDisableNext,this.parent.infScroll)},n.prototype.isDataSourceHasPaging=function(){return this.datasource&&this.datasource.execute(a.DataSource.Operation.IS_PAGEABLE)},n.prototype.setNonPageableData=function(e){var t,n,i,o;t=_.isArray(e)?e.length:_.isEmpty(e)?0:1,n=this.options&&this.options.maxResults||t,i=this.datasource&&(this.datasource.execute(a.DataSource.Operation.IS_API_AWARE)||"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(_.get(this.parent,"gridOptions.lastActionPerformed")===this.parent.gridOptions.ACTIONS.DATASET_UPDATE||!_.get(this.parent,"gridOptions.isNextPageData")))?1:this.dn.currentPage||1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),o=(this.dn.currentPage-1)*this.maxResults,this.setResult(_.isArray(e)?e.slice(o,o+this.maxResults):e)},n.prototype.setPagingValues=function(e){var t,n,i,o={};this.__fullData=e,this.binddataset?(o=(this.datasource||{})._options||{},e?this.isDataSourceHasPaging()?(this.pagination=this.datasource.execute(a.DataSource.Operation.GET_PAGING_OPTIONS)||{},this.filterFields=o.filterFields||{},this.logicalOp=o.logicalOp||"",this.sortOptions=o.orderBy||(_.isArray(this.pagination.sort)?r.getOrderByExpr(this.pagination.sort):""),t=this.pagination.totalElements,n=this.pagination.size,this.pagination.numberOfElements>0?(a.isDefined(this.pagination.number)&&(this.dn.currentPage=this.pagination.number+1),i=this.dn.currentPage||1):i=1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),this.checkDataSize(t,this.pagination.numberOfElements,this.pagination.size),this.setResult(e)):_.isString(e)||this.setNonPageableData(e):(this.setResult(e),this.resetPageNavigation()),"Basic"===this.navigation&&this._setAriaForBasicNavigation()):e&&!_.isString(e)&&this.setNonPageableData(e)},n.prototype.isFirstPage=function(){return 1===this.dn.currentPage||!this.dn.currentPage},n.prototype.isLastPage=function(){return this.dn.currentPage===this.pageCount},n.prototype.goToLastPage=function(e,t,n){this.isLastPage()?e&&this.goToPage(t,n):(this.dn.currentPage=this.pageCount,this.goToPage(t,n))},n.prototype.goToFirstPage=function(e,t,n){this.isFirstPage()?e&&this.goToPage(t,n):(this.dn.currentPage=1,this.goToPage(t,n))},n.prototype.goToPage=function(e,t){this.firstRow=(this.dn.currentPage-1)*this.maxResults;var n=this.parent.statePersistence.computeMode(this.statehandler);!n||"none"===n.toLowerCase()||"wm-table"!==this.parent.widgetType&&"wm-list"!==this.parent.widgetType||(this.parent._selectedItemsExist=!0,this.isFirstPage()?this.parent.statePersistence.removeWidgetState(this.parent,"pagination"):r.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation)<0?this.parent.statePersistence.setWidgetState(this.parent,{pagination:this.dn.currentPage}):"wm-list"!==this.parent.widgetType&&"wm-table"!==this.parent.widgetType||console.warn("Retain State handling on Widget "+this.parent.name+" is not supported for current pagination type.")),this.getPageData(e,t)},n.prototype.onPageDataReady=function(e,t,n){this.disableNavigation(),this.invokeSetRecord(e,t),a.triggerFn(n)},n.prototype.getPageData=function(e,t){var n,i,o=this;if(this.isDataSourceHasPaging()){var r=this.dn.currentPage;this.isEditNotInCurrentPage()&&"delete"!==this.parent.gridOptions.lastActionPerformed&&(r=this.parent.actionRowPage),this.datasource.execute(a.DataSource.Operation.LIST_RECORDS,{page:r,filterFields:this.filterFields,orderBy:this.sortOptions,logicalOp:this.logicalOp,matchMode:"anywhereignorecase"}).then((function(n){o.onPageDataReady(e,n&&n.data,t),a.$appDigest()}),(function(e){}))}else i=this.isEditNotInCurrentPage()?(this.parent.actionRowPage-1)*this.maxResults:(this.dn.currentPage-1)*this.maxResults,n=_.isArray(this.__fullData)?this.__fullData.slice(i,i+this.maxResults):this.__fullData,this.setResult(n),this.onPageDataReady(e,n,t)},n.prototype.isEditNotInCurrentPage=function(){var e=this.dn.currentPage;return"wm-table"===this.parent.widgetType&&e===this.parent.currentPage&&this.parent.actionRowPage&&this.parent.actionRowPage<e},n.prototype.invokeSetRecord=function(e,t){var n={currentPage:this.dn.currentPage,size:this.maxResults,totalElements:this.dataSize,totalPages:this.pageCount};this.parent?this.parent.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t}):this.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t})},n.prototype.validateCurrentPage=function(e,t){return!e||!(isNaN(this.dn.currentPage)||this.dn.currentPage<=0||this.pageCount&&(this.dn.currentPage>this.pageCount||_.isNull(this.dn.currentPage)))||(this.dn.currentPage<=0?this.dn.currentPage=1:this.dn.currentPage>this.pageCount&&(this.dn.currentPage=this.pageCount),!1)},n.prototype.onModelChange=function(e){this.validateCurrentPage(e)&&this.goToPage(e)},n.prototype.onKeyDown=function(e){var t=$(e.target).closest("a");return"KeyE"===e.code?(t.addClass("ng-invalid"),!1):(t.removeClass("ng-invalid"),!0)},n.prototype.pageChanged=function(e){this._debouncedPageChanged(e)},n.prototype.navigatePage=function(e,t,n,i){var o,r,s,l;switch(a.isDefined(this.parent.isDataLoading)&&!this.isDisableNext&&(this.parent.isDataLoading=!0,this.parent.infScroll&&(this.parent.variableInflight=!0,this.parent.callDataGridMethod("showLoadingIndicator",this.parent.loadingdatamsg,!0))),"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT),this.parent.gridOptions.setIsDatasetUpdated(!1)),this.invokeEventCallback("paginationchange",{$event:void 0,$index:this.dn.currentPage}),this.dn.currentPage=+this.dn.currentPage,e){case"first":return void this.goToFirstPage(n,t,i);case"prev":if(!((null===(o=this.pagination)||void 0===o?void 0:o.next)||!this.isFirstPage()&&this.validateCurrentPage(t,i)))return;(null===(r=this.pagination)||void 0===r?void 0:r.next)&&(this.datasource.pagination.isNext=!1,this.datasource.pagination.isPrev=!0),this.dn.currentPage-=1;break;case"next":if(!((null===(s=this.pagination)||void 0===s?void 0:s.next)||!this.isLastPage()&&this.validateCurrentPage(t,i)))return;(null===(l=this.pagination)||void 0===l?void 0:l.next)&&(this.datasource.pagination.isNext=!0,this.datasource.pagination.isPrev=!1),this.dn.currentPage+=1;break;case"last":return void this.goToLastPage(n,t,i)}this.goToPage(t,i)},n.prototype.setBindDataSet=function(e,t,n,i,o,r,s){var l,c=this,p=e.split(".");if(this.statehandler=s,"Variables"!==p[0]&&"Widgets"!==p[0]||(l=p[0]+"."+p[1]+".pagination"),!o&&i&&!r)return this.dataset=i,void this._debouncedApplyDataset();this.binddataset=e,setTimeout((function(){c.registerDestroyListener(a.$watch(e,t,r?n:{},(function(e){e?(c.dataset=e,c._debouncedApplyDataset()):c.widget.dataset=e}))),l&&c.registerDestroyListener(a.$watch(l,t,{},(function(){return c._debouncedApplyDataset()})))})),r||(this.datasource=n)},n.prototype.setDataSource=function(e){this.datasource=e},n.prototype.onPropertyChange=function(t,n,i){if("dataset"===t){var o=void 0;o=this.parent&&this.parent.onDataNavigatorDataSetChange?this.parent.onDataNavigatorDataSetChange(n):n,"wm-table"===this.parent.widgetType&&(this.parent._triggeredByUser=!1),this.isEditNotInCurrentPage()?this.setResult(o):this.setPagingValues(o)}else"navigation"===t?("Advanced"===n&&(this.navigation="Classic"),this.updateNavSize(),this.navcontrols=n):"navigationsize"===t?this.updateNavSize():"navigationalign"===t?a.switchClass(this.nativeElement,"text-"+n,"text-"+i):"maxResults"===t?this.setPagingValues(this.dataset):e.prototype.onPropertyChange.call(this,t,n,i)},n.prototype.ngAfterViewInit=function(){this.nativeElement.onclick=function(e){e.stopPropagation()}},n}(r.StylableComponent);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"[wmPagination]",template:'\n<ul class="pagination advanced {{navigationClass}}" *ngIf="navcontrols === \'Classic\'">\n <li [ngClass]="{\'disabled\':isDisableFirst}">\n <a [title]="appLocale.LABEL_FIRST" name="first" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableFirst"\n (click)="navigatePage(\'first\', $event)">\n <span aria-hidden="true"><i class="wi wi-first-page"></i></span>\n <span class="sr-only">Go to first page {{ isDisableFirst ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisablePrevious}">\n <a [title]="appLocale.LABEL_PREVIOUS" name="prev" href="javascript:void(0);"\n [attr.aria-disabled]="isDisablePrevious"\n (click)="navigatePage(\'prev\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n <span class="sr-only">Go to previous page {{ isDisablePrevious ? \', Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="pagecount disabled">\n <a href="javascript:void(0);">\n <input type="number" [disabled]="isDisableCurrent" [(ngModel)]="dn.currentPage" [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount"\n (keydown)="onKeyDown($event)" (change)="onModelChange($event)" class="form-control"/>\n </a>\n </li>\n <li class="disabled">\n <a [hidden]="isDisableCount"> / {{pageCount}}</a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableNext}">\n <a [title]="appLocale.LABEL_NEXT" name="next" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableNext"\n (click)="navigatePage(\'next\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n <span class="sr-only">Go to next page {{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableLast}">\n <a [title]="appLocale.LABEL_LAST" name="last" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableLast"\n (click)="navigatePage(\'last\', $event)">\n <span aria-hidden="true"><i class="wi wi-last-page"></i></span>\n <span class="sr-only">Go to last page {{ isDisableLast ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li *ngIf="showrecordcount" class="totalcount disabled">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n<ul class="pager {{navigationClass}}" *ngIf="navcontrols === \'Pager\'">\n <li class="previous" [ngClass]="{\'disabled\':isDisablePrevious}">\n <a href="javascript:void(0);" (click)="navigatePage(\'prev\', $event)"\n [attr.aria-disabled]="isDisablePrevious">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class="sr-only">{{ isDisablePrevious ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="next" [ngClass]="{\'disabled\':isDisableNext}">\n <a href="javascript:void(0);" (click)="navigatePage(\'next\', $event)"\n [attr.aria-disabled]="isDisableNext">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class="sr-only">{{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n</ul>\n\n<pagination class="pagination basic" [ngClass]="navigationClass" *ngIf="navcontrols === \'Basic\'" role="navigation"\n [itemsPerPage]="maxResults" [totalItems]="dataSize"\n [ngModel]="dn.currentPage" (pageChanged)="pageChanged($event)"\n [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount + \' pages\'"\n [boundaryLinks]="boundarylinks" [maxSize]="maxsize"\n [directionLinks]="directionlinks"\n firstText="Firtst" lastText="Last"\n [customPreviousTemplate]="prevTemplate"\n [customNextTemplate]="nextTemplate"\n [customPageTemplate]="pageTemplate"></pagination>\n\n<ul *ngIf="navcontrols === \'Basic\' && showrecordcount" class="pagination">\n <li class="totalcount disabled basiccount">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n\n<ng-template #pageTemplate let-page>\n <span class="sr-only" [attr.data-isacitvepage]="page.active">{{\'Page \'}}</span>\n {{page.number}}\n <span class="sr-only" *ngIf="page.active"> {{\', Showing page \' + page.number + \' of \' + pageCount}}</span>\n</ng-template>\n<ng-template #prevTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Previous page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Next page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n',providers:[r.provideAsWidgetRef(h)]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.SkipSelf},{type:t.Inject,args:[r.WidgetRef]}]}]},h.propDecorators={resultEmitter:[{type:t.Output}],maxResultsEmitter:[{type:t.Output}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.PaginationModule,r.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.PaginationComponent=h,e.PaginationModule=f,e["\u0275a"]=p,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/navigation/menu"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/data/card",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/navigation/menu","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.card={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.navigation.menu,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
479
479
  /*! *****************************************************************************
480
480
  Copyright (c) Microsoft Corporation.
481
481