@wavemaker/app-runtime-wm-build 11.4.0-next.25734 → 11.4.0-next.25736
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.
|
@@ -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
|
-
|
|
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.
|
|
23557
|
-
this.
|
|
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
|
-
|
|
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.
|
|
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
|
|
23576
|
-
if (
|
|
23577
|
-
if (
|
|
23578
|
-
|
|
23580
|
+
var node = void 0;
|
|
23581
|
+
if (nodes.length) {
|
|
23582
|
+
if (_this.datavalue === "FirstNode") {
|
|
23583
|
+
node = nodes[0];
|
|
23579
23584
|
}
|
|
23580
|
-
|
|
23581
|
-
|
|
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
|
-
|
|
23587
|
-
|
|
23588
|
-
|
|
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
|
|
|
@@ -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
|
-
|
|
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.
|
|
23557
|
-
this.
|
|
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
|
-
|
|
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.
|
|
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
|
|
23576
|
-
if (
|
|
23577
|
-
if (
|
|
23578
|
-
|
|
23580
|
+
var node = void 0;
|
|
23581
|
+
if (nodes.length) {
|
|
23582
|
+
if (_this.datavalue === "FirstNode") {
|
|
23583
|
+
node = nodes[0];
|
|
23579
23584
|
}
|
|
23580
|
-
|
|
23581
|
-
|
|
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
|
-
|
|
23587
|
-
|
|
23588
|
-
|
|
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
|
|