UNPKG

@pepperi/lib

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.1.

1 lines 53 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/core"),require("@angular/material/checkbox"),require("@angular/material/radio"),require("@angular/material/icon"),require("@pepperi/lib"),require("@pepperi/lib/icon"),require("@pepperi/lib/form"),require("@tweenjs/tween.js"),require("rxjs/operators"),require("disable-scroll"),require("jquery"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@pepperi/lib/list",["exports","@angular/core","@angular/common","@angular/material/core","@angular/material/checkbox","@angular/material/radio","@angular/material/icon","@pepperi/lib","@pepperi/lib/icon","@pepperi/lib/form","@tweenjs/tween.js","rxjs/operators","disable-scroll","jquery","@ngx-translate/core"],t):t(((e=e||self).pepperi=e.pepperi||{},e.pepperi.lib=e.pepperi.lib||{},e.pepperi.lib.list={}),e.ng.core,e.ng.common,e.ng.material.core,e.ng.material.checkbox,e.ng.material.radio,e.ng.material.icon,e.pepperi.lib,e.pepperi.lib.icon,e.pepperi.lib.form,e.tween,e.rxjs.operators,e["disable-scroll"],e.jquery,e.translate)}(this,(function(e,t,n,i,l,o,r,s,a,c,u,d,h,p,m){"use strict";h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h;var f=["container"],g=["content"],C=["shim"],I=function(){function e(e,n,i){var l=this;this.element=e,this.renderer=n,this.zone=i,this.totalRows=0,this.bufferAmount=0,this.scrollAnimationTime=1500,this.doNotCheckAngularZone=!1,this.refreshHandler=function(){l.refresh(!0)},this.isTable=!1,this.change=new t.EventEmitter,this.load=new t.EventEmitter,this.start=new t.EventEmitter,this.end=new t.EventEmitter,this.startupLoop=!0,this.lastScrollHeight=-1,this.lastTopPadding=-1}return Object.defineProperty(e.prototype,"parentScroll",{get:function(){return this._parentScroll},set:function(e){this._parentScroll!==e&&(this._parentScroll=e,this.addParentEventHandlers(this._parentScroll))},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.scrollbarWidth=0,this.scrollbarHeight=0,this.parentScroll||this.addParentEventHandlers(this.element.nativeElement)},e.prototype.ngOnDestroy=function(){this.removeParentEventHandlers()},e.prototype.ngOnChanges=function(e){this.previousStart=void 0,this.previousEnd=void 0;var t=e.totalRows||{};(void 0!==e.totalRows&&void 0===t.previousValue||void 0!==t.previousValue)&&(this.startupLoop=!0);var n=this.detectIE();!n||n>=16?this.renderer.setStyle(this.element.nativeElement,"top","0"):this.renderer.setStyle(this.element.nativeElement,"top","34px"),this.refresh()},e.prototype.detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)},e.prototype.refresh=function(e){var t=this;void 0===e&&(e=!1),this.zone.runOutsideAngular((function(){requestAnimationFrame((function(){return t.calculateItems(e)}))}))},e.prototype.scrollInto=function(e){var t=this,n=this.parentScroll instanceof Window?document.body:this.parentScroll||this.element.nativeElement;this.getElementsOffset();if(!(e<0||e>=this.totalRows)){var i,l=this.calculateDimensions(),o=Math.floor(e/l.itemsPerRow)*l.childHeight-l.childHeight*Math.min(e,this.bufferAmount);if(void 0!==this.currentTween&&this.currentTween.stop(),this.scrollAnimationTime){this.currentTween=new u.Tween({scrollTop:n.scrollTop}).to({scrollTop:o},this.scrollAnimationTime).easing(u.Easing.Quadratic.Out).onUpdate((function(e){isNaN(e.scrollTop)||(t.renderer.setProperty(n,"scrollTop",e.scrollTop),t.refresh(!0))})).onStop((function(){cancelAnimationFrame(i)})).start();var r=function(e){t.currentTween.update(e),t.currentTween._object.scrollTop!==o&&t.zone.runOutsideAngular((function(){i=requestAnimationFrame(r)}))};r()}else n.scrollTop=o}},e.prototype.addParentEventHandlers=function(e){var t=this;this.removeParentEventHandlers(),e&&this.zone.runOutsideAngular((function(){t.disposeScrollHandler=t.renderer.listen(e,"mousewheel",_.throttle(t.refreshHandler,20,{leading:!1,trailing:!0})),t.renderer.listen(e,"scroll",_.debounce(t.refreshHandler,150)),e instanceof Window&&(t.disposeScrollHandler=t.renderer.listen("window","resize",_.debounce(t.refreshHandler,250)))}))},e.prototype.removeParentEventHandlers=function(){this.disposeScrollHandler&&(this.disposeScrollHandler(),this.disposeScrollHandler=void 0),this.disposeResizeHandler&&(this.disposeResizeHandler(),this.disposeResizeHandler=void 0)},e.prototype.countItemsPerRow=function(){var e,t,n=this.contentElementRef.nativeElement.children;for(t=0;t<n.length&&(null==e||e===n[t].offsetTop);t++)e=n[t].offsetTop;return t},e.prototype.getElementsOffset=function(){var e=0;return this.containerElementRef&&this.containerElementRef.nativeElement&&(e+=this.containerElementRef.nativeElement.offsetTop),this.parentScroll&&(e+=this.element.nativeElement.offsetTop),e},e.prototype.calculateDimensions=function(){var e,t=this.parentScroll instanceof Window?document.body:this.parentScroll||this.element.nativeElement,n=this.totalRows,i=t.clientWidth-this.scrollbarWidth,l=t.clientHeight-this.scrollbarHeight;if(null==this.childWidth||null==this.childHeight){var o=this.contentElementRef.nativeElement;this.containerElementRef&&this.containerElementRef.nativeElement&&(o=this.containerElementRef.nativeElement),e=o.children[0]?o.children[0].getBoundingClientRect():{width:i,height:l}}var r=this.childWidth||e.width,s=this.childHeight||e.height,a=Math.max(1,this.countItemsPerRow()),c=Math.max(1,Math.floor(i/r)),u=Math.max(1,Math.floor(l/s)),d=this.parentScroll instanceof Window?window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0:t.scrollTop,h=Math.max(0,d),p=s*Math.floor(n/a)+(n%a!=0?s:0);navigator.userAgent;return 1===u&&Math.floor(h/p*n)+c>=n&&(a=c),p!==this.lastScrollHeight&&(this.renderer.setStyle(this.shimElementRef.nativeElement,"height",p+"px"),this.lastScrollHeight=p),{itemCount:n,viewWidth:i,viewHeight:l,childWidth:r,childHeight:s,itemsPerRow:a,itemsPerCol:u,itemsPerRowByCalc:c,scrollHeight:p}},e.prototype.calculateItems=function(e){var n=this;void 0===e&&(e=!1),this.doNotCheckAngularZone||t.NgZone.assertNotInAngularZone();var i=this.parentScroll instanceof Window?document.body:this.parentScroll||this.element.nativeElement,l=this.calculateDimensions(),o=this.getElementsOffset(),r=this.parentScroll instanceof Window?window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0:i.scrollTop;r>l.scrollHeight&&(r=l.scrollHeight+o);var s=Math.max(0,r-o)/l.scrollHeight*l.itemCount/l.itemsPerRow,a=Math.min(l.itemCount,Math.ceil(s)*l.itemsPerRow+l.itemsPerRow*(l.itemsPerCol+1)),c=a,u=a%l.itemsPerRow;u&&(c=a+l.itemsPerRow-u);var d=Math.max(0,c-l.itemsPerCol*l.itemsPerRow-l.itemsPerRow),h=Math.min(d,Math.floor(s)*l.itemsPerRow),p=Math.ceil(h/l.itemsPerRow),m=0===this.totalRows?0:l.childHeight*p-l.childHeight*Math.min(p,this.bufferAmount);m!==this.lastTopPadding&&(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform","translateY("+m+"px)"),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform","translateY("+m+"px)"),this.lastTopPadding=m);var f=this.bufferAmount*l.itemsPerRow;h=isNaN(h)?-1:h,a=isNaN(a)?-1:a,h-=f,h=Math.max(0,h),a+=f,a=Math.min(this.totalRows,a),h!==this.previousStart||a!==this.previousEnd||!0===e?this.zone.run((function(){a=a>=0?a:0;var e=n.previousEnd>=a;if(n.previousStart=h,n.previousEnd=a,!0===n.startupLoop)n.refresh();else{var t=l.childHeight;n.change.emit({start:h,end:a,addAtStart:e,calculatedChildHeight:t})}})):!0===this.startupLoop&&(this.startupLoop=!1,this.load.emit(),this.refresh())},e}();I.ɵfac=function(e){return new(e||I)(t.ɵɵdirectiveInject(t.ElementRef),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.NgZone))},I.ɵcmp=t.ɵɵdefineComponent({type:I,selectors:[["virtual-scroll"],["","virtualScroll",""]],contentQueries:function(e,n,i){var l;(1&e&&t.ɵɵcontentQuery(i,f,!0),2&e)&&(t.ɵɵqueryRefresh(l=t.ɵɵloadQuery())&&(n.containerElementRef=l.first))},viewQuery:function(e,n){var i;(1&e&&(t.ɵɵviewQuery(g,!0,t.ElementRef),t.ɵɵviewQuery(C,!0,t.ElementRef)),2&e)&&(t.ɵɵqueryRefresh(i=t.ɵɵloadQuery())&&(n.contentElementRef=i.first),t.ɵɵqueryRefresh(i=t.ɵɵloadQuery())&&(n.shimElementRef=i.first))},hostVars:2,hostBindings:function(e,n){2&e&&t.ɵɵstyleProp("overflow-y",n.parentScroll?"hidden":"auto")},inputs:{totalRows:"totalRows",scrollbarWidth:"scrollbarWidth",scrollbarHeight:"scrollbarHeight",childWidth:"childWidth",childHeight:"childHeight",bufferAmount:"bufferAmount",scrollAnimationTime:"scrollAnimationTime",doNotCheckAngularZone:"doNotCheckAngularZone",parentScroll:"parentScroll",isTable:"isTable"},outputs:{change:"change",load:"load",start:"start",end:"end"},exportAs:["virtualScroll"],features:[t.ɵɵNgOnChangesFeature],ngContentSelectors:["*"],decls:5,vars:0,consts:[[1,"total-padding"],["shim",""],[1,"scrollable-content"],["content",""]],template:function(e,n){1&e&&(t.ɵɵprojectionDef(),t.ɵɵelement(0,"div",0,1),t.ɵɵelementStart(2,"div",2,3),t.ɵɵprojection(4),t.ɵɵelementEnd())},styles:["[_nghost-%COMP%] {\n overflow: hidden;\n position: relative;\n display: block;\n -webkit-overflow-scrolling: touch;\n }\n .scrollable-content[_ngcontent-%COMP%] {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n // z-index:495;\n }\n .total-padding[_ngcontent-%COMP%] {\n width: 1px;\n opacity: 0;\n }\n\n .rtl[_ngcontent-%COMP%] {\n .scrollable-content {\n left: unset;\n right: 0;\n }\n }"]});var S=function(){};S.ɵmod=t.ɵɵdefineNgModule({type:S}),S.ɵinj=t.ɵɵdefineInjector({factory:function(e){return new(e||S)}}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(S,{declarations:[I],exports:[I]});Object.create;function y(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.")}Object.create;var T=["noVirtualScrollCont"],v=["tableHeader"],E=["selectAllCB"];function A(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",3),t.ɵɵtext(2),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){var i=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(i.noDataFoundMsg)}}var b=function(e){return{visibility:e}};function x(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-checkbox",13,14),t.ɵɵlistener("change",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).selectAllItemsForActions(e)})),t.ɵɵelementEnd()}if(2&e){var l=t.ɵɵnextContext(3);t.ɵɵproperty("ngStyle",t.ɵɵpureFunction1(4,b,l.selectionTypeForActions==l.SELECTION_TYPE_FOR_ACTIONS.Single||l.selectionTypeForActions==l.SELECTION_TYPE_FOR_ACTIONS.Multi&&l.hideAllSelectionInMulti?"hidden":"visible"))("indeterminate",l.isAllSelected?l.unSelectedItems.size>0&&l.unSelectedItems.size<l.totalRows:l.selectedItems.size>0&&!l.getIsAllSelectedForActions())("disabled",l.disabled||l.selectionTypeForActions===l.SELECTION_TYPE_FOR_ACTIONS.Single)("checked",l.getIsAllSelectedForActions())}}function w(e,n){if(1&e&&(t.ɵɵelementStart(0,"label",20),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext().$implicit;t.ɵɵclassMapInterpolate1("header-label body-sm pull-left flip text-align-",i.Layout.XAlignment,""),t.ɵɵpropertyInterpolate("id",i.ApiName),t.ɵɵpropertyInterpolate("title",i.Title),t.ɵɵadvance(1),t.ɵɵtextInterpolate1(" ",i.Title," ")}}function D(e,n){if(1&e&&(t.ɵɵelementStart(0,"label",21),t.ɵɵtext(1," "),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext().$implicit;t.ɵɵpropertyInterpolate("id",i.ApiName)}}function F(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",22),t.ɵɵlistener("mousedown",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(3).onListResizeStart(e,n.ApiName)})),t.ɵɵelementStart(1,"mat-icon"),t.ɵɵelement(2,"pep-icon",23),t.ɵɵelementEnd(),t.ɵɵelementEnd()}}function O(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon"),t.ɵɵelement(1,"pep-icon",26),t.ɵɵelementEnd())}var R=function(e){return{"sort-by":e}};function M(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",27),t.ɵɵpipe(1,"translate"),t.ɵɵelement(2,"pep-icon",28),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext(2).$implicit,l=t.ɵɵnextContext(3);t.ɵɵpropertyInterpolate("title",t.ɵɵpipeBind1(1,2,"Asc")),t.ɵɵproperty("ngClass",t.ɵɵpureFunction1(4,R,i.ApiName===l.sortBy&&l.isAsc))}}function P(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",27),t.ɵɵpipe(1,"translate"),t.ɵɵelement(2,"pep-icon",29),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext(2).$implicit,l=t.ɵɵnextContext(3);t.ɵɵpropertyInterpolate("title",t.ɵɵpipeBind1(1,2,"Desc")),t.ɵɵproperty("ngClass",t.ɵɵpureFunction1(4,R,i.ApiName===l.sortBy&&!l.isAsc))}}var L=function(e){return{"has-sorting":e}};function N(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",24),t.ɵɵtemplate(1,O,2,0,"mat-icon",0),t.ɵɵtemplate(2,M,3,6,"mat-icon",25),t.ɵɵtemplate(3,P,3,6,"mat-icon",25),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext().$implicit,l=t.ɵɵnextContext(3);t.ɵɵproperty("ngClass",t.ɵɵpureFunction1(4,L,i.ApiName===l.sortBy)),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.ApiName!==l.sortBy),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.ApiName===l.sortBy&&!l.isAsc),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.ApiName===l.sortBy&&l.isAsc)}}var k=function(e){return{width:e}},W=function(e,t,n,i,l){return{"support-sorting":e,"has-sorting":t,"is-resizing":n,"is-first":i,"is-last":l}};function V(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",15),t.ɵɵlistener("click",(function(e){t.ɵɵrestoreView(i);var l=n.$implicit,o=t.ɵɵnextContext(3);return!!o.supportSorting&&o.onListSortingChange(l.ApiName,null!==o.sortBy&&o.sortBy!=l.ApiName||!o.isAsc,e)})),t.ɵɵtemplate(1,w,2,6,"label",16),t.ɵɵtemplate(2,D,2,1,"label",17),t.ɵɵtemplate(3,F,3,0,"div",18),t.ɵɵtemplate(4,N,4,6,"div",19),t.ɵɵelementEnd()}if(2&e){var l=n.$implicit,o=n.index,r=t.ɵɵnextContext(3);t.ɵɵproperty("ngStyle",t.ɵɵpureFunction1(6,k,l.calcTitleColumnWidthString))("ngClass",t.ɵɵpureFunction5(8,W,r.supportSorting,l.ApiName===r.sortBy,l.ApiName===r.pressedColumn,0===o&&r.selectionTypeForActions!==r.SELECTION_TYPE_FOR_ACTIONS.Multi,o===(null==r.uiControl||null==r.uiControl.ControlFields?null:r.uiControl.ControlFields.length)-1)),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",""!=l.Title),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",""==l.Title),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",r.supportResizing),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",r.supportSorting)}}var Y=function(e){return{"below-header-and-top-bar":e}};function H(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",8,9),t.ɵɵlistener("mouseup",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(2).onListResizeEnd(e)}))("mouseenter",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(2).onListHeaderMouseEnter(e)}))("mouseleave",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(2).onListHeaderMouseLeave(e)}))("mousemove",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(2).onListResize(e)})),t.ɵɵelementStart(2,"fieldset",10),t.ɵɵtemplate(3,x,2,6,"mat-checkbox",11),t.ɵɵelementStart(4,"fieldset"),t.ɵɵtemplate(5,V,5,14,"div",12),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementEnd()}if(2&e){var l=t.ɵɵnextContext(2);t.ɵɵproperty("ngClass",t.ɵɵpureFunction1(3,Y,null==l.parentScroll)),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",l.selectionTypeForActions!==l.SELECTION_TYPE_FOR_ACTIONS.None),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",null==l.uiControl?null:l.uiControl.ControlFields)}}function z(e,n){1&e&&t.ɵɵelementContainer(0)}var U=function(e,t){return{"table-body":e,"cards-body":t}};function j(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"virtual-scroll",30),t.ɵɵlistener("load",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(2).onListLoad(e)}))("change",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(2).onListChange(e)})),t.ɵɵtemplate(1,z,1,0,"ng-container",7),t.ɵɵelementEnd()}if(2&e){var l=t.ɵɵnextContext(2),o=t.ɵɵreference(3);t.ɵɵproperty("totalRows",l.totalRows)("isTable",l.isTable)("parentScroll",l.parentScroll?l.parentScroll:l.nativeWindow)("bufferAmount",l.isReport?l.isTable?20:3:l.isTable?15:3)("ngClass",t.ɵɵpureFunction2(6,U,l.isTable,!l.isTable)),t.ɵɵadvance(1),t.ɵɵproperty("ngTemplateOutlet",o)}}function B(e,n){1&e&&t.ɵɵelementContainer(0)}function q(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",31,32),t.ɵɵtemplate(2,B,1,0,"ng-container",7),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext(2),l=t.ɵɵreference(3);t.ɵɵproperty("ngClass",t.ɵɵpureFunction2(2,U,i.isTable,!i.isTable)),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",l)}}function $(e,n){1&e&&t.ɵɵelementContainer(0)}function Q(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,H,6,5,"div",4),t.ɵɵtemplate(2,j,2,9,"virtual-scroll",5),t.ɵɵtemplate(3,q,3,5,"div",6),t.ɵɵtemplate(4,$,1,0,"ng-container",7),t.ɵɵelementContainerEnd()),2&e){var i=t.ɵɵnextContext(),l=t.ɵɵreference(5);t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.isTable),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.useVirtualScroll),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!i.useVirtualScroll),t.ɵɵadvance(1),t.ɵɵproperty("ngTemplateOutlet",l)}}function Z(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-checkbox",39),t.ɵɵlistener("change",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext(2).$implicit;return t.ɵɵnextContext(2).selectItemForActions(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.IsSelectableForActions,null==n||null==n.Data?null:n.Data.Type)})),t.ɵɵelementEnd()}if(2&e){var l=t.ɵɵnextContext(2).$implicit,o=t.ɵɵnextContext(2);t.ɵɵproperty("disabled",o.getIsDisabled(l))("ngStyle",t.ɵɵpureFunction1(3,b,o.isTouchDevice||(null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.hoveredItemId||o.isAllSelected||o.selectedItems.size>0?"visible":"hidden"))("checked",o.getIsSelectedForActions(null==l||null==l.Data?null:l.Data.UID,null==l||null==l.Data?null:l.Data.IsSelectableForActions,null==l||null==l.Data?null:l.Data.Type))}}function X(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-radio-button",40),t.ɵɵlistener("change",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext(2).$implicit;return t.ɵɵnextContext(2).selectItemForActions(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.IsSelectableForActions,null==n||null==n.Data?null:n.Data.Type)})),t.ɵɵelementEnd()}if(2&e){var l=t.ɵɵnextContext(2).$implicit,o=t.ɵɵnextContext(2);t.ɵɵproperty("disabled",o.getIsDisabled(l))("checked",o.getIsSelectedForActions(null==l||null==l.Data?null:l.Data.UID,null==l||null==l.Data?null:l.Data.IsSelectableForActions,null==l||null==l.Data?null:l.Data.Type))}}var K=function(e,t){return{selected:e,highlighted:t}},J=function(e,t){return{height:e,visibility:t}},G=function(e){return{"background-color":e}};function ee(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",34),t.ɵɵlistener("mouseenter",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(2).onTableRowMouseEnter(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.Type)}))("mouseleave",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(2).onTableRowMouseLeave(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.Type)})),t.ɵɵelementStart(2,"fieldset",35),t.ɵɵtemplate(3,Z,1,5,"mat-checkbox",36),t.ɵɵtemplate(4,X,1,2,"mat-radio-button",37),t.ɵɵelementStart(5,"pep-form",38),t.ɵɵlistener("notifyValueChanged",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).onValueChanged(e)}))("notifyFieldClicked",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).onCustomizeFieldClick(e)}))("notifyMenuItemClicked",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).onCustomizeFieldMenuClicked(e)}))("click",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(2).itemClicked(e,n)})),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()}if(2&e){var l=t.ɵɵnextContext().$implicit,o=t.ɵɵnextContext(2);t.ɵɵadvance(1),t.ɵɵproperty("ngClass",t.ɵɵpureFunction2(19,K,o.isItemSelected(null==l||null==l.Data?null:l.Data.UID,null==l||null==l.Data?null:l.Data.Type),(null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.selectedItemId))("ngStyle",t.ɵɵpureFunction2(22,J,o.calculatedObjectHeight,o.showItems||l?"visible":"hidden")),t.ɵɵadvance(1),t.ɵɵproperty("ngStyle",t.ɵɵpureFunction1(25,G,null==l||null==l.Data?null:l.Data.BackgroundColor)),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",o.selectionTypeForActions==o.SELECTION_TYPE_FOR_ACTIONS.Multi||o.selectionTypeForActions==o.SELECTION_TYPE_FOR_ACTIONS.SingleAction),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",o.selectionTypeForActions==o.SELECTION_TYPE_FOR_ACTIONS.Single),t.ɵɵadvance(1),t.ɵɵproperty("checkForChanges",o.checkForChanges)("uiControlHeader",o.uiControl)("firstFieldAsLink",o.firstFieldAsLink)("pepperiObjectInput",l)("canEditObject",!o.disabled&&(null==l?null:l.IsEditable))("objectId",o.objectId)("parentId",o.parentId)("searchCode",o.searchCode)("lockEvents",o.disableSelectionItems)("isReport",o.isReport)("layoutType",o.LAYOUT_TYPE.PepperiTable)("listType",o.listType)("isActive",((null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.selectedItemId||(null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.hoveredItemId)&&!o.isTouchDevice)("pageType",o.pageType)}}function te(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-checkbox",44),t.ɵɵlistener("change",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext(2).$implicit;return t.ɵɵnextContext(2).selectItemForActions(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.IsSelectableForActions,null==n||null==n.Data?null:n.Data.Type)})),t.ɵɵelementEnd()}if(2&e){var l=t.ɵɵnextContext(2).$implicit,o=t.ɵɵnextContext(2);t.ɵɵproperty("disabled",o.getIsDisabled(l))("checked",o.getIsSelectedForActions(null==l||null==l.Data?null:l.Data.UID,null==l||null==l.Data?null:l.Data.IsSelectableForActions,null==l||null==l.Data?null:l.Data.Type))}}var ne,ie,le=function(e,t,n){return{selected:e,highlighted:t,cardView:n}};function oe(e,n){if(1&e){var i=t.ɵɵgetCurrentView();t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",41),t.ɵɵlistener("mouseenter",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(2).onCardMouseEnter(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.Type)}))("mouseleave",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(2).onCardMouseLeave(e,null==n||null==n.Data?null:n.Data.UID,null==n||null==n.Data?null:n.Data.Type)})),t.ɵɵtemplate(2,te,1,2,"mat-checkbox",42),t.ɵɵelementStart(3,"pep-form",43),t.ɵɵlistener("notifyValueChanged",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).onValueChanged(e)}))("notifyFieldClicked",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).onCustomizeFieldClick(e)}))("notifyMenuItemClicked",(function(e){return t.ɵɵrestoreView(i),t.ɵɵnextContext(3).onCustomizeFieldMenuClicked(e)}))("click",(function(e){t.ɵɵrestoreView(i);var n=t.ɵɵnextContext().$implicit;return t.ɵɵnextContext(2).itemClicked(e,n)})),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()}if(2&e){var l=t.ɵɵnextContext().$implicit,o=t.ɵɵnextContext(2);t.ɵɵadvance(1),t.ɵɵclassMap(o.itemClass),t.ɵɵproperty("ngClass",t.ɵɵpureFunction3(19,le,o.isItemSelected(null==l||null==l.Data?null:l.Data.UID,null==l||null==l.Data?null:l.Data.Type),(null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.selectedItemId,o.isCardView))("ngStyle",t.ɵɵpureFunction2(23,J,o.calculatedObjectHeight,o.showItems||l?"visible":"hidden")),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",o.showSelection),t.ɵɵadvance(1),t.ɵɵproperty("firstFieldAsLink",!!o.isCardView&&o.firstFieldAsLink)("checkForChanges",o.checkForChanges)("uiControlHeader",o.uiControl)("pepperiObjectInput",l)("isCardView",o.isCardView)("canEditObject",!o.disabled&&(null==l?null:l.IsEditable))("objectId",o.objectId)("parentId",o.parentId)("searchCode",o.searchCode)("lockEvents",o.disableSelectionItems)("layoutType",o.getThumbnailsLayout())("listType",o.listType)("isActive",((null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.selectedItemId||(null==l||null==l.Data?null:l.Data.UID)+o.SEPARATOR+(null==l||null==l.Data?null:l.Data.Type)===o.hoveredItemId)&&!o.isTouchDevice)("pageType",o.pageType)}}function re(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,ee,6,27,"ng-container",0),t.ɵɵtemplate(2,oe,4,26,"ng-container",0),t.ɵɵelementContainerEnd()),2&e){var i=t.ɵɵnextContext(2);t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.isTable),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!i.isTable)}}function se(e,n){if(1&e&&t.ɵɵtemplate(0,re,3,2,"ng-container",33),2&e){var i=t.ɵɵnextContext();t.ɵɵproperty("ngForOf",i.scrollItems)("ngForTrackBy",i.trackByFunc)}}function ae(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",48),t.ɵɵelementStart(1,"label"),t.ɵɵtext(2),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e){var i=n.$implicit,l=n.index,o=t.ɵɵnextContext(3);t.ɵɵproperty("ngStyle",t.ɵɵpureFunction1(5,k,i.calcTitleColumnWidthString)),t.ɵɵadvance(1),t.ɵɵclassMapInterpolate1("total-label body-sm text-align-",i.Layout.XAlignment,""),t.ɵɵadvance(1),t.ɵɵtextInterpolate1(" ",o.totalsRow[l]," ")}}function ce(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",46),t.ɵɵelementStart(1,"fieldset",10),t.ɵɵtemplate(2,ae,3,7,"div",47),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e){var i=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",null==i.uiControl?null:i.uiControl.ControlFields)}}function ue(e,n){if(1&e&&t.ɵɵtemplate(0,ce,3,1,"div",45),2&e){var i=t.ɵɵnextContext();t.ɵɵproperty("ngIf",(null==i.totalsRow?null:i.totalsRow.length)>0&&i.totalsRow.length<=(null==i.uiControl?null:i.uiControl.ControlFields.length))}}(ne=e.SELECTION_TYPE_FOR_ACTIONS||(e.SELECTION_TYPE_FOR_ACTIONS={}))[ne.None=0]="None",ne[ne.Single=1]="Single",ne[ne.Multi=2]="Multi",ne[ne.SingleAction=3]="SingleAction",(ie=e.VIEW_TYPE||(e.VIEW_TYPE={}))[ie.None=0]="None",ie[ie.Card=1]="Card",ie[ie.Line=2]="Line",ie[ie.Table=3]="Table",ie[ie.Map=4]="Map";var de=function(){},he=function(){function n(n,i,l,o){var r=this;this.element=n,this.layoutService=i,this.cd=l,this.renderer=o,this.currentListTypeTranslation="",this.noDataFoundMsg="Items not found",this.selectionTypeForActions=e.SELECTION_TYPE_FOR_ACTIONS.Multi,this.hideAllSelectionInMulti=!1,this.top=-1,this.listType="",this.objectId="0",this.parentId="0",this.searchCode="0",this.firstFieldAsLink=!1,this.supportSorting=!0,this.supportResizing=!0,this.parentScroll=null,this.disabled=!1,this.isPrinting=!1,this.disableSelectionItems=!1,this.isReport=!1,this.layoutType=null,this.pageType="",this.totalsRow=[],this.isTouchDevice=!1,this.notifyThumbnailClicked=new t.EventEmitter,this.notifyFieldClicked=new t.EventEmitter,this.notifyMenuItemClicked=new t.EventEmitter,this.notifyValueChanged=new t.EventEmitter,this.notifyListChanged=new t.EventEmitter,this.notifySortingChanged=new t.EventEmitter,this.notifySelectedItemsChanged=new t.EventEmitter,this.notifySelectAllSingleActionClicked=new t.EventEmitter,this.notifySingleActionClicked=new t.EventEmitter,this.notifyListLoad=new t.EventEmitter,this.LAYOUT_TYPE=s.LAYOUT_TYPE,this.SELECTION_TYPE_FOR_ACTIONS=e.SELECTION_TYPE_FOR_ACTIONS,this.uiControl=null,this.totalRows=-1,this.isTable=!1,this.hasColumnWidthOfTypePercentage=!0,this.items=null,this.showSelection=!1,this.isCardView=!1,this.itemsCounter=0,this.showItems=!0,this.SEPARATOR=",",this.isAllSelected=!1,this.selectedItems=new Map,this.unSelectedItems=new Map,this.nativeWindow=null,this.selectedItemId="",this.hoveredItemId="",this.lockEvents=!1,this.containerWidth=0,this.pressedColumn="",this.startX=0,this.startWidth=0,this.tableStartWidth=0,this.isAsc=!0,this.sortBy="",this.isUserSelected=!1,this.checkForChanges=null,this.useVirtualScroll=!0,this.layoutService.onResize$.pipe(d.delay(0)).subscribe((function(e){r.screenSize=e})),this.nativeWindow=window}return n.prototype.ngOnInit=function(){this.containerWidth=0},n.prototype.ngOnChanges=function(e){this.containerWidth<=0&&this.setContainerWidth()},n.prototype.ngOnDestroy=function(){this.notifyValueChanged&&this.notifyValueChanged.unsubscribe(),this.notifyListChanged&&this.notifyListChanged.unsubscribe(),this.notifySortingChanged&&this.notifySortingChanged.unsubscribe(),this.notifyFieldClicked&&this.notifyFieldClicked.unsubscribe(),this.notifyMenuItemClicked&&this.notifyMenuItemClicked.unsubscribe(),this.notifyThumbnailClicked&&this.notifyThumbnailClicked.unsubscribe(),this.saveSortingToSession()},n.prototype.setContainerWidth=function(){var t=this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi?44:0,n=window.getComputedStyle(this.element.nativeElement.parentElement),i=parseInt(n.paddingLeft,10)+parseInt(n.paddingRight,10),l=this.element.nativeElement.parentElement.parentElement>0?this.element.nativeElement.parentElement.parentElement:this.element.nativeElement.parentElement,o=i+t+(l.clientHeight<40*(this.totalRows+1)?18:0);this.containerWidth=l.offsetWidth-o},n.prototype.saveSortingToSession=function(){},n.prototype.onMouseDown=function(e){},n.prototype.removeTable=function(){this.cleanItems(),this.uiControl=null},n.prototype.getTopItems=function(){return this.isTable?n.TOP_ITEMS_TABLE:n.TOP_ITEMS_THUMBNAILS},n.prototype.toggleItems=function(e){this.showItems=e,this.lockEvents=!e,this.useVirtualScroll&&(e?h.off():h.on())},n.prototype.updateScrollItems=function(e,t,n){void 0===n&&(n=!0),this.scrollItems=this.items.slice(e,t)},n.prototype.setSelectionItems=function(e,t,n){this.isAllSelected,n?(this.unSelectedItems.delete(e),this.selectedItems.set(e,t)):(this.selectedItems.delete(e),this.unSelectedItems.set(e,t))},n.prototype.getUniqItemId=function(e,t){return void 0===t&&(t=""),e+this.SEPARATOR+t},n.prototype.isItemSelected=function(t,n){void 0===n&&(n="");var i=!1;if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.SingleAction||this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi)i=this.selectedItems.has(t)||this.isAllSelected&&!this.unSelectedItems.has(t);else if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Single){i=this.getUniqItemId(t,n)===this.selectedItemId}return i},n.prototype.setLayout=function(){var e=this;0!==this.totalRows&&this.uiControl&&this.uiControl.ControlFields&&0!==this.uiControl.ControlFields.length&&(this.uiControl.ControlFields.forEach((function(t){0===t.ColumnWidth&&(t.ColumnWidth=10),!e.isTable||t.FieldType!==s.FIELD_TYPE.Image&&t.FieldType!==s.FIELD_TYPE.Signature&&t.FieldType!==s.FIELD_TYPE.NumberIntegerQuantitySelector&&t.FieldType!==s.FIELD_TYPE.NumberRealQuantitySelector&&t.FieldType!==s.FIELD_TYPE.NumberIntegerForMatrix&&t.FieldType!==s.FIELD_TYPE.NumberRealForMatrix&&t.FieldType!==s.FIELD_TYPE.Package&&"UnitsQuantity"!==t.ApiName&&"QuantitySelector"!==t.ApiName||(t.Layout.XAlignment=3)})),this.cd.destroyed||this.cd.detectChanges(),this.containerWidth<=0&&this.setContainerWidth(),this.calcColumnsWidth(),this.checkForChanges=(new Date).getTime())},n.prototype.calcColumnsWidth=function(){var t=this.uiControl.ControlFields.length,n=this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi?44:0;if(this.isTable&&this.uiControl&&this.uiControl.ControlFields&&(this.hasColumnWidthOfTypePercentage=0===this.uiControl.ControlFields.filter((function(e){return 1===e.ColumnWidthType})).length),!this.hasColumnWidthOfTypePercentage){var i=this.uiControl.ControlFields.map((function(e){return 3.78*e.ColumnWidth})).reduce((function(e,t){return e+t}));window.innerWidth>i&&(this.hasColumnWidthOfTypePercentage=!0)}var l=0;if(this.hasColumnWidthOfTypePercentage){for(var o=this.uiControl.ControlFields.map((function(e){return e.ColumnWidth})).reduce((function(e,t){return e+t})),r=0;r<t;r++){var s=100/o*(a=this.uiControl.ControlFields[r]).ColumnWidth;a.calcColumnWidth=Math.floor(this.containerWidth*s/100),r===t-1?a.calcTitleColumnWidthString=a.calcColumnWidthString="calc(100% - "+l+"px)":(a.calcTitleColumnWidthString=a.calcColumnWidthString=a.calcColumnWidth+"px",l+=a.calcColumnWidth)}this.renderer.setStyle(this.element.nativeElement,"width","inherit")}else{for(r=0;r<t;r++){var a=this.uiControl.ControlFields[r],c=Math.floor(3.78*a.ColumnWidth);r===t-1?(a.calcTitleColumnWidthString=c+"px",a.calcColumnWidthString=c-4+"px"):a.calcTitleColumnWidthString=a.calcColumnWidthString=c+"px",l+=c}this.renderer.setStyle(this.element.nativeElement,"width",l+n+"px")}},n.prototype.initResizeData=function(){this.startX=0,this.startWidth=0,this.tableStartWidth=0,this.pressedColumn=""},n.prototype.onListResizeStart=function(e,t){this.pressedColumn=t,this.startX=e.x,this.startWidth=e.target.closest(".header-column").offsetWidth,this.useVirtualScroll?this.tableStartWidth=this.virtualScroll.contentElementRef.nativeElement.offsetWidth:this.tableStartWidth=this.noVirtualScrollCont.nativeElement.offsetWidth},n.prototype.onListResize=function(e){if(this.pressedColumn.length>0){var t=this.layoutService.isRtl()?this.startX-e.x:e.x-this.startX;if(this.startWidth+t>=n.MINIMUM_COLUMN_WIDTH||t>0){for(var i=this.uiControl.ControlFields.length,l=0,o=0;o<i;o++){var r=this.uiControl.ControlFields[o];o===i-1?this.hasColumnWidthOfTypePercentage?r.calcTitleColumnWidthString=r.calcColumnWidthString="calc(100% - "+l+"px)":r.ApiName===this.pressedColumn&&(r.calcColumnWidth=this.startWidth+t,r.calcTitleColumnWidthString=r.calcColumnWidth+"px",r.calcColumnWidthString=r.calcColumnWidth-4+"px"):r.ApiName===this.pressedColumn&&(r.calcColumnWidth=this.startWidth+t,r.calcTitleColumnWidthString=r.calcColumnWidthString=r.calcColumnWidth+"px"),l+=r.calcColumnWidth}this.renderer.setStyle(this.element.nativeElement,"width",this.tableStartWidth+t+"px")}this.checkForChanges=(new Date).getTime()}},n.prototype.onListResizeEnd=function(e){if(this.pressedColumn.length>0)if(e&&p(e.srcElement).parents(".resizeBox").length>0)this.initResizeData();else{var t=this;setTimeout((function(){t.initResizeData()}),0)}},n.prototype.onListSortingChange=function(e,t,n){void 0===n&&(n=null),this.isPrinting||this.pressedColumn.length>0||n&&p(n.srcElement).parents(".resizeBox").length>0||this.sortBy===e&&this.isAsc===t||(this.sortBy=e,this.isAsc=t,this.saveSortingToSession(),this.notifySortingChanged.emit({sortBy:e,isAsc:t}))},n.prototype.onListHeaderMouseEnter=function(e){},n.prototype.onListHeaderMouseLeave=function(e){this.onListResizeEnd(e),this.initResizeData()},n.prototype.onListChange=function(e){if(!this.isPrinting&&void 0!==e.start&&void 0!==e.end&&(this.calculatedObjectHeight=e.calculatedChildHeight+"px",!this.lockEvents)){this.toggleItems(!1),this.updateScrollItems(e.start,e.end,!1);for(var t=!1,n=e.start;!t&&n<e.end;)this.items[n]||(t=!0),n++;if(t){var i=this.getTopItems()-1;e.addAtStart?(e.fromIndex=Math.max(e.start-(i-(e.end-e.start)),0),e.toIndex=e.end):(e.fromIndex=e.start,e.toIndex=Math.min(e.end+(i-(e.end-e.start)),this.totalRows)),this.notifyListChanged.emit(e)}else this.toggleItems(!0)}},n.prototype.onListLoad=function(e){this.notifyListLoad.emit(e)},n.prototype.getParentContainer=function(){return this.parentScroll?this.parentScroll:window},n.prototype.onValueChanged=function(e){this.disabled||this.notifyValueChanged.emit(e)},n.prototype.onCustomizeFieldClick=function(e){this.disabled||this.notifyFieldClicked.emit(e)},n.prototype.onCustomizeFieldMenuClicked=function(e){this.disabled||this.notifyMenuItemClicked.emit(e)},n.prototype.getIsDisabled=function(e){return!!this.disableSelectionItems||(null==e?void 0:e.Data)&&!e.Data.IsSelectableForActions},n.prototype.getIsAllSelectedForActions=function(){var e,t,n=!1;if(this.isAllSelected)0===this.unSelectedItems.size&&(n=!0);else if(this.selectedItems.size===this.totalRows)n=this.getIsAllSelected(this.scrollItems);else if(this.selectedItems.size<this.totalRows)try{for(var i=y(this.scrollItems),l=i.next();!l.done;l=i.next()){var o=l.value;if(!(n=o&&o.Data&&this.selectedItems.has(o.Data.UID.toString())))break}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},n.prototype.setIsAllSelected=function(t){this.selectionTypeForActions!==e.SELECTION_TYPE_FOR_ACTIONS.Multi&&this.selectionTypeForActions!==e.SELECTION_TYPE_FOR_ACTIONS.SingleAction||(this.selectAllCB.checked=t,this.isAllSelected=t)},n.prototype.selectAllItemsForActions=function(t){var n=t.source.checked,i=!1;if((this.isAllSelected?this.unSelectedItems:this.selectedItems).size>0&&(i=!0,this.isAllSelected=!1,this.notifySelectedItemsChanged.emit(0),t.source.checked=!1),this.selectedItems.clear(),this.unSelectedItems.clear(),i)this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.SingleAction&&this.notifySelectAllSingleActionClicked.emit(!1);else if(this.isAllSelected=n,this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.SingleAction)this.notifySelectAllSingleActionClicked.emit(n);else if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi)if(n){var l=this.items.filter((function(e){return e.Data&&e.Data.IsSelectableForActions}));this.notifySelectedItemsChanged.emit(l.length)}else this.notifySelectedItemsChanged.emit(0),this.selectedItemId=""},n.prototype.getIsSelectedForActions=function(t,n,i){if(void 0===i&&(i=""),this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Single)return this.selectedItemId===this.getUniqItemId(t,i);if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.SingleAction){var l=this.isAllSelected||this.selectedItems.has(t);return this.unSelectedItems.has(t)&&(l=!1),l}if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi){if(n){l=this.isAllSelected||this.selectedItems.has(t);return this.unSelectedItems.has(t)&&(l=!1),l}return!1}},n.prototype.selectItemForActions=function(e,t,n,i){void 0===i&&(i="");var l=e.source.checked;this.setItemClicked(t,n,i,l)},n.prototype.itemClicked=function(t,n){var i=n.Data.UID.toString(),l=n.Data.Type.toString(),o=!1;if(n&&n.Data&&n.Data.IsSelectableForActions&&(this.selectedItemId=this.getUniqItemId(i,l),o=!0),this.isTable)this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Single?this.setItemClicked(i,n.Data.IsSelectableForActions,l,o):this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.None&&this.setItemClicked(i,n.Data.IsSelectableForActions,l,!0);else{if(this.disabled)return;this.notifyThumbnailClicked.emit(n)}},n.prototype.setItemClicked=function(t,n,i,l){var o=this.getUniqItemId(t,i);if(l?this.selectedItemId=o:this.selectedItemId===o&&(this.selectedItemId=""),this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Single)this.notifySelectedItemsChanged.emit(0===this.selectedItemId.length?0:1);else if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.SingleAction)this.setSelectionItems(t,o,l),this.notifySingleActionClicked.emit({id:t,selected:l});else if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi&&n){this.setSelectionItems(t,o,l);var r=this.isAllSelected?this.unSelectedItems:this.selectedItems,s=this.isAllSelected?this.totalRows-r.size:r.size;this.notifySelectedItemsChanged.emit(s)}},n.prototype.onTableRowMouseEnter=function(e,t,n){if(!this.isTouchDevice){var i=this.getUniqItemId(t,n);this.hoveredItemId=i}},n.prototype.onTableRowMouseLeave=function(e,t,n){this.hoveredItemId=""},n.prototype.onCardMouseEnter=function(e,t,n){if(!this.isTouchDevice){var i=this.getUniqItemId(t,n);this.hoveredItemId=i}},n.prototype.onCardMouseLeave=function(e,t,n){this.hoveredItemId=""},n.prototype.getThumbnailsLayout=function(){return null==this.layoutType?s.LAYOUT_TYPE.PepperiCard:this.layoutType},n.prototype.winResize=function(e){void 0!==this.virtualScroll&&this.virtualScroll.refresh(),this.containerWidth=0,this.setLayout()},n.prototype.trackByFunc=function(e,t){return t&&t.Data&&t.Data.UID?t.Data.UID:e},n.prototype.cleanItems=function(){this.itemsCounter=0,this.items=this.totalRows>0?Array(this.totalRows):[],this.scrollItems=[],this.calculatedObjectHeight=""},n.prototype.getUIControl=function(){return this.uiControl},n.prototype.initListData=function(t,n,i,l,o,r){void 0===l&&(l=e.VIEW_TYPE.Table),void 0===o&&(o=""),void 0===r&&(r=!1),this.selectedItems.clear(),this.unSelectedItems.clear(),this.isAllSelected=!1;var s=this.isAllSelected?this.unSelectedItems:this.selectedItems,a=this.isAllSelected?this.totalRows-s.size:s.size;this.notifySelectedItemsChanged.emit(a),this.isCardView=l===e.VIEW_TYPE.Card,this.showSelection=r,this.uiControl=t,this.itemClass=o,this.selectedItemId="",this.isTable=l===e.VIEW_TYPE.Table,this.totalRows=n;var c=this.getParentContainer();if(c===window?c.scrollTo(0,0):this.focusOnAnItem(0),this.cleanItems(),this.totalRows===i.length)this.useVirtualScroll=!1,this.updateListItems(i,null),this.onListLoad(null);else{this.useVirtualScroll=!0;var u=this.getNumberOfStartItems();this.updateListItems(i,{start:0,end:u,fromIndex:0,toIndex:u,addAtStart:!0}),void 0!==this.virtualScroll&&this.virtualScroll.refresh()}this.setLayout()},n.prototype.getIsAllSelected=function(e){var t,n,i=!0;if(this.selectedItems.size>0&&e.length>0)try{for(var l=y(e),o=l.next();!o.done;o=l.next()){var r=o.value;if(!(r&&r.Data&&this.selectedItems.has(r.Data.UID.toString()))){i=!1;break}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}else i=!1;return i},n.prototype.getNumberOfStartItems=function(){var e=20;return this.screenSize===s.SCREEN_SIZE.XL||this.screenSize===s.SCREEN_SIZE.LG?e=this.isTable?50:40:this.screenSize===s.SCREEN_SIZE.MD?e=this.isTable?30:20:this.screenSize===s.SCREEN_SIZE.SM?e=this.isTable?20:10:this.screenSize===s.SCREEN_SIZE.XS&&(e=this.isTable?15:5),e},n.prototype.setSelectedIds=function(e,t){var n,i;if(void 0===t&&(t=null),this.selectedItems.clear(),this.isAllSelected=!1,e){try{for(var l=y(e),o=l.next();!o.done;o=l.next()){var r=o.value.split(this.SEPARATOR);if(r&&r.length>0){var s=r[0],a=r.length>1?r[1]:"";this.selectedItems.set(s,this.getUniqItemId(s,a))}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}this.isAllSelected=this.getIsAllSelected(t||this.scrollItems),this.setSelectionDataInSession()}void 0!==this.virtualScroll&&this.virtualScroll.refresh()},n.prototype.setSelectionDataInSession=function(){},n.prototype.updateListItems=function(e,t){if(this.useVirtualScroll){this.itemsCounter+e.length>n.TOP_ITEMS_ARRAY&&this.cleanItems();for(var i=t.fromIndex?t.fromIndex:t.start,l=0;l<e.length;l++)this.items[l+i]||(this.items[l+i]=e[l],this.itemsCounter+=1);this.updateScrollItems(t.start,t.end),this.toggleItems(!0)}else this.scrollItems=this.items=e,this.itemsCounter=e.length},n.prototype.updateListItem=function(e){var t=0;(t=this.items.findIndex((function(t){return t&&t.Data&&t.Data.UID===e.UID})))>=0&&t<this.items.length&&(this.items[t].Data=e),(t=this.scrollItems.findIndex((function(t){return t&&t.Data&&t.Data.UID===e.UID})))>=0&&t<this.scrollItems.length&&(this.scrollItems[t].Data=e,this.checkForChanges=(new Date).getTime())},n.prototype.focusOnAnItem=function(e){void 0!==this.virtualScroll&&this.virtualScroll.scrollInto(e)},n.prototype.getSelectedItemsData=function(t){var n=this;void 0===t&&(t=!1);var i=new de;if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Single){var l=this.selectedItemId.split(this.SEPARATOR);i.selectionType=1,i.rows=[l[0]],i.rowTypes=[l[1]]}else if(this.selectionTypeForActions===e.SELECTION_TYPE_FOR_ACTIONS.Multi){var o=[],r=[],s=1,a=[];t?this.isAllSelected?this.items.forEach((function(e){e&&!n.unSelectedItems.has(e.Data.UID.toString())&&a.push(n.getUniqItemId(e.Data.UID.toString(),e.Data.Type.toString()))})):a=Array.from(this.selectedItems.values()):(a=Array.from(this.isAllSelected?this.unSelectedItems.values():this.selectedItems.values()),s=this.isAllSelected?0:1),a.forEach((function(e){var t=e.split(n.SEPARATOR);2===t.length&&(o.push(t[0]),r.push(t[1]))})),i.selectionType=s,i.rows=o,i.rowTypes=r}return i},n.prototype.initCollectionFromState=function(e,t){var n=this;"Selected"===e?t.forEach((function(e){return n.selectedItems.set(e,e)})):t.forEach((function(e){return n.unSelectedItems.set(e,e)}))},n.prototype.getIsItemEditable=function(e){var t=this.items.filter((function(t){return t.Data.UID.toString()===e}));return t.length>0&&t[0].Data.IsEditable},n.prototype.getItemDataByID=function(e){var t;return null===(t=this.items.find((function(t){return t.Data.UID.toString()===e})))||void 0===t?void 0:t.Data},n}();he.TOP_ITEMS_DEFAULT=100,he.TOP_ITEMS_TABLE=100,he.TOP_ITEMS_THUMBNAILS=100,he.TOP_ITEMS_ARRAY=2500,he.SELECTED_ITEMS_STATE_KEY="SelectedItems",he.UN_SELECTED_ITEMS_STATE_KEY="UnSelectedItems",he.ALL_SELECTED_STATE_KEY="AllSelected",he.SORT_BY_STATE_KEY="SortBy",he.ASCENDING_STATE_KEY="IsAscending",he.MINIMUM_COLUMN_WIDTH=48,he.ɵfac=function(e){return new(e||he)(t.ɵɵdirectiveInject(t.ElementRef),t.ɵɵdirectiveInject(s.LayoutService),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.Renderer2))},he.ɵcmp=t.ɵɵdefineComponent({type:he,selectors:[["pep-list"]],viewQuery:function(e,n){var i;(1&e&&(t.ɵɵviewQuery(I,!0),t.ɵɵviewQuery(T,!0),t.ɵɵviewQuery(v,!0),t.ɵɵviewQuery(E,!0)),2&e)&&(t.ɵɵqueryRefresh(i=t.ɵɵloadQuery())&&(n.virtualScroll=i.first),t.ɵɵqueryRefresh(i=t.ɵɵloadQuery())&&(n.noVirtualScrollCont=i.first),t.ɵɵqueryRefresh(i=t.ɵɵloadQuery())&&(n.tableHeader=i.first),t.ɵɵqueryRefresh(i=t.ɵɵloadQuery())&&(n.selectAllCB=i.first))},hostBindings:function(e,n){1&e&&t.ɵɵlistener("mousedown",(function(e){return n.onMouseDown(e)}),!1,t.ɵɵresolveDocument)("resize",(function(e){return n.winResize(e)}),!1,t.ɵɵresolveWindow)},inputs:{currentListTypeTranslation:"currentListTypeTranslation",noDataFoundMsg:"noDataFoundMsg",selectionTypeForActions:"selectionTypeForActions",hideAllSelectionInMulti:"hideAllSelectionInMulti",top:"top",listType:"listType",objectId:"objectId",parentId:"parentId",searchCode:"searchCode",firstFieldAsLink:"firstFieldAsLink",supportSorting:"supportSorting",supportResizing:"supportResizing",parentScroll:"parentScroll",disabled:"disabled",isPrinting:"isPrinting",disableSelectionItems:"disableSelectionItems",isReport:"isReport",layoutType:"layoutType",pageType:"pageType",totalsRow:"totalsRow",isTouchDevice:"isTouchDevice"},outputs:{notifyThumbnailClicked:"notifyThumbnailClicked",notifyFieldClicked:"notifyFieldClicked",notifyMenuItemClicked:"notifyMenuItemClicked",notifyValueChanged:"notifyValueChanged",notifyListChanged:"notifyListChanged",notifySortingChanged:"notifySortingChanged",notifySelectedItemsChanged:"notifySelectedItemsChanged",notifySelectAllSingleActionClicked:"notifySelectAllSingleActionClicked",notifySingleActionClicked:"notifySingleActionClicked",notifyListLoad:"notifyListLoad"},features:[t.ɵɵNgOnChangesFeature],decls:6,vars:2,consts:[[4,"ngIf"],["listData",""],["listTotals",""],[1,"no-data"],["class","table-header",3,"ngClass","mouseup","mouseenter","mouseleave","mousemove",4,"ngIf"],[3,"totalRows","isTable","parentScroll","bufferAmount","ngClass","load","change",4,"ngIf"],[3,"ngClass",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"table-header",3,"ngClass","mouseup","mouseenter","mouseleave","mousemove"],["tableHeader",""],[1,"table-header-fieldset"],["class","pull-left flip row-selection","type","checkbox",3,"ngStyle","indeterminate","disabled","checked","change",4,"ngIf"],["class","header-column pull-left flip",3,"ngStyle","ngClass","click",4,"ngFor","ngForOf"],["type","checkbox",1,"pull-left","flip","row-selection",3,"ngStyle","indeterminate","disabled","checked","change"],["selectAllCB",""],[1,"header-column","pull-left","flip",3,"ngStyle","ngClass","click"],[3,"id","class","title",4,"ngIf"],["class","header-label body-sm pull-left flip",3,"id",4,"ngIf"],["class","resizeBox pull-right flip",3,"mousedown",4,"ngIf"],["class","sortingBox pull-left flip",3,"ngClass",4,"ngIf"],[3,"id","title"],[1,"header-label","body-sm","pull-left","flip",3,"id"],[1,"resizeBox","pull-right","flip",3,"mousedown"],["name","arrow-up",1,"asc"],[1,"sortingBox","pull-left","flip",3,"ngClass"],[3,"ngClass","title",4,"ngIf"],["name","arrow-either",1,"asc"],[3,"ngClass","title"],["name","arrow-down",1,"asc"],["name","arrow-down",1,"desc"],[3,"totalRows","isTable","parentScroll","bufferAmount","ngClass","load","change"],[3,"ngClass"],["noVirtualScrollCont",""],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"table-row",3,"ngClass","ngStyle","mouseenter","mouseleave"],[1,"table-row-fieldset",3,"ngStyle"],["type","checkbox","class","pull-left flip row-selection",3,"disabled","ngStyle","checked","change",4,"ngIf"],["name","selection","class","pull-left flip row-selection pepperi-radio-button",3,"disabled","checked","change",4,"ngIf"],[3,"checkForChanges","uiControlHeader","firstFieldAsLink","pepperiObjectInput","canEditObject","objectId","parentId","searchCode","lockEvents","isReport","layoutType","listType","isActive","pageType","notifyValueChanged","notifyFieldClicked","notifyMenuItemClicked","click"],["type","checkbox",1,"pull-left","flip","row-selection",3,"disabled","ngStyle","checked","change"],["name","selection",1,"pull-left","flip","row-selection","pepperi-radio-button",3,"disabled","checked","change"],[1,"pull-left","flip",3,"ngClass","ngStyle","mouseenter","mouseleave"],["class","pull-left flip card-selection",3,"disabled","checked","change",4,"ngIf"],[3,"firstFieldAsLink","checkForChanges","uiControlHeader","pepperiObjectInput","isCardView","canEditObject","objectId","parentId","searchCode","lockEvents","layoutType