@wavemaker/app-runtime-wm-build 11.4.0-rc.5343 → 11.4.0-rc.5344

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.5343",
3
+ "version": "11.4.0-rc.5344",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -203224,6 +203224,8 @@ window.requestAnimationFrame = function() {
203224
203224
  if (json) {
203225
203225
  if (Object.keys(json).length === 0) {
203226
203226
  json = null;
203227
+ } else if (lodash__WEBPACK_IMPORTED_MODULE_1___default().get(json, "html.body.parsererror")) {
203228
+ json = null;
203227
203229
  } else {
203228
203230
  json = lodash__WEBPACK_IMPORTED_MODULE_1___default().get(json, Object.keys(json)[0]);
203229
203231
  }
@@ -4371,7 +4371,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.
4371
4371
  /*!***************************!*\
4372
4372
  !*** ./src/util/utils.ts ***!
4373
4373
  \***************************/
4374
- (e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_FORMATS:()=>l,DataType:()=>u,IDGenerator:()=>m,extractType:()=>w,findValueOf:()=>A,getBlob:()=>T,getClonedObject:()=>C,getValidJSON:()=>x,hasCordova:()=>v,isDateTimeType:()=>S,isDefined:()=>y,isNumberType:()=>b,isObject:()=>_,isPageable:()=>f,isValidWebURL:()=>h,noop:()=>p,removeExtraSlashes:()=>g,replace:()=>k,stringStartsWith:()=>M,triggerFn:()=>D,xmlToJson:()=>E});var r=n(/*! x2js */"./node_modules/x2js/x2js.js"),i=n.n(r),o=n(/*! lodash */"./node_modules/lodash/lodash.js"),a=n.n(o),s=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},u={INTEGER:"integer",BIG_INTEGER:"big_integer",SHORT:"short",FLOAT:"float",BIG_DECIMAL:"big_decimal",DOUBLE:"double",LONG:"long",BYTE:"byte",STRING:"string",CHARACTER:"character",TEXT:"text",DATE:"date",TIME:"time",TIMESTAMP:"timestamp",DATETIME:"datetime",LOCALDATETIME:"localdatetime",BOOLEAN:"boolean",LIST:"list",CLOB:"clob",BLOB:"blob"},l={DATE:"yyyy-MM-dd",TIME:"HH:mm:ss",TIMESTAMP:"timestamp",DATETIME:"yyyy-MM-ddTHH:mm:ss",LOCALDATETIME:"yyyy-MM-ddTHH:mm:ss",DATETIME_ORACLE:"yyyy-MM-dd HH:mm:ss",DATE_TIME:"yyyy-MM-dd HH:mm:ss"},c={SNAKE_CASE:/[A-Z]/g,ANDROID:/Android/i,IPHONE:/iPhone/i,IPOD:/iPod/i,IPAD:/iPad/i,MAC:/Mac/i,ANDROID_TABLET:/android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i,MOBILE:/Mobile/i,WINDOWS:/Windows Phone/i,SUPPORTED_IMAGE_FORMAT:/\.(bmp|gif|jpe|jpg|jpeg|tif|tiff|pbm|png|ico)$/i,SUPPORTED_FILE_FORMAT:/\.(txt|js|css|html|script|properties|json|java|xml|smd|xmi|sql|log|wsdl|vm|ftl|jrxml|yml|yaml|md|less|jsp)$/i,SUPPORTED_AUDIO_FORMAT:/\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,SUPPORTED_VIDEO_FORMAT:/\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,PAGE_RESOURCE_PATH:/^\/pages\/.*\.(js|css|html|json)$/,MIN_PAGE_RESOURCE_PATH:/.*(page.min.html)$/,VALID_EMAIL:/^[a-zA-Z][\w.+]+@[a-zA-Z_]+?\.[a-zA-Z.]{1,4}[a-zA-Z]$/,VALID_WEB_URL:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_WEBSOCKET_URL:/^(ws[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_RELATIVE_URL:/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,REPLACE_PATTERN:/\$\{([^\}]+)\}/g,ZIP_FILE:/\.zip$/i,EXE_FILE:/\.exe$/i,NO_QUOTES_ALLOWED:/^[^'|"]*$/,NO_DOUBLE_QUOTES_ALLOWED:/^[^"]*$/,VALID_HTML:/<[a-z][\s\S]*>/i,VALID_PASSWORD:/^[0-9a-zA-Z-_.@&*!#$%]+$/,SPECIAL_CHARACTERS:/[^A-Z0-9a-z_]+/i,APP_SERVER_URL_FORMAT:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9\.\-]+([:]?[0-9]{2,5}|\.[a-zA-Z]{2,5}[\.]{0,1})\/+[^?#&=]+$/,JSON_DATE_FORMAT:/\d{4}-[0-1]\d-[0-3]\d(T[0-2]\d:[0-5]\d:[0-5]\d.\d{1,3}Z$)?/,DATA_URL:/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i},d=["int",u.INTEGER,u.FLOAT,u.DOUBLE,u.LONG,u.SHORT,u.BYTE,u.BIG_INTEGER,u.BIG_DECIMAL],p=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]};var h=function(e){return c.VALID_WEB_URL.test(e)},f=function(e){var t=a().omit(e,"empty");return a().isEqual(a().keys({content:[],first:!0,last:!0,number:0,numberOfElements:10,size:20,sort:null,totalElements:10,totalPages:1}),a().keys(t).sort())},m=function(){function e(e){this.generator=function(e){var t;return s(this,(function(n){switch(n.label){case 0:t=1,n.label=1;case 1:return[4,""+e+t++];case 2:return n.sent(),[3,1];case 3:return[2]}}))}(e)}return e.prototype.nextUid=function(){return this.generator.next().value},e}(),v=function(){return!!window.cordova},g=function(e){if(a().isString(e))return a().startsWith(e,"file:///")||/^data:image\/([a-z]{2,});base64,/.test(e)?e:e.replace(new RegExp("([^:]/)(/)+","g"),"$1")},y=function(e){return void 0!==e},_=function(e){return null!==e&&"object"==typeof e},b=function(e){return-1!==d.indexOf(w(e).toLowerCase())},w=function(e){var t;return e?t=(t=(t=e&&e.substring(e.lastIndexOf(".")+1))&&t.toLowerCase())===u.LOCALDATETIME?u.DATETIME:t:u.STRING},S=function(e){return a().includes(e,".")&&(e=a().toLower(w(e))),a().includes([u.DATE,u.TIME,u.TIMESTAMP,u.DATETIME,u.LOCALDATETIME],e)},x=function(e){if(e)try{var t=parseInt(e,10);return _(e)||!isNaN(t)?e:JSON.parse(e)}catch(e){return}},E=function(e){var t=new(i())({emptyNodeForm:"content",attributePrefix:"",enableToStringFunc:!1}).xml2js(e);return t&&(t=0===Object.keys(t).length?null:a().get(t,Object.keys(t)[0])),t},k=function(e,t,n){var r=c.REPLACE_PATTERN;if(e)return n&&(r=/\{([^\}]+)\}/g),e.replace(r,(function(e,n){return a().get(t,n)}))},T=function(e,t){if(e instanceof Blob)return e;var n=x(e);return e=n&&n instanceof Object?new Blob([JSON.stringify(n)],{type:t||"application/json"}):new Blob([e],{type:t||"text/plain"})},C=function(e){return a().cloneDeep(e)},M=function(e,t,n){return!!e&&new RegExp("^"+t,n?"i":"").test(e)};function D(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=1,i=arguments.length,o=new Array(i-r);r<i;r++)o[r-1]=arguments[r];if(a().isFunction(e))return e.apply(null,o)}var A=function(e,t,n){if(e&&t){if(!n)return a().get(e,t);var r,i=t.split("."),o=[];if(i.forEach((function(e){if(!i.length)return r=!0,!1;for(var t,n=e.match(/\w+/g);n.length;)t=n.shift(),o.push({key:t,value:n.length?[]:{}})})),!r)return o.forEach((function(t){var n=e[t.key];_(n)||(n=x(n))||(n=t.value),e[t.key]=n,e=n})),e}}},"./src/util/variable/live-variable.http.utils.ts":
4374
+ (e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_FORMATS:()=>l,DataType:()=>u,IDGenerator:()=>m,extractType:()=>w,findValueOf:()=>A,getBlob:()=>T,getClonedObject:()=>C,getValidJSON:()=>x,hasCordova:()=>v,isDateTimeType:()=>S,isDefined:()=>y,isNumberType:()=>b,isObject:()=>_,isPageable:()=>f,isValidWebURL:()=>h,noop:()=>p,removeExtraSlashes:()=>g,replace:()=>k,stringStartsWith:()=>M,triggerFn:()=>D,xmlToJson:()=>E});var r=n(/*! x2js */"./node_modules/x2js/x2js.js"),i=n.n(r),o=n(/*! lodash */"./node_modules/lodash/lodash.js"),a=n.n(o),s=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},u={INTEGER:"integer",BIG_INTEGER:"big_integer",SHORT:"short",FLOAT:"float",BIG_DECIMAL:"big_decimal",DOUBLE:"double",LONG:"long",BYTE:"byte",STRING:"string",CHARACTER:"character",TEXT:"text",DATE:"date",TIME:"time",TIMESTAMP:"timestamp",DATETIME:"datetime",LOCALDATETIME:"localdatetime",BOOLEAN:"boolean",LIST:"list",CLOB:"clob",BLOB:"blob"},l={DATE:"yyyy-MM-dd",TIME:"HH:mm:ss",TIMESTAMP:"timestamp",DATETIME:"yyyy-MM-ddTHH:mm:ss",LOCALDATETIME:"yyyy-MM-ddTHH:mm:ss",DATETIME_ORACLE:"yyyy-MM-dd HH:mm:ss",DATE_TIME:"yyyy-MM-dd HH:mm:ss"},c={SNAKE_CASE:/[A-Z]/g,ANDROID:/Android/i,IPHONE:/iPhone/i,IPOD:/iPod/i,IPAD:/iPad/i,MAC:/Mac/i,ANDROID_TABLET:/android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i,MOBILE:/Mobile/i,WINDOWS:/Windows Phone/i,SUPPORTED_IMAGE_FORMAT:/\.(bmp|gif|jpe|jpg|jpeg|tif|tiff|pbm|png|ico)$/i,SUPPORTED_FILE_FORMAT:/\.(txt|js|css|html|script|properties|json|java|xml|smd|xmi|sql|log|wsdl|vm|ftl|jrxml|yml|yaml|md|less|jsp)$/i,SUPPORTED_AUDIO_FORMAT:/\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,SUPPORTED_VIDEO_FORMAT:/\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,PAGE_RESOURCE_PATH:/^\/pages\/.*\.(js|css|html|json)$/,MIN_PAGE_RESOURCE_PATH:/.*(page.min.html)$/,VALID_EMAIL:/^[a-zA-Z][\w.+]+@[a-zA-Z_]+?\.[a-zA-Z.]{1,4}[a-zA-Z]$/,VALID_WEB_URL:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_WEBSOCKET_URL:/^(ws[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_RELATIVE_URL:/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,REPLACE_PATTERN:/\$\{([^\}]+)\}/g,ZIP_FILE:/\.zip$/i,EXE_FILE:/\.exe$/i,NO_QUOTES_ALLOWED:/^[^'|"]*$/,NO_DOUBLE_QUOTES_ALLOWED:/^[^"]*$/,VALID_HTML:/<[a-z][\s\S]*>/i,VALID_PASSWORD:/^[0-9a-zA-Z-_.@&*!#$%]+$/,SPECIAL_CHARACTERS:/[^A-Z0-9a-z_]+/i,APP_SERVER_URL_FORMAT:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9\.\-]+([:]?[0-9]{2,5}|\.[a-zA-Z]{2,5}[\.]{0,1})\/+[^?#&=]+$/,JSON_DATE_FORMAT:/\d{4}-[0-1]\d-[0-3]\d(T[0-2]\d:[0-5]\d:[0-5]\d.\d{1,3}Z$)?/,DATA_URL:/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i},d=["int",u.INTEGER,u.FLOAT,u.DOUBLE,u.LONG,u.SHORT,u.BYTE,u.BIG_INTEGER,u.BIG_DECIMAL],p=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]};var h=function(e){return c.VALID_WEB_URL.test(e)},f=function(e){var t=a().omit(e,"empty");return a().isEqual(a().keys({content:[],first:!0,last:!0,number:0,numberOfElements:10,size:20,sort:null,totalElements:10,totalPages:1}),a().keys(t).sort())},m=function(){function e(e){this.generator=function(e){var t;return s(this,(function(n){switch(n.label){case 0:t=1,n.label=1;case 1:return[4,""+e+t++];case 2:return n.sent(),[3,1];case 3:return[2]}}))}(e)}return e.prototype.nextUid=function(){return this.generator.next().value},e}(),v=function(){return!!window.cordova},g=function(e){if(a().isString(e))return a().startsWith(e,"file:///")||/^data:image\/([a-z]{2,});base64,/.test(e)?e:e.replace(new RegExp("([^:]/)(/)+","g"),"$1")},y=function(e){return void 0!==e},_=function(e){return null!==e&&"object"==typeof e},b=function(e){return-1!==d.indexOf(w(e).toLowerCase())},w=function(e){var t;return e?t=(t=(t=e&&e.substring(e.lastIndexOf(".")+1))&&t.toLowerCase())===u.LOCALDATETIME?u.DATETIME:t:u.STRING},S=function(e){return a().includes(e,".")&&(e=a().toLower(w(e))),a().includes([u.DATE,u.TIME,u.TIMESTAMP,u.DATETIME,u.LOCALDATETIME],e)},x=function(e){if(e)try{var t=parseInt(e,10);return _(e)||!isNaN(t)?e:JSON.parse(e)}catch(e){return}},E=function(e){var t=new(i())({emptyNodeForm:"content",attributePrefix:"",enableToStringFunc:!1}).xml2js(e);return t&&(t=0===Object.keys(t).length||a().get(t,"html.body.parsererror")?null:a().get(t,Object.keys(t)[0])),t},k=function(e,t,n){var r=c.REPLACE_PATTERN;if(e)return n&&(r=/\{([^\}]+)\}/g),e.replace(r,(function(e,n){return a().get(t,n)}))},T=function(e,t){if(e instanceof Blob)return e;var n=x(e);return e=n&&n instanceof Object?new Blob([JSON.stringify(n)],{type:t||"application/json"}):new Blob([e],{type:t||"text/plain"})},C=function(e){return a().cloneDeep(e)},M=function(e,t,n){return!!e&&new RegExp("^"+t,n?"i":"").test(e)};function D(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=1,i=arguments.length,o=new Array(i-r);r<i;r++)o[r-1]=arguments[r];if(a().isFunction(e))return e.apply(null,o)}var A=function(e,t,n){if(e&&t){if(!n)return a().get(e,t);var r,i=t.split("."),o=[];if(i.forEach((function(e){if(!i.length)return r=!0,!1;for(var t,n=e.match(/\w+/g);n.length;)t=n.shift(),o.push({key:t,value:n.length?[]:{}})})),!r)return o.forEach((function(t){var n=e[t.key];_(n)||(n=x(n))||(n=t.value),e[t.key]=n,e=n})),e}}},"./src/util/variable/live-variable.http.utils.ts":
4375
4375
  /*!*******************************************************!*\
4376
4376
  !*** ./src/util/variable/live-variable.http.utils.ts ***!
4377
4377
  \*******************************************************/
@@ -22781,10 +22781,10 @@
22781
22781
  }));
22782
22782
 
22783
22783
  (function(global, factory) {
22784
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@angular/core"), require("@angular/common"), require("@wm/components/base")) : typeof define === "function" && define.amd ? define("@wm/components/basic/tree", [ "exports", "@angular/core", "@angular/common", "@wm/components/base" ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
22784
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@angular/core"), require("@angular/common"), require("@wm/components/base"), require("@wm/core")) : typeof define === "function" && define.amd ? define("@wm/components/basic/tree", [ "exports", "@angular/core", "@angular/common", "@wm/components/base", "@wm/core" ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
22785
22785
  factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {},
22786
- global.wm.components.basic = global.wm.components.basic || {}, global.wm.components.basic.tree = {}), global.ng.core, global.ng.common, global.wm.components.base));
22787
- })(this, (function(exports, core, common, base) {
22786
+ global.wm.components.basic = global.wm.components.basic || {}, global.wm.components.basic.tree = {}), global.ng.core, global.ng.common, global.wm.components.base, global.wm.core));
22787
+ })(this, (function(exports, core$1, common, base, core) {
22788
22788
  "use strict";
22789
22789
  /*! *****************************************************************************
22790
22790
  Copyright (c) Microsoft Corporation.
@@ -23173,7 +23173,11 @@
23173
23173
  _this.setting = {
23174
23174
  data: {
23175
23175
  simpleData: {
23176
- enable: true
23176
+ enable: false
23177
+ },
23178
+ key: {
23179
+ children: "children",
23180
+ name: "label"
23177
23181
  }
23178
23182
  },
23179
23183
  view: {
@@ -23210,11 +23214,19 @@
23210
23214
  break;
23211
23215
 
23212
23216
  case "nodelabel":
23213
- this.nodelabel = nv;
23217
+ this.setting.data.key.name = this.labelKey;
23218
+ this.renderTree();
23214
23219
  break;
23215
23220
 
23216
- case "icon":
23217
- this.nodeicon = nv;
23221
+ case "nodechildren":
23222
+ this.setting.data.key.children = this.childrenKey;
23223
+ this.renderTree();
23224
+ break;
23225
+
23226
+ case "nodeicon":
23227
+ this.nodeicon = this.iconKey;
23228
+ this.renderTree();
23229
+ break;
23218
23230
 
23219
23231
  case "orderby":
23220
23232
  this.renderTree();
@@ -23232,9 +23244,10 @@
23232
23244
  TreeComponent.prototype.expandTree = function(level, node, childLevel) {
23233
23245
  var _this = this;
23234
23246
  node.map((function(childNode) {
23235
- if ("children" in childNode && !("open" in childNode) && childLevel < level) {
23247
+ var children = _this.getChildren(childNode);
23248
+ if (children && !("open" in childNode) && childLevel < level) {
23236
23249
  childNode["open"] = true;
23237
- _this.expandTree(level, childNode.children, childLevel + 1);
23250
+ _this.expandTree(level, children, childLevel + 1);
23238
23251
  } else {
23239
23252
  childLevel = 0;
23240
23253
  return;
@@ -23283,8 +23296,9 @@
23283
23296
  var _this = this;
23284
23297
  if (depth === 0) {
23285
23298
  nodes.map((function(node) {
23286
- if (node.children) {
23287
- _this.setNodeData(node.children, depth, level, parentNode, type);
23299
+ var children = _this.getChildren(node);
23300
+ if (children) {
23301
+ _this.setNodeData(children, depth, level, parentNode, type);
23288
23302
  }
23289
23303
  if (node.icon && _this.nodelabel == "icon") {
23290
23304
  node[type] = node.icon;
@@ -23296,11 +23310,12 @@
23296
23310
  }));
23297
23311
  } else {
23298
23312
  nodes.map((function(node) {
23299
- if (node.children && level > 1) {
23313
+ var children = _this.getChildren(node);
23314
+ if (children && level > 1) {
23300
23315
  if (depth === level) {
23301
23316
  parentNode = node;
23302
23317
  }
23303
- _this.setNodeData(node.children, depth, level - 1, parentNode, type);
23318
+ _this.setNodeData(children, depth, level - 1, parentNode, type);
23304
23319
  }
23305
23320
  if (level === 1 && (type === "name" ? _this.nodelabel.includes("label") || _this.nodelabel.includes("name") : _this.nodeicon.includes("label") || _this.nodeicon.includes("name"))) {
23306
23321
  parentNode[type] = node.name || node.label;
@@ -23327,20 +23342,26 @@
23327
23342
  };
23328
23343
  TreeComponent.prototype.getPath = function(treeNode, path) {
23329
23344
  if (treeNode.getParentNode() === null) {
23330
- path = "/" + treeNode.name + path;
23345
+ path = "/" + treeNode[this.labelKey] + path;
23331
23346
  } else {
23332
- path = this.getPath(treeNode.getParentNode(), path) + "/" + treeNode.name;
23347
+ path = this.getPath(treeNode.getParentNode(), path) + "/" + treeNode[this.labelKey];
23333
23348
  }
23334
23349
  return path;
23335
23350
  };
23336
23351
  TreeComponent.prototype.onClick = function(event, treeId, treeNode, clickFlag) {
23337
- var treeObj = $.fn.zTree.getZTreeObj("" + this.name);
23352
+ if (this.nodeclick === "expand") {
23353
+ var nodes = this.treeObj.getSelectedNodes();
23354
+ if (nodes.length > 0) {
23355
+ this.expandNode(nodes[0], !nodes[0].open, true);
23356
+ }
23357
+ }
23338
23358
  var path = this.getPath(treeNode, "");
23339
23359
  var eventParams = {
23340
23360
  $event: event,
23341
23361
  $item: treeNode,
23342
23362
  $path: path
23343
23363
  };
23364
+ this.setSelectedItem(treeNode);
23344
23365
  this.invokeEventCallback("select", eventParams);
23345
23366
  };
23346
23367
  TreeComponent.prototype.onExpand = function(event, treeId, treeNode) {
@@ -23352,7 +23373,8 @@
23352
23373
  $path: path
23353
23374
  };
23354
23375
  this.invokeEventCallback("expand", eventParams);
23355
- treeNode.children ? treeNode.children.map((function(el) {
23376
+ var children = this.getChildren(treeNode);
23377
+ children === null || children === void 0 ? void 0 : children.map((function(el) {
23356
23378
  if (el.isParent) {
23357
23379
  var ele_1 = $("#" + el.tId + "_switch");
23358
23380
  $(ele_1).addClass(self.treeicon || defaultTreeIconClass);
@@ -23362,7 +23384,7 @@
23362
23384
  }), 0);
23363
23385
  }));
23364
23386
  }
23365
- })) : "";
23387
+ }));
23366
23388
  };
23367
23389
  TreeComponent.prototype.onCollapse = function(event, treeId, treeNode) {
23368
23390
  var path = this.getPath(treeNode, "");
@@ -23373,20 +23395,52 @@
23373
23395
  };
23374
23396
  this.invokeEventCallback("collapse", eventParams);
23375
23397
  };
23398
+ TreeComponent.prototype.getChildren = function(node) {
23399
+ return node[this.childrenKey];
23400
+ };
23401
+ Object.defineProperty(TreeComponent.prototype, "childrenKey", {
23402
+ get: function() {
23403
+ var depth = this.countDepth(this.nodechildren);
23404
+ return depth ? this.nodechildren.split(".").pop() : this.nodechildren || "children";
23405
+ },
23406
+ enumerable: false,
23407
+ configurable: true
23408
+ });
23409
+ Object.defineProperty(TreeComponent.prototype, "labelKey", {
23410
+ get: function() {
23411
+ var depth = this.countDepth(this.nodelabel);
23412
+ return depth ? this.nodelabel.split(".").pop() : this.nodelabel || "label";
23413
+ },
23414
+ enumerable: false,
23415
+ configurable: true
23416
+ });
23417
+ Object.defineProperty(TreeComponent.prototype, "iconKey", {
23418
+ get: function() {
23419
+ var depth = this.countDepth(this.nodeicon);
23420
+ return depth ? this.nodeicon.split(".").pop() : this.nodeicon || "icon";
23421
+ },
23422
+ enumerable: false,
23423
+ configurable: true
23424
+ });
23425
+ Object.defineProperty(TreeComponent.prototype, "treeObj", {
23426
+ get: function() {
23427
+ return $.fn.zTree.getZTreeObj("" + this.name);
23428
+ },
23429
+ enumerable: false,
23430
+ configurable: true
23431
+ });
23376
23432
  TreeComponent.prototype.modifyObjects = function(array) {
23377
23433
  var _this = this;
23378
23434
  array.forEach((function(obj) {
23379
- if (obj.label !== undefined) {
23380
- obj.name = obj.label;
23381
- delete obj.label;
23382
- }
23383
- if (obj.children !== undefined) {
23384
- _this.modifyObjects(obj.children);
23435
+ obj.icon = obj[_this.nodeicon];
23436
+ var children = _this.getChildren(obj);
23437
+ if (children === null || children === void 0 ? void 0 : children.length) {
23438
+ _this.modifyObjects(children);
23385
23439
  }
23386
23440
  }));
23387
- return array;
23388
23441
  };
23389
23442
  TreeComponent.prototype.setNodeChildren = function(nodes, depth, level, parentNode) {
23443
+ var _this = this;
23390
23444
  if (depth <= 0) {
23391
23445
  return nodes;
23392
23446
  }
@@ -23395,17 +23449,17 @@
23395
23449
  if (depth === level) {
23396
23450
  parentNode = nodes[i];
23397
23451
  }
23398
- if (node.children && node.children.length > 0) {
23452
+ var children = this.getChildren(node);
23453
+ if (children === null || children === void 0 ? void 0 : children.length) {
23399
23454
  if (level === 1) {
23400
- parentNode.children = node.children.map((function(child) {
23401
- return {
23402
- name: child.name,
23403
- children: child === null || child === void 0 ? void 0 : child.children
23404
- };
23455
+ parentNode[this.childrenKey] = children.map((function(child) {
23456
+ var _a;
23457
+ return _a = {}, _a[_this.labelKey] = child[_this.labelKey], _a[_this.childrenKey] = _this.getChildren(child),
23458
+ _a.icon = child[_this.iconKey], _a;
23405
23459
  }));
23406
23460
  return;
23407
23461
  } else {
23408
- this.setNodeChildren(node.children, depth, level - 1, parentNode);
23462
+ this.setNodeChildren(children, depth, level - 1, parentNode);
23409
23463
  }
23410
23464
  }
23411
23465
  }
@@ -23436,10 +23490,11 @@
23436
23490
  return count;
23437
23491
  };
23438
23492
  TreeComponent.prototype.renderTree = function() {
23439
- console.log(this.nodes, "this.nodes");
23440
23493
  if (this.nodes) {
23441
23494
  this.nativeElement.setAttribute("id", this.name);
23442
- this.nodes = this.modifyObjects(this.nodes);
23495
+ if (this.nodeicon && this.nodeicon !== "icon") {
23496
+ this.modifyObjects(this.nodes);
23497
+ }
23443
23498
  this.setTreeTemplate(this.treeClass);
23444
23499
  if (this.nodelabel) {
23445
23500
  var depth = 0;
@@ -23469,27 +23524,58 @@
23469
23524
  var zTree = $.fn.zTree.init($('ul[name="' + this.name + '"]'), this.setting, this.nodes);
23470
23525
  $.fn.zTreeKeyboardNavigation(zTree, $('ul[name="' + this.name + '"]'), null, this.treeicon || defaultTreeIconClass);
23471
23526
  };
23527
+ TreeComponent.prototype.setSelectedItem = function(treeNode) {
23528
+ debugger;
23529
+ this.selecteditem = core.getClonedObject(treeNode) || {};
23530
+ this.selecteditem.path = this.getPath(treeNode, "");
23531
+ var deSelectElm = $("li[treenode].selected");
23532
+ deSelectElm.removeClass("selected");
23533
+ var selectElm = $("#" + treeNode.tId + ":has(.curSelectedNode)");
23534
+ selectElm.addClass("selected");
23535
+ };
23536
+ TreeComponent.prototype.expandNode = function(node, expand, eventFlag) {
23537
+ this.treeObj.expandNode(node, expand, false, false, eventFlag);
23538
+ var el = $("#" + node.tId + "_switch");
23539
+ $(el).addClass(this.treeicon || defaultTreeIconClass);
23540
+ };
23472
23541
  TreeComponent.prototype.ngAfterViewInit = function() {
23473
23542
  var _this = this;
23474
23543
  setTimeout((function() {
23475
23544
  _this.changeTreeIcons(_this.treeicon || defaultTreeIconClass);
23545
+ if (_this.datavalue) {
23546
+ var nodes = _this.treeObj.getNodes();
23547
+ var selectNode = void 0;
23548
+ if (_this.datavalue === "FirstNode") {
23549
+ if (nodes.length) {
23550
+ selectNode = nodes[0];
23551
+ }
23552
+ }
23553
+ if (_this.datavalue === "LastNode") {
23554
+ if (nodes.length) {
23555
+ selectNode = nodes[nodes.length - 1];
23556
+ }
23557
+ }
23558
+ _this.treeObj.selectNode(selectNode, false);
23559
+ _this.setSelectedItem(selectNode);
23560
+ _this.expandNode(selectNode, true, false);
23561
+ }
23476
23562
  }), 200);
23477
23563
  };
23478
23564
  return TreeComponent;
23479
23565
  }(base.StylableComponent);
23480
23566
  TreeComponent.initializeProps = registerProps();
23481
23567
  TreeComponent.decorators = [ {
23482
- type: core.Component,
23568
+ type: core$1.Component,
23483
23569
  args: [ {
23484
23570
  selector: "ul[wmTree]",
23485
23571
  template: '<ul #wmTree class="ztree" id="ztree"></ul> ',
23486
23572
  providers: [ base.provideAsWidgetRef(TreeComponent) ],
23487
- encapsulation: core.ViewEncapsulation.None
23573
+ encapsulation: core$1.ViewEncapsulation.None
23488
23574
  } ]
23489
23575
  } ];
23490
23576
  TreeComponent.ctorParameters = function() {
23491
23577
  return [ {
23492
- type: core.Injector
23578
+ type: core$1.Injector
23493
23579
  } ];
23494
23580
  };
23495
23581
  var components = [ TreeComponent ];
@@ -23498,7 +23584,7 @@
23498
23584
  return TreeModule;
23499
23585
  }();
23500
23586
  TreeModule.decorators = [ {
23501
- type: core.NgModule,
23587
+ type: core$1.NgModule,
23502
23588
  args: [ {
23503
23589
  imports: [ common.CommonModule, base.WmComponentsModule ],
23504
23590
  declarations: __spreadArray([], __read(components)),
@@ -63359,30 +63445,37 @@
63359
63445
  toaster.onHidden.subscribe(this.onToasterHide.bind(this, variable));
63360
63446
  }
63361
63447
  };
63448
+ NotificationActionManager.prototype.getDialogConfig = function(variable, options, dialogId, closeCallBackFn) {
63449
+ return {
63450
+ title: options.title || variable.dataBinding.title,
63451
+ text: options.message || variable.dataBinding.text,
63452
+ okButtonText: options.okButtonText || variable.dataBinding.okButtonText || "OK",
63453
+ cancelButtonText: options.cancelButtonText || variable.dataBinding.cancelButtonText || "CANCEL",
63454
+ alerttype: options.alerttype || variable.dataBinding.alerttype || "information",
63455
+ onOk: function() {
63456
+ exports.dialogService.close(dialogId, undefined, closeCallBackFn);
63457
+ },
63458
+ onCancel: function() {
63459
+ initiateCallback("onCancel", variable, options.data);
63460
+ exports.dialogService.close(dialogId, undefined);
63461
+ },
63462
+ onClose: function() {
63463
+ initiateCallback("onClose", variable, options.data);
63464
+ }
63465
+ };
63466
+ };
63362
63467
  NotificationActionManager.prototype.notifyViaDialog = function(variable, options) {
63363
- var commonPageDialogId = "Common" + _.capitalize(variable.operation) + "Dialog", dialogId = commonPageDialogId;
63468
+ var isPrefabType = core.getWmProjectProperties().type === "PREFAB";
63469
+ var dialogPrefix = isPrefabType ? "Prefab" : "Common";
63470
+ var dialogId = dialogPrefix + _.capitalize(variable.operation) + "Dialog";
63364
63471
  var closeCallBackFn = function() {
63365
63472
  return initiateCallback("onOk", variable, options.data);
63366
63473
  };
63367
- exports.dialogService.open(dialogId, undefined, {
63368
- notification: {
63369
- title: options.title || variable.dataBinding.title,
63370
- text: options.message || variable.dataBinding.text,
63371
- okButtonText: options.okButtonText || variable.dataBinding.okButtonText || "OK",
63372
- cancelButtonText: options.cancelButtonText || variable.dataBinding.cancelButtonText || "CANCEL",
63373
- alerttype: options.alerttype || variable.dataBinding.alerttype || "information",
63374
- onOk: function() {
63375
- exports.dialogService.close(dialogId, undefined, closeCallBackFn);
63376
- },
63377
- onCancel: function() {
63378
- initiateCallback("onCancel", variable, options.data);
63379
- exports.dialogService.close(dialogId, undefined);
63380
- },
63381
- onClose: function() {
63382
- initiateCallback("onClose", variable, options.data);
63383
- }
63384
- }
63385
- });
63474
+ var dialogConfig = this.getDialogConfig(variable, options, dialogId, closeCallBackFn);
63475
+ dialogConfig = isPrefabType ? dialogConfig : {
63476
+ notification: dialogConfig
63477
+ };
63478
+ exports.dialogService.open(dialogId, undefined, dialogConfig);
63386
63479
  };
63387
63480
  NotificationActionManager.prototype.notify = function(variable, options, success, error) {
63388
63481
  var operation = variable.operation;
@@ -69143,7 +69236,7 @@
69143
69236
  type: i0.Component,
69144
69237
  args: [ {
69145
69238
  selector: "app-root",
69146
- template: '<ng-container *ngIf="startApp">\n <router-outlet></router-outlet>\n <div wmContainer partialContainer content="Common" hidden class="ng-hide" *ngIf="isApplicationType"></div>\n <app-spinner name="globalspinner" classname="global-spinner" role="alert" aria-live="assertive" [attr.aria-label]="spinner.arialabel || \'Loading\'" [show]="spinner.show" [spinnermessages]="spinner.messages"></app-spinner>\n <div wmDialog name="oAuthLoginDialog" title="Application is requesting you to sign in with"\n close.event="closeOAuthDialog()">\n <ng-template #dialogBody>\n <ul class="list-items">\n <li class="list-item" *ngFor="let provider of providersConfig">\n <button class="btn" (click)="provider.invoke()">{{provider.name}}</button>\n </li>\n </ul>\n </ng-template>\n </div>\n <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"\n canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div wmAppExt></div>\n <i id="wm-mobile-display"></i>\n</ng-container>\n\x3c!--Dummy container to create the component dynamically--\x3e\n<ng-container #dynamicComponent></ng-container>\n',
69239
+ template: '<ng-container *ngIf="startApp">\n <router-outlet></router-outlet>\n <div wmContainer partialContainer content="Common" hidden class="ng-hide" *ngIf="isApplicationType"></div>\n <app-spinner name="globalspinner" classname="global-spinner" role="alert" aria-live="assertive" [attr.aria-label]="spinner.arialabel || \'Loading\'" [show]="spinner.show" [spinnermessages]="spinner.messages"></app-spinner>\n <div wmDialog name="oAuthLoginDialog" title="Application is requesting you to sign in with"\n close.event="closeOAuthDialog()">\n <ng-template #dialogBody>\n <ul class="list-items">\n <li class="list-item" *ngFor="let provider of providersConfig">\n <button class="btn" (click)="provider.invoke()">{{provider.name}}</button>\n </li>\n </ul>\n </ng-template>\n </div>\n <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"\n canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div *ngIf="!isApplicationType" wmConfirmDialog name="PrefabConfirmDialog" title.bind="title" message.bind="text" oktext.bind="okButtonText"\n canceltext.bind="cancelButtonText" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div *ngIf="!isApplicationType" wmAlertDialog name="PrefabAlertDialog" title.bind="title" message.bind="text" oktext.bind="okButtonText"\n canceltext.bind="cancelButtonText" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div wmAppExt></div>\n <i id="wm-mobile-display"></i>\n</ng-container>\n\x3c!--Dummy container to create the component dynamically--\x3e\n<ng-container #dynamicComponent></ng-container>\n',
69147
69240
  encapsulation: i0.ViewEncapsulation.None
69148
69241
  } ]
69149
69242
  } ];