@esfaenza/es-table 11.2.73 → 11.2.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@esfaenza/localizations"),require("@esfaenza/extensions"),require("@angular/forms"),require("@esfaenza/preferences"),require("@angular/cdk/drag-drop"),require("rxjs"),require("@angular/common"),require("@angular/router"),require("@angular/material/select"),require("@angular/material/input"),require("@esfaenza/forms-and-validations"),require("@angular/platform-browser"),require("ngx-bootstrap/modal"),require("ngx-bootstrap/dropdown"),require("@ctrl/ngx-csv"),require("@esfaenza/ngx-contextmenu")):"function"==typeof define&&define.amd?define("@esfaenza/es-table",["exports","@angular/core","@esfaenza/localizations","@esfaenza/extensions","@angular/forms","@esfaenza/preferences","@angular/cdk/drag-drop","rxjs","@angular/common","@angular/router","@angular/material/select","@angular/material/input","@esfaenza/forms-and-validations","@angular/platform-browser","ngx-bootstrap/modal","ngx-bootstrap/dropdown","@ctrl/ngx-csv","@esfaenza/ngx-contextmenu"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).esfaenza=e.esfaenza||{},e.esfaenza["es-table"]={}),e.ng.core,e.localizations,e.i1,e.ng.forms,e.preferences,e.ng.cdk.dragDrop,e.rxjs,e.ng.common,e.ng.router,e.ng.material.select,e.ng.material.input,e.formsAndValidations,e.ng.platformBrowser,e.modal,e.dropdown,e.ngxCsv,e.ngxContextmenu)}(this,(function(e,t,i,n,r,s,o,a,l,c,h,p,u,d,g,m,f,v){"use strict";var y=function(e,t){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function C(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}function b(e,t){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}Object.create;function x(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function P(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e}Object.create;var I=new t.InjectionToken("EST_LOCALE"),_=new t.InjectionToken("EST_DEBUG"),O=new t.InjectionToken("EST_DEFAULTS"),T=function(e){function t(t){var i=e.call(this,null!=t?t:"it-IT")||this;return e.prototype.set.call(i,"en->it","All",["Tutto"]),e.prototype.set.call(i,"en->it","Shown Elements",["Elementi visualizzati"]),e.prototype.set.call(i,"en->it","Shown Groups",["Gruppi visualizzati"]),e.prototype.set.call(i,"en->it","Are you sure you want to retrieve all results?",["Si è sicuri di voler caricare tutti i risultati?"]),e.prototype.set.call(i,"en->it","This might slow down the page and possibly crash the entire application",["L'operazione potrebbe rallentare la pagina fino al crash dell'applicazione"]),i}return w(t,e),t}(i.LocalizationService);T.decorators=[{type:t.Injectable}],T.ctorParameters=function(){return[{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]};var M=function(){function e(e,i,n,r){this.msgExts=e,this.lc=i,this.cdr=n,this.locale=r,this.WarnOnAll=!0,this.AllSearch=!0,this.DefaultAll=999999,this.GroupMode=!1,this.GroupCount=!1,this.CountLabel=null,this.ShowCount=!0,this.ShowPaging=!0,this.pagingSelected=new t.EventEmitter,this.PagingOptions=[10,15,30,45,100]}return e.prototype.ngOnInit=function(){this.Model=this.View?this.View.itemsperpageoverride||15:this.CurrentPageSize,this.AllSearch&&this.PagingOptions.push(this.DefaultAll)},e.prototype.ngOnChanges=function(e){var t=e.View,i=e.CurrentPageSize;(t&&!t.firstChange||i&&!i.firstChange)&&(this.Model=(null==t?void 0:t.currentValue)?t.currentValue.itemsperpageoverride||15:(null==i?void 0:i.currentValue)?i.currentValue:null)},e.prototype.choice=function(e){var t=this;e==this.DefaultAll&&this.WarnOnAll?this.msgExts.simpleWarningWithChoice(this.lc.loc("Are you sure you want to retrieve all results?"),this.lc.loc("This might slow down the page and possibly crash the entire application"),(function(){t.pagingSelected.emit(e),t.Model=e}),(function(){var e=t.Model;t.Model=null,t.cdr.detectChanges(),t.Model=e,t.cdr.detectChanges()})):(this.pagingSelected.emit(e),this.Model=e)},e}();M.decorators=[{type:t.Component,args:[{selector:"app-paging",viewProviders:[{provide:i.LocalizationService,useClass:T}],template:'<ng-container *ngIf="!Hidden">\r\n <span class="est-fs-14"> {{CountLabel && !GroupMode ? CountLabel : ((GroupMode ? \'Shown Groups\' : \'Shown Elements\') | localize : lc)}}:&nbsp;</span>\r\n <ng-container *ngIf="ShowPaging && Model && (Model == DefaultAll || PagerCount >= Model || PagerCount == -1)">\r\n <mat-form-field [appearance]="\'legacy\'" class="mat-paginator-page-size-select est-fs-14 est-ipp-bold">\r\n <select matNativeControl [ngModel]="Model" name="input" (ngModelChange)="choice($event)">\r\n <ng-container *ngFor="let pOpt of PagingOptions; let i = index">\r\n <option *ngIf="pOpt == DefaultAll || PagerCount >= pOpt || PagerCount == -1 || (i > 0 && PagerCount >= PagingOptions[i-1])" [value]="pOpt">{{ pOpt == DefaultAll ? (\'All\' | localize : lc) : pOpt.toString()}}</option>\r\n </ng-container>\r\n </select>\r\n </mat-form-field>\r\n <span class="est-fs-14 est-ipp-bold" *ngIf="ShowCount && PagerCount != -1">&nbsp;/&nbsp;</span>\r\n </ng-container>\r\n <span class="est-fs-14 est-ipp-bold" *ngIf="ShowCount && PagerCount != -1">{{PagerCount | number : \'0.0-0\' : locale}}</span>\r\n</ng-container>',encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[".est-ipp-sel,.est-ipp-sel-all,.est-rg-ipp-sel,.est-rg-ipp-sel-all{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-ipp-bold{font-weight:700}.mat-paginator-page-size-select{margin:6px 4px 0;width:50px}.mat-paginator-page-size-select .mat-form-field-wrapper{height:52px!important;margin-top:-15px!important;padding:0!important}.mat-form-field-type-mat-native-select .mat-form-field-infix:after{margin-top:-5.5px!important}"]}]}],M.ctorParameters=function(){return[{type:n.MessageService},{type:i.LocalizationService},{type:t.ChangeDetectorRef},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]},M.propDecorators={CurrentPageSize:[{type:t.Input}],View:[{type:t.Input}],WarnOnAll:[{type:t.Input}],AllSearch:[{type:t.Input}],DefaultAll:[{type:t.Input}],GroupMode:[{type:t.Input}],GroupCount:[{type:t.Input}],CountLabel:[{type:t.Input}],ShowCount:[{type:t.Input}],ShowPaging:[{type:t.Input}],PagerCount:[{type:t.Input}],Hidden:[{type:t.Input}],pagingSelected:[{type:t.Output}]};var H=function(){function e(){this.itemsperpageoverride=15,this.items=[],this.orders=[],this.columns=[],this.column_ordering=[],this.savedstate=!1,this.searchinprogress=!1,this.firstsearch=!0}return e.reset=function(e){e.pages=1,e.objectcount=0,e.searchinprogress=!1,e.firstsearch=!1,e.page=1,e.itemsperpageoverride=15,e.items=[],e.orders=[],e.columns=[],e.column_ordering=[],e.savedstate=!1},e}(),E=function(e){this.all=!1,this.exclusions=[],this.group_exclusions=[],this.count=e.length,this.items=e,this.all=!1,this.exclusions=[],this.groups=[],this.group_exclusions=[]},D=function(e,t){this.column=e,this.value=t},V=function(e,t,i,n,r){this.item=e,this.header=t,this.property=i,this.old_value=n,this.new_value=r},R=function(){},k=function(e){this.Template=e,this._directive=!0,this._multi=!1,this.tdVisible=!0,this.tdIf=!0};k.decorators=[{type:t.Directive,args:[{selector:"[td]"}]}],k.ctorParameters=function(){return[{type:t.TemplateRef}]},k.propDecorators={tdVisible:[{type:t.Input}],td:[{type:t.Input}],tdForProperty:[{type:t.Input}],tdIf:[{type:t.Input}],tdClass:[{type:t.Input}],tdPropertyAccessor:[{type:t.Input}]};var G=function(e){this.Template=e,this._thAggregations=null,this._thParents=null,this._directive=!0,this._referenced=!1,this._multi=!1,this._multi_content="",this.th="",this.thPinned=!1,this.thPinnable=!0,this.thPinnedWidth=150,this.thVisible=!0,this.thFixed=!1,this.thParent="",this.thOrderable=!0,this.thWrap=!1,this.thResizable=!1,this.thIf=!0,this.thEmpty=!1,this.thGroup=!1,this.thAggregation=null,this.thProperty=null,this.thType=null,this.thSource=null};G.decorators=[{type:t.Directive,args:[{selector:"[th]"}]}],G.ctorParameters=function(){return[{type:t.TemplateRef}]},G.propDecorators={th:[{type:t.Input}],thPinned:[{type:t.Input}],thPinnable:[{type:t.Input}],thPinnedWidth:[{type:t.Input}],thVisible:[{type:t.Input}],thFixed:[{type:t.Input}],thParent:[{type:t.Input}],thOrder:[{type:t.Input}],thOrderable:[{type:t.Input}],thWrap:[{type:t.Input}],thResizable:[{type:t.Input}],thClass:[{type:t.Input}],thGroupClass:[{type:t.Input}],thIf:[{type:t.Input}],thEmpty:[{type:t.Input}],thGroup:[{type:t.Input}],thAggregation:[{type:t.Input}],thProperty:[{type:t.Input}],thType:[{type:t.Input}],thSource:[{type:t.Input}],thMulti:[{type:t.Input}],thStaticContent:[{type:t.Input}],thBackgroundColor:[{type:t.Input}]};var z=function(e){this.Template=e};z.decorators=[{type:t.Directive,args:[{selector:"[editor]"}]}],z.ctorParameters=function(){return[{type:t.TemplateRef}]},z.propDecorators={editor:[{type:t.Input}],editorForProperty:[{type:t.Input}]};var A=function(e){function t(t){var i=e.call(this,null!=t?t:"it-IT")||this;return e.prototype.set.call(i,"en->it","All the",["Tutti gli"]),e.prototype.set.call(i,"en->it","All",["Tutto"]),e.prototype.set.call(i,"en->it","Groups",["Gruppi"]),e.prototype.set.call(i,"en->it","Cannot export an empty dataset",["Impossibile esportare un dataset vuoto"]),e.prototype.set.call(i,"en->it","Performing Table bootstrap",["Sto caricando la Tabella"]),e.prototype.set.call(i,"en->it","Update every",["Aggiorna ogni"]),e.prototype.set.call(i,"en->it","second/s",["secondo/i"]),e.prototype.set.call(i,"en->it","Export View",["Esporta Vista"]),e.prototype.set.call(i,"en->it","Column Name",["Nome Colonna"]),e.prototype.set.call(i,"en->it","Columns Order",["Ordine Colonne"]),e.prototype.set.call(i,"en->it","Columns Visibility",["Visibilità Colonne"]),e.prototype.set.call(i,"en->it","There are no columns configured to be hidden/shown in this view",["Non ci sono colonne configurate per essere visualizzate/nascoste in questa vista dati"]),e.prototype.set.call(i,"en->it","Columns Visibility and Order",["Visibilità e Ordine Colonne"]),e.prototype.set.call(i,"en->it","Objects Selected",["Oggetti Selezionati"]),e.prototype.set.call(i,"en->it","Object Selected",["Oggetto Selezionato"]),e.prototype.set.call(i,"en->it","Select Everything",["Seleziona Tutto"]),e.prototype.set.call(i,"en->it","Reset Selection",["Resetta Selezione"]),e.prototype.set.call(i,"en->it","No operations available",["Nessuna operazione disponibile"]),e.prototype.set.call(i,"en->it","Values copied in the clipboard",["Valori copiati nella clipboard"]),e.prototype.set.call(i,"en->it","Size of copied data is different from the size of the selection",["La dimensione dei dati copiati differisce dalla dimensione della selezione"]),e.prototype.set.call(i,"en->it","Data for this table cannot be edited",["I dati di questa tabella non possono essere modificati"]),i}return w(t,e),t}(i.LocalizationService);A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]};var L=function(){function e(e,t,i,n,r){this.est=e,this.expExts=t,this.msgExts=i,this.utiExts=n,this.dateExts=r}return e.prototype.tryExport=function(e){var t=this;this.est.ExportFunction&&this.est.ExportFunction((function(i,n){return void 0===n&&(n=!1),C(t,void 0,void 0,(function(){var t,r=this;return b(this,(function(s){switch(s.label){case 0:return n?[2]:0==i.length?(this.msgExts.simpleWarning(this.est.lc.loc("Cannot export an empty dataset")),[2]):(this.setupExport(i),"CSV"!=e?[3,1]:(this.est.cdr.detectChanges(),setTimeout((function(){r.est.exportDownloader.nativeElement.click()})),[3,7]));case 1:if("XLSX"!=e)return[3,6];if(null!=this.ExcelJS)return this.exportExcel(),[2];s.label=2;case 2:return s.trys.push([2,4,,5]),t=this,[4,import("exceljs")];case 3:return t.ExcelJS=s.sent(),this.exportExcel(),[3,5];case 4:throw s.sent(),"Impossibile caricare la libreria per l'esportazione in Excel";case 5:return[3,7];case 6:throw"Formato di esportazione non riconosciuto";case 7:return[2]}}))}))}),e)},e.prototype.exportExcel=function(){return C(this,void 0,void 0,(function(){var e,t,i,n,r,s,o,a,l,c,h,p,u,d;return b(this,(function(g){switch(g.label){case 0:for(1,(e=new this.ExcelJS.Workbook).creator="Ema's big Es-Table",e.created=new Date,t=e.addWorksheet("Data"),(i=t.getRow(1)).font={bold:!0},this.est.headers=this.est.headers.sort((function(e,t){return e.order-t.order})),n=0;n<this.est.headers.length;n++)a=this.est.headers[n],i.getCell(n+1).value=a.label;for(n=0;n<this.est.data.length;n++)for(r=t.getRow(n+1+1),s=this.est.data[n],o=0;o<this.est.headers.length;o++)if(a=this.est.headers[o],l=r.getCell(o+1),null==(c=s[a.key])||null==c)l.value="";else switch(a.type){case"date":l.value=this.dateExts.getDateConvertion(c).toDate();case"number":l.value=parseFloat(c.replace(",","."));default:l.value=c}return[4,e.xlsx.writeBuffer()];case 1:return h=g.sent(),p=new Blob([h],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"}),u=window.URL.createObjectURL(p),d=this.est.ExportFileName,this.utiExts.fileDownload(u,d.endsWith(".csv")?d.replace(".csv",".xlsx"):d.endsWith(".xlsx")?d:d+".xlsx"),[2]}}))}))},e.prototype.setupExport=function(e){var t=this.est.DynamicRowColumnsDefinition;this.est.headers=t&&t.length>0?this.expExts.setupForGenericExport(e,t.map((function(e){return{label:e.Description,key:e.PropertyName,order:e.ColumnOrder,type:"string"}}))):this.expExts.setupForExport(e),this.est.data=e},e}(),B=function(e,t){this.id=e,this.order=t},F=function(e,t,i,n,r,s,o,a,l,c,h){this.id=e,this.description=t,this.visible=i,this.fixed=n,this.pinned=r,this.pinnable=s,this.pinnedWidth=o,this.template=a,this.parentTemplates=l,this.multi=c,this.multiContent=h},N=function(){function e(e,t,i,n,r){this.est=e,this.utilities=t,this.utiExts=i,this.prefService=n,this.rgH=r}return e.prototype.handleTHOrderChange=function(e,t){var i=this.est.viewMode?this.est.View.orders:this.est.arrayOrders,n=!0,r=null;!i&&this.est.viewMode?this.est.View.orders=[]:!i&&this.est.arrayMode&&(this.est.arrayOrders=[]);for(var s=0;s<i.length;s++){var o=i[s];o.id==e&&(t?(o.order=t,n=!1):r=s)}null!=r?i.splice(r,1):n&&(this.est.MultipleOrderingDirectives?i.push(new B(e,t)):this.est.viewMode?this.est.View.orders=[new B(e,t)]:this.est.arrayMode&&(this.est.arrayOrders=[new B(e,t)])),this.est.onOrderChanged.emit({id:e,order:t}),this.est.viewMode?this.est.groupSearchRequestsCache.length>0?this.rgH.emitRowGroupingSearches(e,i):this.est.emitSearchRequest(!1):this.est.arrayMode&&this.est.internalWriteValue()},e.prototype.reviewColumnsList=function(e){var t=this;if(this.est.TMPColumnsList=[],0!=e.length){for(var i=function(t){var i=e[t],r=i.th;if(!r)return"continue";if((n.est.HiddenColumns||i.thVisible)&&i.thIf){var s=n.est.ColumnsList&&0!=n.est.ColumnsList.length&&n.est.ColumnsList.find((function(e){return e.id==r}))||null,o=new F(r,i.thStaticContent,i.thVisible,i.thFixed||i.thGroup,null==s?i.thPinned:s.pinned,i.thPinnable,i.thPinnedWidth,i.Template,i._thParents,i._multi,i._multi_content);s&&(o.prev_index=s.prev_index),n.est.TMPColumnsList.push(o)}},n=this,r=0;r<e.length;r++)i(r);this.est.ColumnsList=[],this.est.TMPColumnsList.forEach((function(e){t.est.ColumnsList.push(Object.assign({},e))}))}},e.prototype.expandMultiThsAndTds=function(e,t,i){for(var n={},r=0;r<e.length;r++){(_=e[r]).thMulti&&(n[_.th]={On:_.th,tdref:null,thref:_,thgen:{},tdgen:{}})}for(r=0;r<t.length;r++){(O=t[r])._multi=!!n[O.td],O._multi&&(n[O.td].tdref=O)}e=e.filter((function(e){return!e.thMulti})),t=t.filter((function(e){return!e._multi}));var s={},o={},a={},l=[];for(r=0;r<i.length;r++){var c=i[r];for(var h in n)if(c[h]&&c[h].length)for(var p=n[h],u=p.tdref,d=p.thref,g=0;g<c[h].length;g++){var m=c[h][g];m._headersHierarchy||(m._headersHierarchy=m.header_group?m.header_group.split(">").map((function(e){return e.trim()})):[]);var f=m.header,v=m.header_group||null,y=m._headersHierarchy;if(!o[v+"_"+f]){o[v+"_"+f]=!0;var w=new G(d.Template);w._multi=!0,w._multi_content=f,w.th=h+"_"+g,w.thClass=d.thClass,w.thIf=d.thIf,w.thVisible=d.thVisible,w.thWrap=d.thWrap,w.thParent=y[y.length-1],w.thOrderable=!1;for(var C=0;C<y.length;C++){var b=y[C];if(!s[b]){s[b]=!0;var x=new G(null);x.th=b,x._multi_content=b,x.thParent=C>0?y[C-1]:null,l.push(x)}}l.push(w);var S=new k(u.Template);S._multi=!0,S.td=h+"_"+g,S.tdClass=u.tdClass,S.tdIf=u.tdIf,S.tdVisible=u.tdVisible,a[S.td]=S}}}var I=[];for(r=0;r<l.length;r++)l[r].thParent||I.push(l[r]);for(var h in s)for(r=0;r<l.length;r++){var _;(_=l[r]).thParent&&_.thParent==h&&I.push(_)}e=P(e,l);for(r=0;r<l.length;r++){var O;(O=a[l[r].th])&&t.push(O)}return{expTds:t,expThs:e}},e.prototype.moveFixedColumnsAtTheBeginning=function(e,t){for(var i={},n=0,r=0,s={},o={},a=0;a<this.est.ColumnsList.length;a++){var l=this.est.ColumnsList[a];s[l.id]=l,l.pinned&&(a!=r&&this.utilities.arrayMove(this.est.ColumnsList,a,r),r++),l.fixed&&!l.pinned&&(a!=r+n&&this.utilities.arrayMove(e,a,r+n),n++)}r=n=0;for(var c=0;c<e.length;c++){var h=e[c];i[h.th]=h,h.thPinned=!s[h.th]&&h.thPinned||s[h.th]&&s[h.th].pinned,h.thPinned&&(c!=r&&this.utilities.arrayMove(e,c,r),r++),!h.thFixed&&!h.thGroup||h.thPinned||(c!=r+n&&this.utilities.arrayMove(e,c,r+n),n++)}for(c=0;c<e.length;c++)o[e[c].th]=c;var p=new Array(e.length);for(c=0;c<t.length;c++){var u=t[c];p[o[u.td]]=u}this.est.HasPinnedColumns=r>0},e.prototype.evaluatePinnedColumnsWidth=function(){if(this.est.HasPinnedColumns){this.est.PinnedContainerWidth=0;for(var e=0;e<this.est.ColumnsList.length;e++){var t=this.est.ColumnsList[e];t.pinned&&t.visible&&(this.est.PinnedContainerWidth+=t.pinnedWidth)}this.est.PinnedContainerWidth+=this.est.Selection?25:0}},e.prototype.alignColumnsIfLoadedView=function(e){var t=this,i=this.est.viewMode&&e.savedstate,n=[];if(this.est.ColumnsList&&0!=this.est.ColumnsList.length){var r=this.est.viewMode?e.columns:this.est.arrayColumns;if(this.est.ColumnsList.forEach((function(e){var t=r.filter((function(t){return(t.startsWith("§")?t.substring(1):t)==e.id}));1==t.length&&(e.pinned=t[0].startsWith("§")),e.visible&&0==r.length?n.push(e.id):1!=t.length||e.visible?0==t.length&&e.visible&&(e.visible=!1):e.visible=!0})),0==r.length&&(this.est.viewMode?e.columns=n:this.est.arrayColumns=n),this.est.viewMode&&e.savedstate&&this.est.ColumnsOrdering&&e.column_ordering.length>0){var s=[];e.column_ordering.forEach((function(e){t.est.ColumnsList.forEach((function(t){t.id==e&&s.push(t)}))})),this.est.ColumnsList.forEach((function(e){s.find((function(t){return t==e.id}))||s.push(e)})),this.est.ColumnsList=s}this.est.viewMode&&(e.savedstate=!1),i&&this.est.changed()}},e.prototype.refreshColumnsVisibility=function(e,t,i){for(var n=[],r={},s={},o=0;o<this.est.ColumnsList.length;o++){var a=this.est.ColumnsList[o];s[a.id]=a,a.visible&&n.push((a.pinned?"§":"")+a.id)}if(i?i.columns=n:this.est.arrayColumns=n,e)for(var l=0;l<e.length;l++){var c=e[l];c.thVisible=c.thFixed||(s[c.th]?s[c.th].visible:c.thVisible),(c.thFixed||c.thGroup)&&(r[c.th]=!0)}if(t)for(l=0;l<t.length;l++){var h=t[l];h.tdVisible=r[h.td]||(s[h.td]?s[h.td].visible:h.tdVisible)}this.est.changed()},e.prototype.alignHeadersOrdering=function(e,t){for(var i=t?t.orders:this.est.arrayOrders,n=0;n<e.length;n++){var r=e[n];r.thOrder=null;for(var s=0;s<i.length;s++){var o=i[s];o.id==r.th&&(r.thOrder=o.order)}}},e.prototype.evaluateHeadersGroupingInfos=function(e){for(var t={},i={},n=0;n<e.length;n++){i[(o=e[n]).th]=o,o.thParent&&!t[o.thParent]&&(t[o.thParent]=!0)}var r=0,s=[];for(n=0;n<e.length;n++){var o;if(!t[(o=e[n]).th]){s.push(o);var a=this.jumpsToFinalParent(o,i);r=a>r?a:r}}return{leafs:s,groupingLevel:r,parentsCache:t,thsCache:i}},e.prototype.evaluateHeaderGroups=function(e){if(0!=e.groupingLevel){for(var t=[],i=e.leafs.filter((function(e){return e.thVisible&&!e.thPinned})),n=0;n<e.groupingLevel;n++){t.push([]);for(var r=0;r<i.length;r++)t[n].push("")}var s=[];for(r=0;r<this.est.OrderDirectives.length;r++){var o=e.thsCache[this.est.OrderDirectives[r]];o.thVisible&&!o.thPinned&&s.push(o)}var a="";for(r=0;r<s.length;r++){var l=s[r],c=r-1>=0?s[r-1]:null;l._lbord=l.thParent!=a,l._rbord=i.length==r+1,c&&(c._rbord=l.thParent!=a),a=l.thParent;for(n=0;n<e.groupingLevel;n++){var h=l.thParent;h&&!l.thPinned&&(t[n][r]=h,l=e.thsCache[h])}}a="";var p=0;this.est.TMPRowThGroups=[];for(n=0;n<t.length;n++){var u=[];this.est.TMPRowThGroups.push(u),(this.est.Selection||this.est.HasPinnedColumns)&&u.push({Span:1,Template:null,Pinned:this.est.HasPinnedColumns});for(var d=0;d<t[n].length;d++){var g=t[n][d];g==a?p++:(p>0&&u.push({Span:p,Template:a?e.thsCache[a].Template:null,Content:a?e.thsCache[a]._multi_content:null,Borders:!!a}),p=1,a=g)}u.push({Span:p,Template:a?e.thsCache[a].Template:null,Content:a?e.thsCache[a]._multi_content:null,Borders:!!a}),this.est.Removal&&u.push({Span:1,Template:null}),(this.est.Export||this.est.HiddenColumns||this.est.ColumnsOrdering||this.est.CornerMenuOptions)&&u.push({Span:1,Template:null}),p=0,a=""}}},e.prototype.jumpsToFinalParent=function(e,t){var i=0,n=null,r=[],s=e;do{(n=e.thParent)&&((e=t[n]).thEmpty||e._multi_content?!e.thEmpty&&e._multi_content&&r.unshift({content:e._multi_content}):r.unshift({tmpl:e.Template}),i++)}while(n);return s._thParents=r,i},e.prototype.generateDefaultOrder=function(e,t){if(0!=e.length){var i=this.est.viewMode?t.column_ordering:this.est.arrayColumnOrdering;if(i&&0!=i.length){this.est.OrderDirectives=i;var n=function(t){var i=e[t].th;r.est.OrderDirectives.find((function(e){return e==i}))||r.est.OrderDirectives.push(i)},r=this;for(s=0;s<e.length;s++)n(s)}else for(var s=0;s<e.length;s++){var o=e[s].th;this.est.OrderDirectives.push(o)}}},e.prototype.applyOrdering=function(e,t){var i=this,n=[];if(t){this.est.OrderDirectives.forEach((function(e){var t=i.est.TMPRowTHs.filter((function(t){return t.ID==e}))[0];t&&n.push(t)})),this.est.TMPRowTHs=n;for(var r=function(e){var t=s.est.TMPRowTDs[s.est.RowContexts[e]],i=[];s.est.OrderDirectives.forEach((function(e){var n=t.filter((function(t){return t.ID==e}))[0];i.push(n)})),s.est.TMPRowTDs[s.est.RowContexts[e]]=i},s=this,o=0;o<this.est.RowContexts.length;o++)r(o)}this.est.viewMode?e.column_ordering=this.est.OrderDirectives:this.est.arrayColumnOrdering=this.est.OrderDirectives,this.est.changed()},e.prototype.sendUp=function(e){var t=this.est.TMPColumnsList.indexOf(e);if(!this.est.TMPColumnsList[t-1].fixed&&!this.est.TMPColumnsList[t-1].pinned){this.utiExts.swap(this.est.TMPColumnsList,t,t-1);var i=[];this.est.TMPColumnsList.forEach((function(e){i.push(Object.assign({},e))})),this.est.TMPColumnsList=i}},e.prototype.sendDown=function(e){var t=this.est.TMPColumnsList.indexOf(e);this.utiExts.swap(this.est.TMPColumnsList,t,t+1);var i=[];this.est.TMPColumnsList.forEach((function(e){i.push(Object.assign({},e))})),this.est.TMPColumnsList=i},e.prototype.pinOrUnpinColumn=function(e){var t=this.est.TMPColumnsList.indexOf(e);if(e.pinned){if(null!=e.prev_index&&null!=e.prev_index)this.utilities.arrayMove(this.est.TMPColumnsList,t,e.prev_index);else for(i=0;i<this.est.TMPColumnsList.length;i++)if(!this.est.TMPColumnsList[i].pinned&&!this.est.TMPColumnsList[i].fixed){this.utilities.arrayMove(this.est.TMPColumnsList,t,i-1);break}}else{e.prev_index=t;for(var i=0;i<this.est.TMPColumnsList.length;i++)if(!this.est.TMPColumnsList[i].pinned){this.utilities.arrayMove(this.est.TMPColumnsList,t,i);break}}e.pinned=!e.pinned},e.prototype.columnClicked=function(e){this.est.lastSelectedItemID=e.id,this.est.HiddenColumns&&!e.fixed&&(e.visible=!e.visible,this.updateGlobalColVisCheck())},e.prototype.resetColumnVisSelection=function(){var e=this;this.est.TMPColumnsList=[],this.est.TMPColumnsList=[],this.est.ColumnsList.forEach((function(t){e.est.TMPColumnsList.push(Object.assign({},t))}));var t=[];this.est.ColumnsOrdering&&(this.est.OrderDirectives.forEach((function(i){var n=e.est.TMPColumnsList.filter((function(e){return e.id==i}))[0];n&&t.push(n)})),this.est.TMPColumnsList=t),this.updateGlobalColVisCheck()},e.prototype.refreshColumnOrdering=function(){this.est.OrderDirectives=[];for(var e=0;e<this.est.ColumnsList.length;e++)this.est.OrderDirectives.push(this.est.ColumnsList[e].id)},e.prototype.updateGlobalColVisCheck=function(){this.est.globalColVisCheck=this.est.TMPColumnsList.every((function(e){return e.visible}))},e.prototype.columnReordered=function(e){o.moveItemInArray(e.container.data,e.previousIndex,e.currentIndex)},e.prototype.sortPredicate=function(e,t){var i=this.est.ColumnsList[e];return!(i.fixed||i.pinned||t.data.pinned||t.data.pinned)},e.prototype.confirmColumnVisibilitySelection=function(){var e=this;if(this.est.TMPColumnsList.every((function(e){return!e.visible})))return!1;var t=this.est.viewMode?this.est.MainGroupView||this.est.View:null;if(this.est.ColumnsList=[],this.est.TMPColumnsList.forEach((function(t){e.est.ColumnsList.push(Object.assign({},t))})),this.refreshColumnOrdering(),this.applyOrdering(t,!1),this.refreshColumnsVisibility(null,null,t),this.est.SavePreferences){if(!this.est.ngControl.name)return console.error("Non posso utilizzare le preference senza avere un 'name' per la tabella"),!1;if(!this.prefService)return console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato"),!1;var i=this.est.arrayMode?this.est.arrayColumns:t.columns,n=this.est.arrayMode?this.est.arrayColumnOrdering:t.column_ordering,r={columns:JSON.parse(JSON.stringify(i)),column_ordering:JSON.parse(JSON.stringify(n))};this.prefService.setItem(this.est.ngControl.name,r,"preference").subscribe()}return this.est.viewMode?setTimeout((function(){if(e.est.MainGroupView)for(var t=0;t<e.est.groupSearchRequestsCache.length;t++){var i=e.est.groupSearchRequestsCache[t].view;i.columns=e.est.MainGroupView.columns,i.column_ordering=e.est.MainGroupView.column_ordering,e.est.emitSearchRequest(!0,e.est.groupSearchRequestsCache[t].view)}else e.est.emitSearchRequest(!0)})):this.est.arrayMode&&setTimeout((function(){e.est.internalWriteValue()})),this.est.lastSelectedItemID=null,!0},e.prototype.unpinColumn=function(e){this.resetColumnVisSelection(),this.pinOrUnpinColumn(this.est.TMPColumnsList.find((function(t){return t.id==e}))),this.confirmColumnVisibilitySelection()},e.prototype.globalColVisCheckChanged=function(){var e=this;this.est.TMPColumnsList.forEach((function(t){t.fixed||(t.visible=e.est.globalColVisCheck)}))},e}(),U=function(e,t,i,n,r,s,o,a,l,c,h,p,u,d){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=!0),void 0===a&&(a=null),void 0===l&&(l=!0),void 0===c&&(c=!1),void 0===h&&(h=null),void 0===p&&(p=[]),void 0===u&&(u=""),void 0===d&&(d=""),this.Description=e,this.PropertyName=t,this.RoutePath=i,this.RouteParameterProperties=n,this.DataOrder=r,this.ColumnOrder=s,this.Visible=o,this.Clss=a,this.Orderable=l,this.HeaderWraps=c,this.PropertyType=h,this.PropertySource=p,this.EditorName=u,this.RendererName=d},W=function(){function e(e){this.est=e}return e.prototype.generateRouterLink=function(e,t,i){if(this.est.DynamicTableRouterLinkCache[i._hash+e])return this.est.DynamicTableRouterLinkCache[i._hash+e];var n=this.getRouterLink(e,t,i);return this.est.DynamicTableRouterLinkCache[i._hash+e]=n,n},e.prototype.getRouterLink=function(e,t,i){for(var n=0;n<t.length;n++)e=e.replace("{"+n+"}",i.properties[t[n]]);return e=e.replace(/'/g,'"').replace(/ /g,""),JSON.parse(e)},e.prototype.eventuallyReviewDynamicColumns=function(){if(this.est.TMPBoundSource&&0!=this.est.TMPBoundSource.length&&(!!this.est.TMPBoundSource[0].properties&&!(!this.est.FirstBind&&this.est.DynamicRowColumnsDefinition&&this.est.DynamicRowColumnsDefinition.length>0)))if(this.est.DynamicRowColumnsDefinition&&0!=this.est.DynamicRowColumnsDefinition.length)this.est.UserDefinedDynamicCols=!0;else{var e=this.est.TMPBoundSource[0].properties;for(var t in this.est.DynamicRowColumnsDefinition=[],e)this.est.DynamicRowColumnsDefinition.push(new U(t,t));this.est.UserDefinedDynamicCols=!1}},e}(),j=function(){function e(e){this.est=e}return e.prototype.assignHierarchyLevels=function(e){if(e&&e.length)if(this.est.ParentKey||this.est.OwnKey||(void 0!==e[0].parentid&&(this.est.ParentKey="parentid"),void 0!==e[0].id&&(this.est.OwnKey="id")),this.est.ParentKey&&this.est.OwnKey){var t=1,i=0;do{i=this.assignLevel(e,t),t++}while(i>0)}else console.error("Per utilizzare il sistema in modalità gerarchica è obbligatorio specificare sia ParentKey che OwnKey. Fallback a sistema non gerarchico")},e.prototype.assignLevel=function(e,t){for(var i=0,n=0;n<e.length;n++){var r=e[n];if(r[this.est.ParentKey]||1!=t){if(r[this.est.ParentKey]&&t>1)for(var s=0;s<e.length;s++){var o=e[s];if(o[this.est.OwnKey]==r[this.est.ParentKey]&&o._level==t-1){r._level=t,o._expanded=this.est.StartsExpanded,o.parent=!0,r._visible=this.est.StartsExpanded,i++;break}}}else r._level=1,r._visible=!0,r._expanded=this.est.StartsExpanded,i++}return i},e.prototype.expandParent=function(e){for(var t=0;t<this.est.boundSource.length;t++){var i=this.est.boundSource[t];if(i[this.est.OwnKey]==e){i._expanded=!0;for(var n=0;n<this.est.boundSource.length;n++){var r=this.est.boundSource[n];r[this.est.ParentKey]==e&&(r._visible=!0)}return}}},e.prototype.collapseParent=function(e){for(var t=0;t<this.est.boundSource.length;t++){var i=this.est.boundSource[t];if(i[this.est.OwnKey]==e)return i._expanded=!1,void this.collapseChildOfParent(e)}},e.prototype.collapseChildOfParent=function(e){for(var t=0;t<this.est.boundSource.length;t++){var i=this.est.boundSource[t];i[this.est.ParentKey]!=e||i.parent?i[this.est.ParentKey]==e&&i.parent&&(i._expanded=!1,i._visible=!1,this.collapseChildOfParent(i[this.est.OwnKey])):i._visible=!1}},e}(),q=function(){function e(e,t){this.est=e,this.utilities=t}return e.prototype.getItemsByMode=function(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1);var n=[];return this.est.viewMode&&this.est.View instanceof H?n=this.getViewItemsBySource():this.est.arrayMode&&(this.est.View.forEach((function(e){e._item=!0})),this.est.UseArrayModePaging&&!i?(this.est.SearchView?(this.est.ArraymodeItemsPerPage=this.est.SearchView.itemsperpageoverride,this.est.arraymodePage=this.est.SearchView.page,this.est.arraymodePages=this.est.SearchView.pages):t&&this.refreshPaging(this.est.ArraymodeItemsPerPage),n=this.adaptViewToPaging()):n=this.est.View),e?n.filter((function(e){return e._selected})):n},e.prototype.refreshPaging=function(e){this.est.ArraymodeItemsPerPage=e,this.est.arraymodePages=Math.ceil(this.est.View.length/this.est.ArraymodeItemsPerPage),this.est.arraymodePage=1,this.est.internalWriteValue()},e.prototype.getViewItemsBySource=function(){var e,t,i,n=this,r=this.est.View,s=r.groupings?r.groupings.filter((function(e){return!e.aggregation})).length:0;return((null===(e=r.requestedgroups)||void 0===e?void 0:e.length)!=s||0==(null===(t=r.requestedgroups)||void 0===t?void 0:t.length))&&s>0?((i=r.groups).forEach((function(e){e._group=!0,n.utilities.cacheAggregations(e)})),i):((i=this.est.ItemSourceProperty?this.est.View[this.est.ItemSourceProperty]:this.est.View.items)||(i=[]),i.forEach((function(e){e._item=!0})),i)},e.prototype.adaptViewToPaging=function(){var e=[];if(this.est.SearchView)return this.est.View;this.est.arrayPulsanti=this.utilities.getPagesArray(6,this.est.arraymodePage,this.est.arraymodePages);for(var t=(this.est.arraymodePage-1)*this.est.ArraymodeItemsPerPage;t<this.est.arraymodePage*this.est.ArraymodeItemsPerPage;t++)t<=this.est.View.length-1&&e.push(this.est.View[t]);return e},e.prototype.arrayModeReviewOrderings=function(){var e=this;this.est.arrayOrders.length>0&&this.est.arrayOrders.forEach((function(t){e.est.boundSource=e.est.boundSource.sort((function(e,i){return(e[t.id]>i[t.id]?1:-1)*("DESC"==t.order?-1:1)}))}))},e}(),K=function(){function e(e,t){this.est=e,this.utilities=t}return e.prototype.reviewReportBindings=function(){var e=this;this.est.View.orders&&this.est.View.orders.length>0&&this.est.View.orders.forEach((function(t){e.est.View.report_columns.filter((function(e){return e.id==t.column}))[0].order=t.order}));var t=this.est.View.objectcount;-2!=t?this.est.previousCount=t:-2==t&&(t=this.est.previousCount);var i=this.est.View.itemsperpageoverride||15;this.est.View.pages=Math.ceil(t/i),this.est.arrayPulsanti=this.utilities.getPagesArray(6,this.est.View.page,this.est.View.pages)},e.prototype.generateThsAndTdsFromView=function(e){for(var t={ths:[],tds:[]},i=0;i<e.report_columns.length;i++){var n=e.report_columns[i],r=new G(null);r.th=n.id,r.thStaticContent=n.description,r.thBackgroundColor=n.color;var s=new k(null);s.td=n.id,s.tdPropertyAccessor=i.toString(),t.ths.push(r),t.tds.push(s)}return t},e}(),$=function(e,t,i){this.column=e,this.count=t,this.value=i,this.aggregations=[]},X=function(e,t,i){this.column=e,this.aggregation=t,this.value=i},J=function(e,t,i){this.column=e,this.aggregation=t,this.datatype=i},Q=function(e,t,i,n,r){this._grouplevel=e,this._thisRoute=t,this._parent=i,this.view=n,this.searches=r,this._sep=!0,this.buttons=[],this._thisKey=i+"_sep"},Z=function(e,t){this.column=e,this.value=t},Y=function(){function e(e,t,i){this.est=e,this.utilities=t,this.dateExts=i,this.rgGroupCache=new Map,this.rgItemCache=new Map,this.rgChildGroupsCache=new Map}return e.prototype.handleNewDataOnRowGrouping=function(e,t){var i,n,r,s,o,a,l,c=this;if(0==((null===(a=e.requestedgroups)||void 0===a?void 0:a.length)||0)){this.est.boundSource=this.est.TMPBoundSource,this.rgGroupCache=new Map,this.rgItemCache=new Map,this.rgChildGroupsCache=new Map,this.est.TMPBoundSource.forEach((function(e){e._thisRoute=e._group?[{column:e.column,value:e.value}]:[],e._thisKey=e._group?e.value:null,e._grouplevel=0,c.rgGroupCache.set(e._thisKey,e)}));var h=this.est.TMPBoundSource[0];this.est.MainGroupView=Object.assign({},e),this.est.groupSearchRequestsCache=[{path:"",route:[{column:h.column,value:h.value}],view:this.est.MainGroupView,group_column:this.est.TMPBoundSource[0].column}],this.est.BaseItemsCount=e.objectcount}else{for(var p,u,d=e.requestedgroups.length!=t,g=this.est.boundSource,m=0,f="",v=[],y=0;y<e.requestedgroups.length;y++){var w=e.requestedgroups[y];f+=w.value,v.push({column:w.column,value:w.value});for(var C=m;C<g.length;C++){var b=g[C];if(C>=m&&b._group&&b.column==w.column&&b.value==w.value){m=C,b._expanded=!0;break}}}if(d){try{for(var S=x(this.rgChildGroupsCache.keys()),I=S.next();!I.done;I=S.next()){(T=I.value).startsWith(f)&&this.rgChildGroupsCache.delete(T)}}catch(e){i={error:e}}finally{try{I&&!I.done&&(n=S.return)&&n.call(S)}finally{if(i)throw i.error}}try{for(var _=x(this.rgItemCache.keys()),O=_.next();!O.done;O=_.next()){var T;(T=O.value).startsWith(f)&&this.rgItemCache.delete(T)}}catch(e){r={error:e}}finally{try{O&&!O.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}this.rgChildGroupsCache.set(f,[]),u=this.rgChildGroupsCache.get(f)}else this.rgItemCache.set(f,[]),p=this.rgItemCache.get(f);this.est.TMPBoundSource.forEach((function(t){t._parent=f,t._parentRoute=v,t._thisRoute=t._group?P(v,[new Z(t.column,t.value)]):[],t._thisKey=t._group?f+t.value:f,d?(t._grouplevel=e.requestedgroups.length,c.rgGroupCache.set(t._thisKey,t),u.push(t)):p.push(t)})),d&&e.savedstate?(this.est.boundSource=this.est.boundSource.filter((function(e){return!(e._item||e._thisRoute.length>v.length)})),this.est.groupSearchRequestsCache=this.est.groupSearchRequestsCache.filter((function(e){return!(e.route.length>v.length)}))):d&&(this.est.boundSource=this.est.boundSource.filter((function(e){return!(e._item||e._thisKey.startsWith(f)&&e._thisKey!=f)}))),this.est.boundSource=this.est.boundSource.filter((function(e){return!(e._parent==f)}));var M=this.est.boundSource[m];d&&(M._groupscount=null===(l=this.est.View)||void 0===l?void 0:l.groupcount),(o=this.est.boundSource).splice.apply(o,P([m+1,0],this.est.TMPBoundSource));this.est.boundSource.splice(m+1+0,0,this.getGroupSeparator(e,f,v,e.requestedgroups.length,d?"groups":"items"));var H={path:f,route:v,view:Object.assign({},e),group_column:d?this.est.TMPBoundSource[0].column:""},E=this.est.groupSearchRequestsCache.findIndex((function(e){return e.path==H.path&&e.group_column==H.group_column}));-1==E?this.est.groupSearchRequestsCache.push(H):this.est.groupSearchRequestsCache.splice(E,1,H)}},e.prototype.arrayModeReviewGroupings=function(e){if(0!=e.length){for(var t=[],i=[],n=0;n<e.length;n++){var r=e[n];r.thGroup?t.push(new $(r.th,0,"")):r.thAggregation&&(i=P(i,this.getGroupAggregations(r)))}t.length>0&&(this.rgGroupCache.clear(),this.rgItemCache.clear(),this.rgChildGroupsCache.clear(),this.est.ArrayGrouping=!0,this.est.boundSource=this.getGroupsRecursive(t,0,this.est.boundSource,i,null))}},e.prototype.getGroupAggregations=function(e){var t=[];return e.thAggregation?this.getEsThDirectiveListOfAggregations(e).forEach((function(i){var n=i.format&&["small","long","verylong"].includes(i.format),r=i.format&&i.format.startsWith("F")&&!Number.isNaN(i.format.charAt(1))&&2==i.format.length;if(!n&&!r&&i.format)throw"Le aggergazioni supportate dall'es-table sono solo 'small', 'long', 'verylong' per le date e 'F0-9' per i numeri";t.push(new J(e.th,i.func,n?"date":r?"number":"string"))})):e.thGroup&&t.push(new J(e.th,null)),t},e.prototype.getEsThDirectiveListOfAggregations=function(e){if(!e.thAggregation)return[];if(e._thAggregations)return e._thAggregations;var t=[],i=e.thAggregation.match(/{[a-zA-Z0-9\/:]*}/gi);return i?(i.forEach((function(e){var i=e.split(":"),n=e,r="";i.length>0&&(n=i[0].substr(1),r=i[1].substr(0,i[1].length-1)),t.push({func:n,format:r,match:e})})),e._thAggregations=t,t):[]},e.prototype.getGroupsRecursive=function(e,t,i,n,r){0==t&&i.forEach((function(e){return e._visible=!1}));var s=e[t],o=[],a=e.length==t+1,l=this.utilities.groupBy(i,s.column),c=function(i){var c=l[i],p=new $(s.column,c.length,i);p.aggregations=h.generateAggregations(c,n);var u=p;if(u._group=!0,u._expanded=!1,r?(u._parent=r._thisKey,u._parentRoute=r._thisRoute,u._thisRoute=P(r._thisRoute,[{column:p.column,value:p.value}]),u._thisKey=r._thisKey+p.value,u._grouplevel=r._grouplevel+1):(u._thisRoute=[{column:p.column,value:p.value}],u._thisKey=p.value,u._grouplevel=0),0==t&&(u._visible=!0),h.utilities.calculateHash([u]),h.utilities.cacheAggregations(u),o.push(u),h.rgGroupCache.set(u._thisKey,u),a)c.forEach((function(e){return e._thisKey=u._thisKey})),o.push.apply(o,P(c)),h.rgItemCache.set(u._thisKey,c);else{var d=h.getGroupsRecursive(e,t+1,c,n,u),g=d.filter((function(e){return e._group&&e._parent==u._thisKey}));u._groupscount=g.length,o.push.apply(o,P(d)),h.rgChildGroupsCache.set(u._thisKey,g)}},h=this;for(var p in l)c(p);return o},e.prototype.generateAggregations=function(e,t){for(var i=[],n="",r=null,s=null,o=null,a=null,l=0;l<t.length;l++){var c=t[l];if(r=c.column){switch(c.datatype){case"string":s=e.map((function(e){return e[r].toString()}));break;case"date":o=e.map((function(e){return new Date(e[r]).getTime()}));break;case"number":a=e.map((function(e){return parseFloat(e[r])}))}switch(c.aggregation){case"max":switch(c.datatype){case"string":n=s.sort().reverse()[0];break;case"date":n=new Date(Math.max.apply(Math,P(o))).toString();break;case"number":n=Math.max.apply(Math,P(a)).toString()}break;case"min":switch(c.datatype){case"string":n=s.sort()[0];break;case"date":n=new Date(Math.min.apply(Math,P(o))).toString();break;case"number":n=Math.min.apply(Math,P(a)).toString()}break;case"sum":switch(c.datatype){case"string":n=s.join(", ");break;case"date":n="";break;case"number":n=a.reduce((function(e,t){return e+t}),0).toString()}}i.push(new X(c.column,c.aggregation,n))}}return i},e.prototype.getGroupSeparator=function(e,t,i,n,r){var s=new Q(n,i,t,Object.assign({},e),r);return s.buttons=this.utilities.getPagesArray(6,e.page,e.pages),this.utilities.calculateHash([s]),s},e.prototype.emitRowGroupingSearches=function(e,t){var i=this,n=this.est.groupSearchRequestsCache.filter((function(t){return t.group_column==e})).map((function(e){return e.view}));n&&0!=n.length||(n=this.est.groupSearchRequestsCache.filter((function(e){return!e.group_column})).map((function(e){return e.view}))),n&&0!=n.length&&n.forEach((function(e){e.orders=t,e.savedstate=!0,i.est.emitSearchRequest(!1,e)}))},e.prototype.getGroupCellDisplay=function(e,t,i){var n=this;if(e._sep)return"";var r=i.thAggregation;if(e.column==t){var s=e._groupscount?" - "+e._groupscount+" "+this.est.lc.loc("Groups"):"";return e.value+" ("+e.count+s+")"}var o=e._aggregationsCache.get(t);return o?(this.getEsThDirectiveListOfAggregations(i).forEach((function(e){r=r.replace(e.match,n.formatAggregationValue(o.get(e.func),e.format))})),r):""},e.prototype.formatAggregationValue=function(e,t){if(!t)return e;if(!Number.isNaN(e)&&(!t||t.startsWith("F"))&&t.startsWith("F")&&!Number.isNaN(t.substr(1)))return parseFloat(e).toFixed(parseInt(t.substr(1)));var i=null;try{i=this.dateExts.getDateConvertion(e)}catch(e){}return i?this.dateExts.getFormatted(i,"small"==t,"verylong"==t):e},e}(),ee=function(e,t,i){this.cache=e,this.index_cache=t,this.array=i},te=function(){function e(e,t){this.est=e,this.rgHandler=t,this.itemsCache=new Map,this.groupsCache=new Map,this.exclusionsCache=new Map,this.group_exclusionsCache=new Map,this.i_itemsCache=new Map,this.i_groupsCache=new Map,this.i_exclusionsCache=new Map,this.i_group_exclusionsCache=new Map}return e.prototype.clearSelectionCaches=function(){this.itemsCache.clear(),this.groupsCache.clear(),this.exclusionsCache.clear(),this.group_exclusionsCache.clear(),this.i_itemsCache.clear(),this.i_groupsCache.clear(),this.i_exclusionsCache.clear(),this.i_group_exclusionsCache.clear()},e.prototype.evaluateSelection=function(e,t){t&&this.handleSelectionEvaluation(e,t)},e.prototype.evaluateSingleCellSelection=function(e,t,i){for(var n=0;n<e.length;n++)this.est.selectionStatus[e[n]._ordinal]={},i&&i.length>0?this.fillSelectionStatusByDynamicColumns(e[n],i):this.fillSelectionStatusByEsThs(e[n],t)},e.prototype.fillSelectionStatusByDynamicColumns=function(e,t){for(var i=this,n=function(n){var s=t[n],o={selected:!1,value:s.PropertyName?e[s.PropertyName]:"Undefined Property",type:s.PropertyType,property:s.PropertyName,header:s.PropertyName,item:e};r.est.selectionStatus[e._ordinal][n]=o,o.val_setter=function(t){if(!s.PropertyName)return e[s.PropertyName]=t,o.value=t,t;var n="";switch(s.PropertyType){case"string":n=t.startsWith('"')&&t.endsWith('"')?t.substring(1,t.length-1):t;break;case"number":case"int":case"boolean":case"enum":case"autocomplete":case"float":case"currency":n=t;break;case"date":case"datetime":n=i.est.dateExts.getDateConvertion(t);break;case"time":var r=i.est.dateExts.getDateConvertion(t);n=r.hour()+":"+r.minute()+":"+r.second()}return e[s.PropertyName]=n,o.value=n,n}},r=this,s=0;s<t.length;s++)n(s)},e.prototype.fillSelectionStatusByEsThs=function(e,t){for(var i=this,n=function(n){var s=t[n],o={selected:!1,value:s.thProperty?e[s.thProperty]:"Undefined Property",type:s.thType,property:s.thProperty,header:s.th,item:e};r.est.selectionStatus[e._ordinal][n]=o,o.val_setter=function(t){if(!s.thProperty)return e[s.thProperty]=t,o.value=t,t;var n="";switch(s.thType){case"string":n=t.startsWith('"')&&t.endsWith('"')?t.substring(1,t.length-1):t;break;case"number":case"int":case"boolean":case"enum":case"autocomplete":case"float":case"currency":n=t;break;case"date":case"datetime":n=i.est.dateExts.getDateConvertion(t);break;case"time":var r=i.est.dateExts.getDateConvertion(t);n=r.hour()+":"+r.minute()+":"+r.second()}return e[s.thProperty]=n,o.value=n,n}},r=this,s=0;s<t.length;s++)n(s)},e.prototype.handleSelectionEvaluation=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],r=n._hash,s=n._group?null:this.getItemGroup(n);this.rehidrateCache(n),n._item?t.all?n._selected=!this.exclusionsCache.has(r)&&(!this.groupsCache.has(null==s?void 0:s._hash)&&this.itemsCache.has(r)||!this.group_exclusionsCache.has(null==s?void 0:s._hash)):n._selected=!this.exclusionsCache.has(r)&&(this.groupsCache.has(null==s?void 0:s._hash)||this.itemsCache.has(r)||"included"==this.parentTreeStatus(s)&&!this.group_exclusionsCache.has(null==s?void 0:s._hash)):n._group&&(t.all?n._selected=!this.group_exclusionsCache.has(r)&&"excluded"!=this.parentTreeStatus(n):n._selected=this.groupsCache.has(r)||"included"==this.parentTreeStatus(n)&&!this.group_exclusionsCache.has(r))}if(this.est.globalCheck=this.est.boundSource.length>0&&this.est.boundSource.filter((function(e){return e._group||e._item})).every((function(e){return e._selected})),this.est.canSelectAll=t.count>0&&this.est.SelectAll&&!this.est.SingleSelection,this.est.arrayMode){var o=this.est.selectedObjects;this.finalizeSelectionInformations(t),this.est.selectedObjects!=o&&this.est.onSelectionChanged.emit(t)}},e.prototype.rehidrateCache=function(e){var t=e._hash;this.itemsCache.has(t)&&this.itemsCache.set(t,e),this.group_exclusionsCache.has(t)&&this.group_exclusionsCache.set(t,e),this.groupsCache.has(t)&&this.groupsCache.set(t,e),this.exclusionsCache.has(t)&&this.exclusionsCache.set(t,e)},e.prototype.parentTreeStatus=function(e){if(!e)return"none";var t=this.rgHandler.rgGroupCache.get(e._parent);return t?this.group_exclusionsCache.has(t._hash)?"excluded":this.groupsCache.has(t._hash)?"included":this.parentTreeStatus(t):"none"},e.prototype.handleItemsSelection=function(e,t,i){var n,r,s;void 0===t&&(t=null),void 0===i&&(i=null);var o=(null===(n=this.est.View)||void 0===n?void 0:n.selection)||this.est.arraymodeSelection;if(this.est.SingleSelection&&(null===(r=e[0])||void 0===r?void 0:r._selected)&&!(null===(s=e[0])||void 0===s?void 0:s._group)){if(e.length>1&&null==t)throw"Tentativo di selezionare o deselezionare più di un elemento con SingleSelection attivo";1==e.length&&null==t&&(o=this.handleItemsSelection(this.est.boundSource.filter((function(e){return!e._group})),!1,null),e[0]._selected=!0)}for(var a=0;a<e.length;a++){var l=e[a],c=null!=t?l._selected!=t:null!=i&&l._selected!=this.est.globalCheck;if(c&&!l.locked&&(l._selected=null!=t?t:this.est.globalCheck),c||null==i){var h=o.all,p=l._group,u=l._selected,d=null,g=null,m=null,f=null,v=null,y=null,w=null,C=null,b=null;if(p){var x=this.parentTreeStatus(l);C="included"==x,b="excluded"==x,g=this.getGroupItems(o,l,null,!0),m=this.getGroupItems(o,l,"selected",!0,g),f=this.getGroupItems(o,l,"unselected",!0,g),v=this.getGroupChildGroups(o,l,null,!0),y=this.getGroupChildGroups(o,l,"selected",!0,v),w=this.getGroupChildGroups(o,l,"unselected",!0,v)}else C=null==(d=this.getItemGroup(l))?null:d._selected,b=null==d?null:!d._selected;this.est.ArrayGrouping?this.performSimpleSelectionOperations(o,l,p,u,d,m,f,g,v):this.performSelectionOperations(o,l,h,p,u,m,y,f,w,g,v,C,b)}}return null==i&&(this.est.globalCheck=!this.est.boundSource.some((function(e){return!e._selected&&!e._sep}))),this.finalizeSelectionInformations(o),o},e.prototype.performSimpleSelectionOperations=function(e,t,i,n,r,s,o,a,l){var c=this,h=this.getTriptic("item",e);i?n?(l.forEach((function(e){e._selected=!0})),o&&o.forEach((function(e){e._selected=!0,c.addItem(e,h)}))):(l.forEach((function(e){e._selected=!1})),s&&s.forEach((function(e){e._selected=!1,c.removeItem(e,h)}))):n?(this.addItem(t,h),r&&a&&a.every((function(e){return e._selected}))&&this.selectGroup(r)):(this.removeItem(t,h),r&&(r._selected=!1))},e.prototype.selectGroup=function(e){e._selected=!0;var t=this.getGroupParent(e);t&&this.getGroupChildGroups(null,t,null,!0).every((function(e){return e._selected}))&&this.selectGroup(t)},e.prototype.performSelectionOperations=function(e,t,i,n,r,s,o,a,l,c,h,p,u){var d=this,g=this.getTriptic("group",e),m=this.getTriptic("item",e),f=this.getTriptic("exclusion",e),v=this.getTriptic("group_exclusion",e);n?r?(i||p?this.removeItem(t,v):this.addItem(t,g),s&&s.forEach((function(e){return d.removeItem(e,m)})),o&&o.forEach((function(e){return d.removeItem(e,g)})),c&&c.forEach((function(e){e._selected=!0,d.removeItem(e,f)})),h&&h.forEach((function(e){e._selected=!0,d.removeItem(e,v)}))):(i||p?this.addItem(t,v):this.removeItem(t,g),a&&a.forEach((function(e){return d.removeItem(e,f)})),l&&l.forEach((function(e){return d.removeItem(e,f)})),c&&c.forEach((function(e){e._selected=!1,d.removeItem(e,m)})),h&&h.forEach((function(e){e._selected=!1,d.removeItem(e,g)}))):r?null==u&&i||p?this.removeItem(t,f):this.addItem(t,m):u||!i&&null==u?this.removeItem(t,m):this.addItem(t,f)},e.prototype.removeItem=function(e,t){var i=t.index_cache.get(e._hash);return null!=i&&(t.cache.delete(e._hash),t.index_cache.delete(e._hash),t.array[i]=null),!!i},e.prototype.addItem=function(e,t){if(null==t.index_cache.get(e._hash)){var i=t.array.push(e)-1;return t.cache.set(e._hash,e),t.index_cache.set(e._hash,i),!0}return!1},e.prototype.getTriptic=function(e,t){switch(e){case"group":return new ee(this.groupsCache,this.i_groupsCache,t.groups);case"item":return new ee(this.itemsCache,this.i_itemsCache,t.items);case"group_exclusion":return new ee(this.group_exclusionsCache,this.i_group_exclusionsCache,t.group_exclusions);case"exclusion":return new ee(this.exclusionsCache,this.i_exclusionsCache,t.exclusions)}},e.prototype.getItemGroup=function(e){var t=this.rgHandler.rgGroupCache.get(e._thisKey);return t||null},e.prototype.getGroupItems=function(e,t,i,n,r){var s,o;void 0===n&&(n=!1),void 0===r&&(r=null);var a=[];if(r)a=r;else if(n)try{for(var l=x(this.rgHandler.rgItemCache.keys()),c=l.next();!c.done;c=l.next()){var h=c.value;h.startsWith(t._thisKey)&&a.push.apply(a,P(this.rgHandler.rgItemCache.get(h)))}}catch(e){s={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(s)throw s.error}}else a=this.rgHandler.rgItemCache.get(t._thisKey);return 0!=(a=a.filter((function(e){return!i||e._selected&&"selected"==i||!e._selected&&"unselected"==i}))).length||!e||this.est.arrayMode||("unselected"==i?a=e.exclusions.filter((function(e){return null!=e&&!n&&e._thisKey==t._thisKey||n&&e._thisKey.startsWith(t._thisKey)})):"selected"==i&&(a=e.items.filter((function(e){return null!=e&&!n&&e._thisKey==t._thisKey||n&&e._thisKey.startsWith(t._thisKey)})))),a},e.prototype.getGroupParent=function(e){var t=this.rgHandler.rgGroupCache.get(e._parent);return t||null},e.prototype.getGroupChildGroups=function(e,t,i,n,r){var s,o;void 0===n&&(n=!1),void 0===r&&(r=null);var a=this.rgHandler.rgGroupCache.get(t._thisKey),l=[];if(r)l=r;else if(n)try{for(var c=x(this.rgHandler.rgChildGroupsCache.keys()),h=c.next();!h.done;h=c.next()){var p=h.value;p.startsWith(t._thisKey)&&l.push.apply(l,P(this.rgHandler.rgChildGroupsCache.get(p)))}}catch(e){s={error:e}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(s)throw s.error}}else l=this.rgHandler.rgChildGroupsCache.get(t._thisKey);return 0==(l=l.filter((function(e){return!i||e._selected&&"selected"==i||!e._selected&&"unselected"==i}))).length&&e?l="unselected"==i?e.group_exclusions.filter((function(e){return null!=e&&(!n&&e._thisRoute.length==a._thisRoute.length+1&&e._thisRoute.startsWith(t._thisKey)||n&&e._thisKey.startsWith(t._thisKey))})):e.groups.filter((function(e){return null!=e&&(!n&&e._thisRoute.length==a._thisRoute.length+1&&e._thisRoute.startsWith(t._thisKey)||n&&e._thisKey.startsWith(t._thisKey))})):l},e.prototype.finalizeSelectionInformations=function(e){for(var t=[],i=[],n=[],r=[],s=!1,o=!1,a=!1,l=!1,c=0;c<e.items.length;c++)null!=e.items[c]?i.push(e.items[c]):o=!0;for(c=0;c<e.exclusions.length;c++)null!=e.exclusions[c]?n.push(e.exclusions[c]):a=!0;if(e.groups)for(c=0;c<e.groups.length;c++)null!=e.groups[c]?t.push(e.groups[c]):s=!0;if(e.group_exclusions)for(c=0;c<e.group_exclusions.length;c++)null!=e.group_exclusions[c]?r.push(e.group_exclusions[c]):l=!0;e.items=i,e.group_exclusions=r,e.exclusions=n,e.groups=t,s&&(this.i_groupsCache=this.compactIndexMap(this.i_groupsCache)),o&&(this.i_itemsCache=this.compactIndexMap(this.i_itemsCache)),a&&(this.i_exclusionsCache=this.compactIndexMap(this.i_exclusionsCache)),l&&(this.i_group_exclusionsCache=this.compactIndexMap(this.i_group_exclusionsCache)),e.count=this.evaluateSelected(),0==e.count&&(this.est.boundSource.forEach((function(e){return e._selected=!1})),e.all=!1,e.exclusions=[],e.items=[],e.groups=[],e.group_exclusions=[],this.clearSelectionCaches()),this.est.canSelectAll=e.count>0&&this.est.SelectAll&&!this.est.SingleSelection},e.prototype.compactIndexMap=function(e){var t,i,n=0,r=new Map;try{for(var s=x(e.keys()),o=s.next();!o.done;o=s.next()){var a=o.value;r.set(a,n++)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},e.prototype.evaluateSelected=function(){var e,t=(null===(e=this.est.View)||void 0===e?void 0:e.selection)||this.est.arraymodeSelection,i=t.group_exclusions.reduce((function(e,t){return e+t.count}),0),n=t.groups.reduce((function(e,t){return e+t.count}),0);return this.est.selectedObjects=(t.all?this.est.BaseItemsCount:n)-i+t.items.length-t.exclusions.length,this.est.selectedObjects},e.prototype.selectAllOrResetSelection=function(){var e=this.est.View.selection||this.est.arraymodeSelection;this.clearSelectionCaches(),e.all=!e.all,e.exclusions=[],e.groups=[],e.group_exclusions=[],e.items=[],e.all||(this.est.canSelectAll=!1,this.est.globalCheck=!1),this.finalizeSelectionInformations(e),this.est.onSelectionChanged.emit(e),this.evaluateSelection(this.est.boundSource,e)},e.prototype.singleCellSelection=function(e,t,i){if(this.clearTextSelection(e),e.shiftKey&&this.est.ShiftClick&&this.lastSingleSelection){for(var n=t<this.lastSingleSelection.row?-1:1,r=i<this.lastSingleSelection.column?-1:1,s=this.lastSingleSelection.row;s!=t+n;s+=n)for(var o=this.lastSingleSelection.column;o!=i+r;o+=r)this.est.selectionStatus[s][o].selected=!0;this.lastSingleSelection={row:t,column:i}}else this.clearSelectionStatus({row:t,column:i}),this.est.selectionStatus[t][i].selected=!this.est.selectionStatus[t][i].selected,this.lastSingleSelection={row:t,column:i};this.est.cdr.markForCheck()},e.prototype.clearSelectionStatus=function(e){for(var t in this.est.selectionStatus)for(var i in this.est.selectionStatus[t])e&&(!e||t==e.row.toString()&&i==e.column.toString())||(this.est.selectionStatus[t][i].selected=!1)},e.prototype.getSelectionStatusSelection=function(){var e=[];for(var t in this.est.selectionStatus){var i=[];for(var n in this.est.selectionStatus[t]){var r=this.est.selectionStatus[t][n];r.selected&&i.push(r)}i.length>0&&e.push(i)}return e},e.prototype.clearTextSelection=function(e){if(("Range"==e.view.getSelection().type||e.view.getSelection().toString().length>0)&&!e.shiftKey)return!1;("Range"==e.view.getSelection().type||e.view.getSelection().toString().length>0)&&e.shiftKey&&this.est.utiExts.clearTextSelection()},e.prototype.getClipbardTextFromSelection=function(e){for(var t="",i=0;i<e.length;i++){var n=e[i];i>0&&(t+="\n");for(var r=0;r<n.length;r++){var s=n[r];t+=this.getValueByType(s)+(r<n.length-1?"\t":"")}}return t},e.prototype.getValueByType=function(e){switch(e.type){case"string":return'"'+e.value+'"';case"number":case"int":case"boolean":case"enum":case"autocomplete":case"float":case"currency":return e.value;case"date":return dayjs(e.value).format(this.est.lc.token("getSmallDateDisplayFormat"));case"datetime":return dayjs(e.value).format(this.est.lc.token("getFullDateDisplayFormat"));case"time":return dayjs(e.value).format("HH:mm:ss")}},e}(),ie=function(){function e(e){this.hashExts=e}return e.prototype.groupBy=function(e,t){for(var i={},n=0;n<e.length;n++){var r=e[n];(i[r[t]]=i[r[t]]||[]).push(r)}return i},e.prototype.cacheAggregations=function(e){e._aggregationsCache=new Map;for(var t=e._aggregationsCache,i=0;i<e.aggregations.length;i++){var n=e.aggregations[i];if(t.has(n.column))t.get(n.column).set(n.aggregation,n.value);else{var r=new Map;r.set(n.aggregation,n.value),t.set(n.column,r)}}},e.prototype.arrayMove=function(e,t,i){if(i>e.length-1||t>e.length-1||i<0||t<0)throw"Gli indici passati non fanno riferimento a una posizione dell'array. Length: "+e.length+" Old:"+t+" New: "+i;e.splice(i,0,e.splice(t,1)[0])},e.prototype.getPagesArray=function(e,t,i,n,r){void 0===n&&(n=null),void 0===r&&(r=null);var s,o,a=[];if(-1==i&&(null==n&&null==r||n==r)&&(i=t+1),-1==i&&0==n&&(i=t),i<=e)s=1,o=i-1;else{var l=(e-2)/2;o=t+l,(s=t-l)<1?(s=1,o=e-1):o>=i&&(s=i-e+1,o=i-1)}if(a.push({val:1,cssClass:1===t?"btn-main app-white-text":"app-white-button"}),o>=s){for(var c=s;c<=o;c++)1!==c&&a.push({val:c,cssClass:c===t?"btn-main app-white-text":"app-white-button"});a.push({val:i,cssClass:i===t?"btn-main app-white-text":"app-white-button"})}return a},e.prototype.calculateHash=function(e){if(e)for(var t={},i=0;i<e.length;i++){var n=e[i],r=Object.assign({},e[i]);delete r._selected,delete r._visible,delete r._hash;var s=this.hashExts.hashObject(r);t[s]=t[s]?t[s]+1:1,n._hash=s+(t[s]>1?"_"+t[s]:""),n._ordinal=i}},e.prototype.InputOrDefault=function(e,t,i){return null!=e&&null!=e?e:null!=t&&null!=t?t:null!=i&&null!=i?i:null},e}();ie.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new ie(t.ɵɵinject(n.HashingService))},token:ie,providedIn:"root"}),ie.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],ie.ctorParameters=function(){return[{type:n.HashingService}]};var ne=function(){var e=this;this.OnCopy=new a.Subject,this.OnPaste=new a.Subject,document.addEventListener("keydown",(function(t){"c"===t.key&&t.ctrlKey&&e.OnCopy.next(),"v"===t.key&&t.ctrlKey&&e.OnPaste.next()}))};ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[]};var re=function(){function e(e,i,n,r,s,o,l,c,h,p,u,d,g){var m,f,v,y,w,C,b,x,S,P,I,_,O,T,M,H,E,D=this;this.ngControl=e,this.prefService=i,this.deafults=n,this.locale=r,this.lc=s,this.cdr=o,this.utilities_H=l,this.utiExts=c,this.expExts=h,this.dateExts=p,this.msgExts=u,this.copyPasteDetector=d,this.clipboardService=g,this.FocusSubject=new a.Subject,this.doubleClickBufferMs=200,this.View=null,this.globalCheck=!1,this.lastSelected=null,this.selectedObjects=0,this.canSelectAll=!1,this.viewMode=!1,this.arrayMode=!1,this.boundSource=[],this.TMPBoundSource=[],this.boundSubSources=[],this.addedSlices=[],this.defaultAllPageOverride=999999,this.autoUpdate=!1,this.seconds="10",this.researchInProgress=!1,this.RowTDs=null,this.TMPRowTDs=null,this.RowTHs=null,this.TMPRowTHs=null,this.TMPRowThGroups=null,this.RowThGroups=null,this.DynamicTableRouterLinkCache={},this.RowContexts=[],this.OrderDirectives=[],this.lastSelectedItemID=null,this.UserDefinedDynamicCols=!1,this.FirstBind=!0,this.ColumnsList=[],this.TMPColumnsList=[],this.globalColVisCheck=!1,this.CornerMenuOptions=null,this.ColumnsResizable=null,this.ColumnsPinnable=null,this.AutoUpdate=null,this.UseCustomCells=null,this.MaxHeight=null,this.ContainerClass=null,this.XLSXExport=null,this.CSVExport=!0,this.AllSearch=null,this.HighCellDensity=null,this.Selection=null,this.ShowLoadingOnBootstrap=null,this.Removal=null,this.RemovalCondition="",this.Export=null,this.ShiftClick=null,this.CountLabel=null,this.HidePaging=null,this.HidePagingCount=null,this.HidePagingButtons=null,this.ContextMenu=null,this.ExportFileName="Export.csv",this.TableClass=null,this.HasHeaderGroup=null,this.HasSecondaryHeaderGroup=null,this.HeaderHidden=null,this.BodyHidden=null,this.SelectionDisabled=null,this.SingleSelection=null,this.RowClassAssigner=null,this.OrderByColumn=null,this.MultipleOrderingDirectives=!0,this.HiddenColumns=null,this.ColumnsOrdering=null,this.SearchView=null,this.SelectAll=null,this.UseArrayModePaging=!0,this.DynamicRowColumnsDefinition=null,this.DynamicOperations=[],this.Hierarchy=null,this.ParentKey="",this.OwnKey="",this.StartsExpanded=!0,this.SavePreferences=null,this.PagingStyle=null,this.RowGroupingPagingStyle=null,this.ItemSourceProperty="",this.UseSelectionCache=null,this.ShowItemGroupsColumns=null,this.Editable=!1,this.RangeSelection=!1,this.onOrderChanged=new t.EventEmitter,this.onSearchRequest=new t.EventEmitter,this.onSelectionChanged=new t.EventEmitter,this.onRemoval=new t.EventEmitter,this.onAbortRemoval=new t.EventEmitter,this.onModelChange=new t.EventEmitter,this.onCornerAction=new t.EventEmitter,this.onDynamicOperation=new t.EventEmitter,this.arraymodePage=1,this.arraymodePages=1,this.ArraymodeItemsPerPage=null,this.arrayColumns=[],this.arrayColumnOrdering=[],this.arrayOrders=[],this.internalWriteCall=!1,this.groupSearchRequestsCache=[],this.ResearchNeeded=!1,this.Columns={Visibile:100,VisibleUnpinned:100,Global:100},this.MainGroupView=null,this.BaseItemsCount=null,this.ArrayGrouping=!1,this.DirectivesBased=!1,this.selectionStatus={},this.PagerOptions={PagerCount:null,ShowCount:!0,ShowPaging:!0,ShowButtons:!0,ShowPagingOptions:!0,UsesView:!0,View:null,Ready:!1,Searches:"items"},this.propagateChange=function(e){},this.bodyTrackBy=function(e,t){return t._hash},this.copySubscription=this.copyPasteDetector.OnCopy.subscribe((function(){D.handleCopy()})),this.pasteSubscription=this.copyPasteDetector.OnPaste.subscribe((function(){D.handlePaste()})),this.export_H=new L(this,this.expExts,this.msgExts,this.utiExts,this.dateExts),this.rowGrouping_H=new Y(this,this.utilities_H,this.dateExts),this.columnMetadata_H=new N(this,this.utilities_H,this.utiExts,this.prefService,this.rowGrouping_H),this.dynamicMode_H=new W(this),this.hierarchyMode_H=new j(this),this.items_H=new q(this,this.utilities_H),this.reportMode_H=new K(this,this.utilities_H),this.selection_H=new te(this,this.rowGrouping_H),e&&(e.valueAccessor=this),this.ColumnsResizable=this.utilities_H.InputOrDefault(this.ColumnsResizable,null===(m=this.deafults)||void 0===m?void 0:m.ColumnsResizable),this.AutoUpdate=this.utilities_H.InputOrDefault(this.AutoUpdate,null===(f=this.deafults)||void 0===f?void 0:f.AutoUpdate),this.AllSearch=this.utilities_H.InputOrDefault(this.AllSearch,null===(v=this.deafults)||void 0===v?void 0:v.AllSearch,!0),this.Export=this.utilities_H.InputOrDefault(this.Export,null===(y=this.deafults)||void 0===y?void 0:y.Export),this.HidePaging=this.utilities_H.InputOrDefault(this.HidePaging,null===(w=this.deafults)||void 0===w?void 0:w.HidePaging,!1),this.HidePagingCount=this.utilities_H.InputOrDefault(this.HidePagingCount,null===(C=this.deafults)||void 0===C?void 0:C.HidePagingCount),this.HidePagingButtons=this.utilities_H.InputOrDefault(this.HidePagingButtons,null===(b=this.deafults)||void 0===b?void 0:b.HidePagingButtons),this.ContainerClass=this.utilities_H.InputOrDefault(this.ContainerClass,null===(x=this.deafults)||void 0===x?void 0:x.ContainerClass,""),this.TableClass=this.utilities_H.InputOrDefault(this.TableClass,null===(S=this.deafults)||void 0===S?void 0:S.TableClass,"table table-striped table-hover table-sm"),this.Selection=this.utilities_H.InputOrDefault(this.Selection,null===(P=this.deafults)||void 0===P?void 0:P.Selection),this.SavePreferences=this.utilities_H.InputOrDefault(this.SavePreferences,null===(I=this.deafults)||void 0===I?void 0:I.SavePreferences),this.PagingStyle=this.utilities_H.InputOrDefault(this.PagingStyle,null===(_=this.deafults)||void 0===_?void 0:_.PagingStyle,"bottom"),this.RowGroupingPagingStyle=this.utilities_H.InputOrDefault(this.RowGroupingPagingStyle,null===(O=this.deafults)||void 0===O?void 0:O.RowGroupingPagingStyle,"left"),this.UseSelectionCache=this.utilities_H.InputOrDefault(this.UseSelectionCache,null===(T=this.deafults)||void 0===T?void 0:T.UseSelectionCache,!0),this.ShowItemGroupsColumns=this.utilities_H.InputOrDefault(this.ShowItemGroupsColumns,null===(M=this.deafults)||void 0===M?void 0:M.ShowItemGroupsColumns,!1),this.ArraymodeItemsPerPage=this.utilities_H.InputOrDefault(this.ArraymodeItemsPerPage,null===(H=this.deafults)||void 0===H?void 0:H.ArraymodeItemsPerPage,15),this.ColumnsPinnable=this.utilities_H.InputOrDefault(this.ColumnsPinnable,null===(E=this.deafults)||void 0===E?void 0:E.ColumnsPinnable,!0)}return e.prototype.ngOnInit=function(){var e=this;this.ctxMenuSubscription=(this.ContextMenu||this.tableEmptyMenu).open.subscribe((function(t){if(!t.item._sep){var i=!t.item._selected;t.item._selected=!0;var n=e.selection_H.handleItemsSelection([t.item]);e.changed(),i&&e.onSelectionChanged.emit(n)}}))},e.prototype.ngAfterViewInit=function(){var e=this.EsTdsDirective&&this.EsTdsDirective.length>0&&this.EsThsDirective&&this.EsThsDirective.length>0,t=!(this.bodyRef||this.headerRef||this.headerGroupRef||this.secondaryHeaderGroupRef);if((e||t)&&(null==this.UseCustomCells&&(this.UseCustomCells=!0),null==this.HiddenColumns&&this.UseCustomCells&&(this.HiddenColumns=!0),null==this.ColumnsOrdering&&this.UseCustomCells&&(this.ColumnsOrdering=!0),null==this.OrderByColumn&&this.UseCustomCells&&(this.OrderByColumn=!0),null==this.SelectAll&&this.Selection&&(this.SelectAll=!0),null==this.ShiftClick&&this.Selection&&(this.ShiftClick=!0),this.DirectivesBased=!0),this.Hierarchy&&!this.UseCustomCells)throw'Es-table error: Per poter utilizzare l\'es-table con [Hierarchy]="true" è richiesto anche [UseCustomCells]="true"'},e.prototype.ngOnDestroy=function(){this.copySubscription&&this.copySubscription.unsubscribe(),this.pasteSubscription&&this.pasteSubscription.unsubscribe(),this.ctxMenuSubscription&&this.ctxMenuSubscription.unsubscribe()},e.prototype.ngOnChanges=function(e){return C(this,void 0,void 0,(function(){return b(this,(function(t){return e.SearchView&&this.SearchView&&(this.arrayPulsanti=this.utilities_H.getPagesArray(6,this.SearchView.page,this.SearchView.pages||1,this.SearchView.items.length,this.SearchView.itemsperpageoverride)),[2]}))}))},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.changed=function(){this.propagateChange(this.View)},e.prototype.writeValue=function(e){var t;return C(this,void 0,void 0,(function(){var i,n,r,s,o,a,l;return b(this,(function(c){switch(c.label){case 0:return this.View=e||null,this.researchInProgress=!1,this.View||this.SearchView?(!this.View||void 0===this.View.itemsperpageoverride||this.View instanceof H?!this.SearchView||void 0===this.SearchView.itemsperpageoverride||this.SearchView instanceof H||(this.SearchView.__proto__=new H):this.View.__proto__=new H,this.View&&this.View instanceof H?(this.setMode("view"),i=0==((null===(t=this.View.requestedgroups)||void 0===t?void 0:t.length)||0),this.View.selection&&(this.View.internalsearchrequest||!i)&&this.UseSelectionCache||(this.selection_H.clearSelectionCaches(),this.View.selection=new E([]),this.onSelectionChanged.emit(this.View.selection)),this.View.internalsearchrequest=!1,this.SavePreferences?this.ngControl.name?[3,1]:(console.error("Non posso utilizzare le preference senza avere un 'name' per questa tabella"),[3,4]):[3,4]):[3,5]):(this.boundSource=this.TMPBoundSource||[],this.cdr.markForCheck(),[2]);case 1:return this.prefService?[3,2]:(console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato"),[3,4]);case 2:return[4,this.prefService.getItem(this.ngControl.name).toPromise()];case 3:if(n=c.sent(),this.View){for(r=(null==n?void 0:n.columns)||[],s=!0,o=void 0,a=void 0,this.View.report_columns?(o=this.View.report_columns.map((function(e){return e.id})),a=r):(o=r,a=this.View.columns),l=0;l<a.length;l++)if(-1==o.indexOf(a[l])){s=!1;break}s&&(this.View.columns=(null==n?void 0:n.columns)||[],this.View.column_ordering=(null==n?void 0:n.column_ordering)||[])}c.label=4;case 4:return i&&(this.arrayPulsanti=this.utilities_H.getPagesArray(6,this.View.page,this.View.pages||1,this.View.items.length,this.View.itemsperpageoverride)),[3,10];case 5:return this.View&&null!=this.View.length&&null!=this.View.length?(this.setMode("array"),this.UseSelectionCache&&this.arraymodeSelection||(this.selection_H.clearSelectionCaches(),this.arraymodeSelection=new E([]),this.onSelectionChanged.emit(this.arraymodeSelection)),this.SavePreferences?this.ngControl.name?[3,6]:(console.error("Non posso utilizzare le preference senza avere un 'name' per questa tabella"),[3,9]):[3,9]):[3,10];case 6:return this.prefService?[3,7]:(console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato"),[3,9]);case 7:return[4,this.prefService.getItem(this.ngControl.name).toPromise()];case 8:for(n=c.sent(),r=(null==n?void 0:n.columns)||[],s=!0,o=void 0,a=void 0,this.View.report_columns?(o=this.View.report_columns.map((function(e){return e.id})),a=r):(o=r,a=this.View.columns),l=0;l<a.length;l++)if(-1==o.indexOf(a[l])){s=!1;break}s&&(this.View.columns=(null==n?void 0:n.columns)||[],this.View.column_ordering=(null==n?void 0:n.column_ordering)||[]),c.label=9;case 9:this.SearchView&&(this.arrayPulsanti=this.utilities_H.getPagesArray(6,this.SearchView.page,this.SearchView.pages||1,this.SearchView.items.length,this.SearchView.itemsperpageoverride)),c.label=10;case 10:return this.finalizeContext(),this.postBoundSourceCalculation(),[2]}}))}))},e.prototype.finalizeContext=function(){var e=this.View,t=e.groupings&&e.groupings.filter((function(e){return!e.aggregation})).length>0||this.arrayMode&&this.EsThsDirective.some((function(e){return e.thGroup}));if(this.arrayMode&&t&&(this.UseArrayModePaging=!1),this.TMPBoundSource=this.items_H.getItemsByMode(!1,!this.internalWriteCall),this.Hierarchy&&!t&&this.hierarchyMode_H.assignHierarchyLevels(this.TMPBoundSource),this.utilities_H.calculateHash(this.TMPBoundSource),this.TMPBoundSource&&this.RowClassAssigner||this.Hierarchy)for(var i=0;i<this.TMPBoundSource.length;i++){var n=this.TMPBoundSource[i];n._rowClass=this.RowClassAssigner?this.RowClassAssigner(n):"",n._rowClass+=this.Hierarchy?" est-row-lvl-"+n._level:""}},e.prototype.setupPagingInformations=function(){var e;if(this.PagerOptions.ShowCount=!this.HidePagingCount,this.PagerOptions.ShowButtons=!this.HidePagingButtons,this.PagerOptions.ShowPaging=!this.HidePaging,this.PagerOptions.UsesView=!0,this.arrayMode&&this.UseArrayModePaging&&!this.SearchView)this.PagerOptions.PagerCount=this.View.length||0,this.PagerOptions.ShowButtons=this.PagerOptions.ShowButtons&&this.View.length>10,this.PagerOptions.View=this.View,this.PagerOptions.UsesView=!1,this.PagerOptions.ShowPagingOptions=this.PagerOptions.ShowButtons;else if(!this.arrayMode||this.UseArrayModePaging&&!this.SearchView){if(this.viewMode){var t=this.MainGroupView||this.View,i=(null==t?void 0:t.groupcount)||(null==t?void 0:t.objectcount);this.PagerOptions.Searches=null!=(null==t?void 0:t.groupcount)&&null!=(null==t?void 0:t.groupcount)?"groups":"items",this.PagerOptions.PagerCount=i||0,this.PagerOptions.View=t,this.PagerOptions.ShowCount=this.PagerOptions.ShowCount||t&&i&&-1!=i,this.PagerOptions.ShowButtons=this.PagerOptions.ShowButtons&&(t.pagingavailable||this.PagerOptions.ShowCount),this.PagerOptions.ShowPagingOptions=this.PagerOptions.ShowButtons}}else this.SearchView?(this.PagerOptions.View=this.SearchView,this.PagerOptions.PagerCount=this.SearchView.objectcount||0):this.PagerOptions.PagerCount=this.View.length||0,this.PagerOptions.ShowButtons=this.PagerOptions.ShowButtons&&(this.View.length>10||((null===(e=this.SearchView)||void 0===e?void 0:e.objectcount)||0)>10),this.PagerOptions.ShowCount=this.PagerOptions.ShowCount||this.View&&this.View.length||this.SearchView&&this.SearchView.objectcount&&-1!=this.SearchView.objectcount,this.PagerOptions.ShowPaging=this.PagerOptions.ShowButtons||this.PagerOptions.ShowCount,this.PagerOptions.ShowPagingOptions=this.PagerOptions.ShowButtons},e.prototype.postBoundSourceCalculation=function(){this.RowContexts=[],this.OrderDirectives=[],this.lastSelectedItemID=null,this.internalPostBoundSource()},e.prototype.internalPostBoundSource=function(){var e=this.View,t=this.EsThsDirective&&this.EsThsDirective.length>0?this.EsThsDirective.toArray():[],i=this.EsTdsDirective&&this.EsTdsDirective.length>0?this.EsTdsDirective.toArray():[];if(this.dynamicMode_H.eventuallyReviewDynamicColumns(),this.bindDisplayToLoadedItemsOrGroups(e),this.setupPagingInformations(),(this.viewMode||this.arrayMode)&&this.UseCustomCells){var n=this.viewMode?e:null,r=this.viewMode?P(n.items||[],n.groups||[]):e,s=this.viewMode?n.selection:this.arraymodeSelection,o=this.columnMetadata_H.expandMultiThsAndTds(t,i,r);if(t=o.expThs,i=o.expTds,!this.arrayMode&&n.report_columns){var a=this.reportMode_H.generateThsAndTdsFromView(n);t=a.ths,i=a.tds}var l=this.columnMetadata_H.evaluateHeadersGroupingInfos(t);this.arrayMode&&(this.items_H.arrayModeReviewOrderings(),this.rowGrouping_H.arrayModeReviewGroupings(l.leafs)),this.columnMetadata_H.reviewColumnsList(l.leafs),this.columnMetadata_H.alignColumnsIfLoadedView(n),this.columnMetadata_H.moveFixedColumnsAtTheBeginning(l.leafs,i),this.columnMetadata_H.alignHeadersOrdering(l.leafs,n),this.columnMetadata_H.refreshColumnsVisibility(l.leafs,i,n),this.columnMetadata_H.evaluatePinnedColumnsWidth(),this.columnMetadata_H.generateDefaultOrder(l.leafs,n),this.columnMetadata_H.evaluateHeaderGroups(l),this.evaluateRowThs(l.leafs),this.evaluateRowTds(l.leafs,i),this.columnMetadata_H.applyOrdering(n,!0),this.MoveTemporaryVariablesToRealOnes(),this.selection_H.evaluateSelection(r,s),this.selection_H.evaluateSingleCellSelection(r,l.leafs,this.DynamicRowColumnsDefinition),this.ResearchNeeded&&(this.changed(),this.emitSearchRequest(!1),this.ResearchNeeded=!1)}else if((this.viewMode||this.arrayMode)&&!this.UseCustomCells){var c=this.viewMode?e.items:e;s=this.viewMode?e.selection:this.arraymodeSelection;this.selection_H.evaluateSelection(c,s)}this.cdr.markForCheck(),this.FirstBind=!1},e.prototype.bindDisplayToLoadedItemsOrGroups=function(e){var t,i;if(!this.TMPBoundSource||0==this.TMPBoundSource.length)return this.BaseItemsCount=0,void(this.boundSource=[]);if(this.arrayMode||!this.UseCustomCells)return this.boundSource=this.TMPBoundSource,void(this.BaseItemsCount=(null==e?void 0:e.objectcount)||(null==e?void 0:e.length)||0);var n=(null===(i=null===(t=null==e?void 0:e.groupings)||void 0===t?void 0:t.filter((function(e){return!e.aggregation})))||void 0===i?void 0:i.length)||0;if(0==n)return this.boundSource=this.TMPBoundSource,void(this.BaseItemsCount=(null==e?void 0:e.objectcount)||0);this.rowGrouping_H.handleNewDataOnRowGrouping(e,n)},e.prototype.MoveTemporaryVariablesToRealOnes=function(){this.RowTDs=this.TMPRowTDs,this.RowTHs=this.TMPRowTHs,this.RowThGroups=this.TMPRowThGroups?this.TMPRowThGroups.reverse():null,this.EmptyRowTds=this.isEmpty(this.RowTDs),this.Columns.Visibile=this.RowTHs.filter((function(e){return e.Visible})).length,this.Columns.VisibleUnpinned=this.RowTHs.filter((function(e){return e.Visible&&!e.Pinned})).length,this.Columns.Global=this.Columns.VisibleUnpinned+(this.HasPinnedColumns?1:0)+(this.Selection?1:0)+(this.Removal?1:0)+(this.Export||this.HiddenColumns||this.ColumnsOrdering||this.CornerMenuOptions?1:0)},e.prototype.isEmpty=function(e){for(var t in e)return!1;return!0},e.prototype.setSelectionStatus=function(e,t,i){var n;if(t){if(!this.SelectAll)return void console.error("Impossibile impostare la selezione con l'all selection quando l'Input SelectAll è false");var r=(null===(n=this.View)||void 0===n?void 0:n.selection)||this.arraymodeSelection;(r.all&&!i||!r.all&&i)&&this.selection_H.selectAllOrResetSelection()}else this.selection_H.handleItemsSelection(e,i);this.cdr.markForCheck()},e.prototype.thOrderChanged=function(e,t){this.viewMode||this.arrayMode?this.OrderByColumn&&this.columnMetadata_H.handleTHOrderChange(e,t):console.warn("Order changed on a table not in viewMode or Array mode. Operation not supported")},e.prototype.emitSearchRequest=function(e,t){this.viewMode&&!t&&(this.View.internalsearchrequest=!0,this.changed()),t&&(e&&(t.page=1),t.internalsearchrequest=!0),this.researchInProgress=!0,this.onSearchRequest.emit(t||e)},e.prototype.evaluateRowTds=function(e,t){if(0!=t.length){for(var i={},n={},r=0;r<this.ColumnsList.length;r++){var s=this.ColumnsList[r];n[s.id]=s}for(var o=0;o<e.length;o++){i[(v=e[o]).th]=v}this.TMPRowTDs={};var a={};for(o=0;o<t.length;o++)for(var l=t[o],c=0;c<this.boundSource.length;c++){var h=this.boundSource[c],p=h._hash,u=l.td;if((v=i[l.td])&&(v._referenced=!0),v&&(l.tdIf||v.thGroup)){var d=v,g=v.thFixed||v.thGroup||v.thPinned,m=h._item?{LeftBorder:d._lbord,RightBorder:d._rbord,ID:u,Pinned:n[l.td].pinned,PinnedWidth:d.thPinnedWidth,GroupHeader:!1,GroupAggregation:!1,Visible:n[l.td].visible,Wraps:!1,Class:l.tdClass,Template:d.thGroup&&!this.ShowItemGroupsColumns?null:l.Template,Multi:l._multi,MultiProp:l._multi?l.td.split("_")[0]:null,MultiIndex:l._multi?l.td.split("_")[1]:null,PropertyName:v.thProperty,PropertyType:v.thType,PropertySource:v.thSource,PropAccessor:l.tdPropertyAccessor}:{LeftBorder:d._lbord,RightBorder:d._rbord,ID:u,Pinned:n[l.td].pinned,PinnedWidth:d.thPinnedWidth,GroupHeader:d.thGroup,GroupAggregation:!!d.thAggregation,Visible:n[l.td].visible,Wraps:!1,Class:d.thGroupClass||"",Content:this.rowGrouping_H.getGroupCellDisplay(h,u,v)};this.TMPRowTDs[p]?this.TMPRowTDs[p].push(m):(this.RowContexts.push(p),this.TMPRowTDs[p]=[m],a[p]=g?1:0)}}if(0!=this.TMPBoundSource.length){var f=[];for(o=0;o<e.length;o++){var v;(v=e[o])._referenced||f.push(v.th)}if(f.length>0)throw"L'ID di uno o più EsTh non hanno alcun EsTd associato: "+f.join(", ")}}},e.prototype.evaluateRowThs=function(e){var t;if(0!=e.length){for(var i={},n=this.View,r=this.viewMode&&(n&&!n.groupings||0==n.groupings.length),s=0;s<this.ColumnsList.length;s++){var o=this.ColumnsList[s];i[o.id]=o}this.TMPRowTHs=[];for(s=0;s<e.length;s++){var a=e[s],l=void 0;if(a.thIf||a.thGroup){var c=(a.thClass||"")+(a.thGroup?" est-col-min":"");if(l={Pinned:i[a.th].pinned,Fixed:a.thFixed,PinnedWidth:a.thPinnedWidth,ID:a.th,Visible:a.thVisible,Class:c,Order:a.thOrder,Orderable:a.thOrderable,Template:a.Template,Content:a.thStaticContent,Wrap:a.thWrap,LeftBorder:a._lbord,RightBorder:a._rbord,Multi:a._multi,MultiContent:a._multi_content},this.TMPRowTHs.push(l),r&&(a.thAggregation||a.thGroup)){var h=this.rowGrouping_H.getGroupAggregations(a);n.groupings?(t=n.groupings).push.apply(t,P(h)):n.groupings=h,this.ResearchNeeded=!0}}}}},e.prototype.addToPageGroup=function(e,t){this.goToPageGroup(t.view.page+e,t)},e.prototype.goToPageGroup=function(e,t){var i=t.view;0===e||e>i.pages&&i.pages>0||(i.page=e,t.buttons=this.utilities_H.getPagesArray(6,i.page,i.pages),this.emitSearchRequest(!1,i))},e.prototype.handleGroupClick=function(e){var t=this.View,i=e;if(i._expanded=!i._expanded,!this.ArrayGrouping){if(i._expanded){if(t.itemsperpageoverride=15,t.requestedgroups)i._grouplevel?(t.requestedgroups=[],i._parentRoute.forEach((function(e){t.requestedgroups.push(new D(e.column,e.value))})),t.requestedgroups.push(new D(e.column,e.value))):t.requestedgroups=[new D(e.column,e.value)];else t.requestedgroups=[new D(e.column,e.value)];this.changed(),this.emitSearchRequest(!0)}else{var n=(i._parent||"")+e.value;this.boundSource=this.boundSource.filter((function(e){return!e._parent||!e._parent.startsWith(n)})),this.groupSearchRequestsCache=this.groupSearchRequestsCache.filter((function(e){return e.path!=n}))}return!0}this.boundSource.filter((function(e){return e._group&&(i._expanded&&e._parent==i._thisKey||!i._expanded&&e._parent&&e._parent.startsWith(i._thisKey))||e._item&&(i._expanded&&e._thisKey==i._thisKey||!i._expanded&&e._thisKey.startsWith(i._thisKey))})).forEach((function(e){e._visible=i._expanded,e._group&&(e._expanded=!1)}))},e.prototype.globalCheckChanged=function(e){void 0===e&&(e=null);var t=this.boundSource.find((function(e){return e._group}))?this.boundSource.filter((function(e){return e._group&&!e._parent})):this.boundSource,i=this.selection_H.handleItemsSelection(t,e,this.globalCheck);this.changed(),this.onSelectionChanged.emit(i)},e.prototype.handleClick=function(e,t){this.selection_H.clearTextSelection(e);var i=[];if(e.shiftKey&&this.ShiftClick&&!this.SingleSelection)for(var n=!1,r=this.boundSource.filter((function(e){return!e._group&&!e._sep})),s=0;s<r.length;s++){var o=r[s];n&&(o._selected=!0,i.push(o)),o!=t&&o!=this.lastSelected||n?o!=t&&o!=this.lastSelected||!n||(n=!1):(n=!0,o._selected=!0,i.push(o))}else t._selected=!t._selected,this.lastSelected=t,i.push(t);var a=this.selection_H.handleItemsSelection(i);return this.changed(),this.onSelectionChanged.emit(a),!0},e.prototype.addToPage=function(e){var t,i=this.MainGroupView?this.MainGroupView:this.View;this.goToPage(((null===(t=this.SearchView||i)||void 0===t?void 0:t.page)||0)+e)},e.prototype.goToPage=function(e){var t,i=this.MainGroupView?this.MainGroupView:this.arrayMode?this.SearchView:this.View;if(i.page&&i.pages){var n=this.SearchView||i;if(!(0===e||e>n.pages&&n.pages>0)){n.page=e;var r=i.items.length||(null===(t=i.groups)||void 0===t?void 0:t.length)||0,s=i.itemsperpageoverride||15;this.arrayPulsanti=this.utilities_H.getPagesArray(6,n.page,n.pages,r,s);var o=!!this.MainGroupView;this.emitSearchRequest(!1,o?i:this.SearchView?this.SearchView:null)}}},e.prototype.onItemsPerPageChanged=function(e){this.PagerOptions.View.itemsperpageoverride=e,this.changed(),this.MainGroupView?this.emitSearchRequest(!0,this.MainGroupView):this.SearchView?(this.SearchView.page=1,this.emitSearchRequest(!0,this.SearchView)):this.emitSearchRequest(!0)},e.prototype.onGroupItemsPerPageChanged=function(e,t){e.view.itemsperpageoverride=t,this.emitSearchRequest(!0,e.view)},e.prototype.autoUpdateChanged=function(){var e=this;/^[1-9]\d*$/.test(this.seconds)||(this.seconds="10");var t=1e3*parseInt(this.seconds,null);this.autoUpdate?this.updateTimer=setInterval((function(){e.emitSearchRequest(!1)}),t):clearInterval(this.updateTimer)},e.prototype.dynamicOperation=function(e,t){this.onDynamicOperation.emit({id:t,item:e})},e.prototype.findEsTd=function(e,t){void 0===t&&(t=null);var i=this.EsTdsDirective.find((function(i){return t?i.td===t:i.tdForProperty===e}));return t&&e&&!i&&(i=this.EsTdsDirective.find((function(t){return t.tdForProperty===e}))),i?i.Template:null},e.prototype.findEditor=function(e,t){void 0===t&&(t=null);var i=this.EsTdEditorDirectives.find((function(i){return t?i.editor===t:i.editorForProperty===e}));return t&&e&&!i&&(i=this.EsTdEditorDirectives.find((function(t){return t.editorForProperty===e}))),i?i.Template:null},e.prototype.arrayAddToPage=function(e){this.arrayGoToPage(this.arraymodePage+e)},e.prototype.arrayGoToPage=function(e){0===e||e>this.arraymodePages||(this.arraymodePage=e,this.internalWriteValue())},e.prototype.cornerActionClicked=function(e){this.onCornerAction.emit({id:e,estable:this})},e.prototype.setMode=function(e){this.viewMode="view"==e,this.arrayMode="array"==e},e.prototype.internalWriteValue=function(){this.internalWriteCall=!0,this.writeValue(this.View),this.internalWriteCall=!1},e.prototype.forceRefresh=function(){var e,t;this.arrayMode&&(e=this.arraymodePage,t=this.ArraymodeItemsPerPage),this.writeValue(this.View),this.cdr.detectChanges(),this.arrayMode&&(this.ArraymodeItemsPerPage=t,this.arrayGoToPage(e))},e.prototype.dbClickEditOrSingleClickRowSelection=function(e,t,i,n){var r=this;if(!t._editing&&!e.ctrlKey)if(e.altKey&&this.RangeSelection)this.selection_H.singleCellSelection(e,i._ordinal,n);else{if(this.Editable)return this.cellDbClickTimer?(this.Editable&&t.PropertyName&&this.setupUserEdit(t,i),void this.clearCellClickTimer()):void(this.cellDbClickTimer=setTimeout((function(){r.clearCellClickTimer(),r.handleRowClick(e,i,r.Selection,!0)}),this.doubleClickBufferMs));this.handleRowClick(e,i,this.Selection,!0)}},e.prototype.handleCopy=function(){var e=this.selection_H.getSelectionStatusSelection();if(e.length>0&&e[0].length>0){var t=this.selection_H.getClipbardTextFromSelection(e);this.clipboardService.copyTextToClipboard(t),this.msgExts.simpleInfo(this.lc.loc("Values copied in the clipboard"),"toastr",1e3)}},e.prototype.handlePaste=function(){var e=this,t=this.selection_H.getSelectionStatusSelection();t.length>0&&t[0].length>0&&this.clipboardService.getClipboard("matrix",(function(i){if(i.length>0&&1==i[i.length-1].length&&""==i[i.length-1][0]&&i.splice(i.length-1,1),i.length>0&&i[0].length>0){if(!e.Editable)return void e.msgExts.simpleWarning(e.lc.loc("Data for this table cannot be edited"));if(!(t.length==i.length&&t[0].length==i[0].length||1==i.length&&1==i[0].length))return void e.msgExts.simpleWarning(e.lc.loc("Size of copied data is different from the size of the selection"));for(var n=[],r=0;r<t.length;r++)for(var s=t[r],o=0;o<s.length;o++){var a=s[o],l=1==i.length&&1==i[0].length?i[0][0]:i[r][o],c=a.value,h=a.val_setter(l),p=e.dateExts.getDateConvertion(c),u=e.dateExts.getDateConvertion(h);p&&u&&p.isSame&&p.isSame(u)||c===h||n.push(new V(a.item,a.header,a.property,c,h))}e.cdr.markForCheck(),n.length>0&&e.onModelChange.emit(n)}}))},e.prototype.clearCellClickTimer=function(){clearTimeout(this.cellDbClickTimer),this.cellDbClickTimer=null},e.prototype.handleRowClick=function(e,t,i,n){if(void 0===n&&(n=!1),e.ctrlKey||this.UseCustomCells&&!n)return!0;this.selection_H.clearSelectionStatus(),!i||t.locked||t._sep||t._group?t._group&&this.handleGroupClick(t):this.handleClick(e,t),this.cdr.markForCheck()},e.prototype.setupUserEdit=function(e,t){var i=this;this.Editable&&e.PropertyName&&(e._editing=!0,e.old_value=t[e.PropertyName]),this.cdr.detectChanges(),setTimeout((function(){i.FocusSubject.next()}))},e.prototype.finalizeUserEdit=function(e,t,i){e._editing=!1;var n=e.old_value,r=t[e.PropertyName],s=this.dateExts.getDateConvertion(n),o=this.dateExts.getDateConvertion(r);s&&o&&s.isSame&&s.isSame(o)||n===r||(this.onModelChange.emit([new V(t,e.ID,e.PropertyName,n,r)]),this.selectionStatus[t._ordinal][i].val_setter(r))},e}();re.decorators=[{type:t.Component,args:[{selector:"es-table",viewProviders:[{provide:i.LocalizationService,useClass:A}],changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,template:'\x3c!-- Patacchino di autoaggiornamento --\x3e\r\n<div class="w-100" *ngIf="AutoUpdate">\r\n <div class="pull-right">\r\n {{\'Update every\' | localize : lc}}&nbsp;<input [readonly]="autoUpdate" maxlength="3" class="form-control est-custom-input" type="text" [(ngModel)]="seconds" />&nbsp;{{\'second/s\' | localize : lc}}\r\n </div>\r\n <div class="pull-right m-t-2">\r\n <label class="est-switch">\r\n <input type="checkbox" [(ngModel)]="autoUpdate" (ngModelChange)="autoUpdateChanged();" />\r\n <div class="est-slider round"></div>\r\n </label>\r\n </div>\r\n <div class="clearfix"></div>\r\n</div>\r\n\r\n<div *ngIf="View" class="est-relative">\r\n <div *ngIf="FirstBind && ShowLoadingOnBootstrap" class="est-loading-box">\r\n <div class="est-loading-content">\r\n <span class="fa fa-spinner fa-spin"></span>&nbsp;{{\'Performing Table bootstrap\' | localize: lc}}...\r\n </div>\r\n </div>\r\n\r\n <div class="est-top-pager" *ngIf="PagingStyle == \'both\' || PagingStyle == \'top\'">\r\n <ng-container *ngTemplateOutlet="pagingElement"></ng-container>\r\n </div>\r\n\r\n <div class="est-top-allselect" *ngIf="canSelectAll || (View?.selection || arraymodeSelection)?.all">\r\n <span>{{ (selectedObjects == -1 ? (\'All the\' | localize : lc) : ((selectedObjects || 0) | number : \'0.0-0\' : locale)) + \' \' + ((selectedObjects == 1 ? \'Object Selected\' : \'Objects Selected\') | localize : lc) }}</span>&nbsp;\r\n <span class="est-link est-inline" (click)="selection_H.selectAllOrResetSelection()">{{ (View?.selection || arraymodeSelection)?.all ? (\'Reset Selection\' | localize : lc) : (\'Select Everything\' | localize : lc)}}</span>\r\n </div>\r\n\r\n <div class="table-responsive datatable {{ContainerClass}}" [style.max-height.px]="MaxHeight">\r\n <table class="{{ TableClass }} est-margin-bottom-10 est" [class.est-high-density]="HighCellDensity">\r\n <thead [hidden]="HeaderHidden || FirstBind">\r\n \x3c!-- Aggiungo il pezzo che gestisce la selezione di tutto se attivo da config --\x3e\r\n <tr *ngIf="(SelectAll && !SingleSelection) || PagingStyle != \'bottom\'">\r\n <th class="est-no-selection" [attr.colspan]="Columns.Global" [class.est-hidden-view]="!canSelectAll && !(View?.selection || arraymodeSelection)?.all && PagingStyle == \'bottom\'">\r\n <p class="est-hidden-view app-margin-bottom-0">§</p>\r\n </th>\r\n </tr>\r\n\r\n \x3c!-- Blocco header group --\x3e\r\n <ng-container *ngIf="RowThGroups">\r\n <tr *ngFor="let level of RowThGroups">\r\n <th *ngFor="let cell of level" [attr.colspan]="cell.Span" \r\n [class.est-pinned-header]="cell.Pinned" [class.est-col-min]="cell.Pinned"\r\n [class.est-ltab-border]="cell.Borders" [class.est-rtab-border]="cell.Borders"\r\n class="est-text-center">\r\n <ng-container *ngIf="cell.Pinned;">\r\n <div class="est-pinned-border est-cell-group-padding"></div>\r\n </ng-container>\r\n <ng-container *ngIf="!cell.Pinned && cell.Content; Else: cell.Template">\r\n {{cell.Content}}\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </ng-container>\r\n\r\n <ng-container *ngIf="!RowThGroups">\r\n <tr *ngIf="HasHeaderGroup">\r\n <ng-container *ngTemplateOutlet="headerGroupRef"></ng-container>\r\n <th *ngIf="Export"></th>\r\n </tr>\r\n \r\n \x3c!-- Blocco header group secondario --\x3e\r\n <tr *ngIf="HasSecondaryHeaderGroup">\r\n <ng-container *ngTemplateOutlet="secondaryHeaderGroupRef"></ng-container>\r\n <th *ngIf="Export"></th>\r\n </tr>\r\n </ng-container>\r\n\r\n \x3c!-- Blocco effettivo degli header --\x3e\r\n <tr>\r\n \x3c!-- Aggiungo una checkbox se la selezione è attiva --\x3e\r\n <th class="est-col-min" *ngIf="Selection && !HasPinnedColumns">\r\n <input *ngIf="!SingleSelection" class="est-pointer" type="checkbox" [disabled]="SelectionDisabled" [(ngModel)]="globalCheck" [ngModelOptions]="{\'standalone\': true}" (ngModelChange)="globalCheckChanged();">\r\n </th>\r\n\r\n \x3c!-- Header che valgono per view mode e array mode --\x3e\r\n <ng-container *ngIf="arrayMode || viewMode">\r\n \x3c!-- In una tabella base prendo semplicemente i th scritti dall\'utente nell\'HTML --\x3e\r\n <ng-container *ngIf="(!UseCustomCells || !RowTHs || RowTHs.length == 0) && !DynamicRowColumnsDefinition">\r\n <ng-container *ngTemplateOutlet="headerRef"></ng-container>\r\n </ng-container>\r\n\r\n \x3c!-- Se ho un modello dinamico dell\'oggetto creo le colonne in base alle proprietà --\x3e\r\n <ng-container *ngIf="(!UseCustomCells || !RowTHs || RowTHs.length == 0) && DynamicRowColumnsDefinition">\r\n <th *ngFor="let operation of DynamicOperations" class="est-col-min est-no-side-padding"></th>\r\n \r\n <ng-container *ngFor="let rowHeader of DynamicRowColumnsDefinition">\r\n <ng-container *ngIf="rowHeader.Visible">\r\n <th *ngIf="OrderByColumn" es-th="{{rowHeader.PropertyName}}" class="{{UserDefinedDynamicCols ? ((rowHeader.Clss || \'\') + (rowHeader.HeaderWraps ? \'\' : \' est-nowrap\')) : \' est-nowrap\'}}" [Order]="rowHeader.DataOrder" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn" [SearchInProgress]="!!researchInProgress" (onOrderChange)="thOrderChanged(rowHeader.PropertyName, $event)">{{rowHeader.Description}}</th>\r\n <th *ngIf="!OrderByColumn" es-th="{{rowHeader.PropertyName}}" class="{{UserDefinedDynamicCols ? ((rowHeader.Clss || \'\') + (rowHeader.HeaderWraps ? \'\' : \' est-nowrap\')) : \' est-nowrap\'}}" [Order]="rowHeader.DataOrder" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn">{{rowHeader.Description}}</th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n \x3c!-- Se non ho un modello dinamico ma invece delle celle custom, genero gli header in base ai row th --\x3e\r\n <ng-container *ngIf="UseCustomCells && RowTHs && RowTHs.length > 0">\r\n <th *ngIf="HasPinnedColumns" class="est-pinned-header est-col-min">\r\n <div [style.width.px]="PinnedContainerWidth" class="est-pinned-border est-simple-border-bottom">\r\n <th class="est-col-min est-no-border" *ngIf="Selection" [style.width.px]="20">\r\n <input *ngIf="!SingleSelection" class="est-pointer" type="checkbox" [disabled]="SelectionDisabled" [(ngModel)]="globalCheck" [ngModelOptions]="{\'standalone\': true}" (ngModelChange)="globalCheckChanged();">\r\n </th>\r\n <ng-container *ngFor="let rowHeader of RowTHs">\r\n <th *ngIf="rowHeader && rowHeader.Visible && rowHeader.Pinned" [style.width.px]="rowHeader.PinnedWidth" es-th="{{rowHeader.ID}}" \r\n class="{{rowHeader.Class || \'\'}}" \r\n [class.est-pinned-internal-header]="true" \r\n [class.est-no-border]="true" \r\n [class.est-nowrap]="!rowHeader.Wrap" \r\n [Pinned]="true" [Fixed]="rowHeader.Fixed" [Order]="rowHeader.Order" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn" [SearchInProgress]="!!researchInProgress" (onUnpinning)="columnMetadata_H.unpinColumn($event)" (onOrderChange)="thOrderChanged(rowHeader.ID, $event)">\r\n <ng-container *ngIf="rowHeader.Template"><ng-container *ngTemplateOutlet="rowHeader.Template; context: { $implicit: rowHeader.Multi ? rowHeader.MultiContent : null } "></ng-container></ng-container>\r\n <span *ngIf="!rowHeader.Template">{{rowHeader.Content}}</span>\r\n </th>\r\n </ng-container>\r\n </div>\r\n </th>\r\n <ng-container *ngFor="let rowHeader of RowTHs">\r\n\r\n <th *ngIf="rowHeader && rowHeader.Visible && !rowHeader.Pinned" es-th="{{rowHeader.ID}}" class="{{rowHeader.Class || \'\'}}" [class.est-ltab-border]="rowHeader.LeftBorder" [class.est-rtab-border]="rowHeader.RightBorder" [class.est-nowrap]="!rowHeader.Wrap" [Order]="rowHeader.Order" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn" [SearchInProgress]="!!researchInProgress" (onOrderChange)="thOrderChanged(rowHeader.ID, $event)">\r\n <ng-container *ngIf="rowHeader.Template"><ng-container *ngTemplateOutlet="rowHeader.Template; context: { $implicit: rowHeader.Multi ? rowHeader.MultiContent : null }"></ng-container></ng-container>\r\n <span *ngIf="!rowHeader.Template">{{rowHeader.Content}}</span>\r\n </th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n \x3c!--Per l\'eliminazione mi serve un header aggiuntivo--\x3e\r\n <th *ngIf="Removal" [class.est-right-9]="Export || HiddenColumns" class="est-col-min est-sticky-last-column"><span class="fa fa-trash"></span></th>\r\n\r\n \x3c!--Per l\'esportazione mi serve l\'header extra da cui faccio uscire i 3 pallocchi--\x3e\r\n <th *ngIf="Export || HiddenColumns || ColumnsOrdering || CornerMenuOptions" class="est-table-dotted-menu est-sticky-last-column est-col-min text-sm-center">\r\n \r\n \x3c!-- Link nascosto che serve a scaricare il file --\x3e\r\n <a *ngIf="headers" hidden #exportDownloader csvLink [data]="data" [headers]="headers" [delimiter]="\';\'" [filename]="ExportFileName.endsWith(\'.xlsx\') ? ExportFileName.replace(\'.xlsx\', \'.csv\') : ExportFileName.endsWith(\'.csv\') ? ExportFileName : ExportFileName + \'.csv\'"></a>\r\n\r\n \x3c!-- Blocco con i 3 pallocchi che tira fuori il context menu delle operazioni --\x3e\r\n <div class="btn-group" container="body" placement="bottom right" dropdown #dropdown="bs-dropdown" [autoClose]="true">\r\n <span dropdownToggle class="fa fa-ellipsis-v est-fs-18 est-pointer est-padding-3"></span>\r\n\r\n <div *dropdownMenu class="dropdown-menu dropdown-menu-right est-bring-to-front-strong">\r\n <div class="est-pointer">\r\n <a class="dropdown-item" *ngIf="HiddenColumns || ColumnsOrdering" (click)="columnMetadata_H.resetColumnVisSelection(); changeColumnVisibilityModal.show();">\r\n <ng-container *ngIf="!HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Order\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && !ColumnsOrdering">\r\n {{\'Columns Visibility\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Visibility and Order\' | localize : lc}}\r\n </ng-container>\r\n </a>\r\n <a class="dropdown-item" *ngIf="Export && CSVExport" (click)="export_H.tryExport(\'CSV\')">{{\'Export View\' | localize : lc}} (CSV)</a>\r\n <a class="dropdown-item" *ngIf="Export && XLSXExport" (click)="export_H.tryExport(\'XLSX\')">{{\'Export View\' | localize : lc}} (XLSX)</a>\r\n <a class="dropdown-item" *ngFor="let option of CornerMenuOptions" (click)="cornerActionClicked(option.id)">{{option.description}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody [hidden]="BodyHidden || FirstBind" >\r\n \x3c!--Con selection attiva richiamo il template che gestisce il context menu--\x3e\r\n <ng-container *ngIf="Selection">\r\n <ng-container *ngTemplateOutlet="TBodySelection; context: { $implicit: { selDisabled: arrayMode ? false : SelectionDisabled, sel: Selection }}"></ng-container>\r\n </ng-container>\r\n\r\n \x3c!--Senza selection richiamo il template che NON gestisce il context menu--\x3e\r\n <ng-container *ngIf="!Selection">\r\n <ng-container *ngTemplateOutlet="TBody"></ng-container>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n <div *ngIf="PagingStyle == \'both\' || PagingStyle == \'bottom\'">\r\n <ng-container *ngTemplateOutlet="pagingElement"></ng-container>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Template che contiene tutte le info di paginazione in modo da poterlo replicare anche sopra --\x3e\r\n<ng-template #pagingElement>\r\n <ng-container *ngIf="!FirstBind">\r\n \x3c!-- Pulsanti avanti-indietro di paginazione --\x3e\r\n <div *ngIf="PagerOptions.ShowPaging && PagerOptions.ShowButtons && (PagerOptions.PagerCount > 10 || PagerOptions.PagerCount == -1)" class="pull-right btn-toolbar">\r\n <ng-container *ngIf="View?.pagingavailable || viewMode">\r\n <ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { Margin: true, ATP: addToPage.bind(this), GTP: goToPage.bind(this), Array: arrayPulsanti }}"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf="arrayMode && UseArrayModePaging && !SearchView">\r\n <ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { Margin: true, ATP: arrayAddToPage.bind(this), GTP: arrayGoToPage.bind(this), Array: arrayPulsanti }}"></ng-container>\r\n </ng-container>\r\n </div>\r\n \x3c!-- Paginatore dove appare la count e le opzioni di paginazione --\x3e\r\n <div class="pull-right" *ngIf="PagerOptions.ShowCount || PagerOptions.ShowPagingOptions">\r\n <div class="est-mt-min-5" *ngIf="PagerOptions.ShowPaging">\r\n <app-paging *ngIf="!PagerOptions.UsesView" [CountLabel]="CountLabel" [ShowPaging]="PagerOptions.ShowPagingOptions" [ShowCount]="PagerOptions.ShowCount" [PagerCount]="PagerOptions.PagerCount" [WarnOnAll]="false" [CurrentPageSize]="ArraymodeItemsPerPage" (pagingSelected)="items_H.refreshPaging($event)"></app-paging>\r\n <app-paging *ngIf="PagerOptions.UsesView" [CountLabel]="CountLabel" [ShowPaging]="PagerOptions.ShowPagingOptions" [ShowCount]="PagerOptions.ShowCount" [PagerCount]="PagerOptions.PagerCount" [GroupMode]="PagerOptions.Searches == \'groups\'" [AllSearch]="AllSearch" [View]="PagerOptions.View" (pagingSelected)="onItemsPerPageChanged($event);"></app-paging>\r\n </div>\r\n </div>\r\n <div class="clearfix"></div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\x3c!-- Template che contiene i pulsanti per cambiare pagina --\x3e\r\n<ng-template #pagingButtons let-options>\r\n <div class="est-flex" [class.est-margin-left-50]="options.Margin">\r\n <a class="btn" class="est-page-prev app-pointer" (click)="options.ATP(-1, options.separator)"><span class="fa fa-chevron-left"></span></a>\r\n <div *ngIf="options.Array" class="est-inline"><a *ngFor="let p of options.Array" class="btn est-page-sel {{p.cssClass}}" (click)="options.GTP(p.val, options.separator)">{{p.val}}</a></div>\r\n <a class="btn" class="est-page-next app-pointer" (click)="options.ATP(1, options.separator)"><span class="fa fa-chevron-right"></span></a>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- Questi due template rappresentano effettivamente il body della tabella. essendo il tr l\'unica cosa che davvero cambia, il resto è templatizzato --\x3e\r\n<ng-template #TBodySelection let-templateOptions>\r\n <ng-container *ngFor="let item of boundSource; let even = even; let i=index; trackBy: bodyTrackBy">\r\n <tr *ngIf="item._visible || (!Hierarchy && !ArrayGrouping)" \r\n [class]="item._rowClass ? item._rowClass : \'\'" \r\n [class.est-line-through]="item.removed || item.deleted" \r\n [class.est-pointer]="!item.locked" \r\n [class.est-white-selected]="item._selected && !item.locked"\r\n [class.est-rg]="item._group"\r\n [class.est-rg-sep]="item._sep"\r\n [contextMenu]="!item.locked ? (ContextMenu || emptyMenu) : emptyMenu" [contextMenuSubject]="item"\r\n (click)="handleRowClick($event, item, true)">\r\n\r\n <td *ngIf="!item.locked && !item._sep && !HasPinnedColumns">\r\n <input type="checkbox" \r\n [disabled]="templateOptions.selDisabled" \r\n [class.est-pointer]="!item.locked"\r\n [(ngModel)]="item._selected" name="check{{i}}" \r\n (click)="$event.stopPropagation(); handleClick($event, item);">\r\n </td>\r\n <td *ngIf="(item.locked || item._sep) && !HasPinnedColumns"></td>\r\n\r\n <ng-container *ngIf="item._sep"><ng-container *ngTemplateOutlet="groupPager; context: { $implicit: item }"></ng-container> </ng-container>\r\n\r\n <ng-container *ngIf="!item._sep">\r\n <ng-container *ngTemplateOutlet="basicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="dynamicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="customCells; context: { $implicit: item, templateOptions: templateOptions }"></ng-container>\r\n </ng-container>\r\n <ng-container *ngTemplateOutlet="bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}"></ng-container>\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #TBody>\r\n <ng-container *ngFor="let item of boundSource; let even = even;">\r\n <tr *ngIf="item._visible || !Hierarchy" \r\n [class]="item._rowClass ? item._rowClass : \'\'" \r\n [class.est-line-through]="item.removed || item.deleted"\r\n [class.est-rg]="item._group"\r\n [class.est-rg-sep]="item._sep"\r\n (click)="handleRowClick($event, item, false)">\r\n\r\n <ng-container *ngIf="item._sep"><ng-container *ngTemplateOutlet="groupPager; context: { $implicit: item }"></ng-container></ng-container>\r\n\r\n <ng-container *ngIf="!item._sep">\r\n <ng-container *ngTemplateOutlet="basicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="dynamicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="customCells; context: { $implicit: item }"></ng-container>\r\n </ng-container>\r\n <ng-container *ngTemplateOutlet="bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}"></ng-container>\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #groupPager let-item>\r\n <td class="est-pinned-body " *ngIf="HasPinnedColumns"><div class="est-pinned-border est-cell-group-padding"></div></td>\r\n <td *ngIf="item._grouplevel > 1" [attr.colspan]="item._grouplevel-1"></td>\r\n <td [attr.colspan]="Columns.VisibleUnpinned - (item._grouplevel > 0 ? item._grouplevel - 1 : 0)">\r\n <div class="est-rg-sep-flex-right" *ngIf="RowGroupingPagingStyle == \'right\'">\r\n <div class="est-rg-page"><ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { separator: item, ATP: addToPageGroup.bind(this), GTP: goToPageGroup.bind(this), Array: item.buttons }}"></ng-container></div>\r\n <div class="est-rg-ipp" *ngIf="(item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount) > 10"><app-paging [CountLabel]="CountLabel" [AllSearch]="AllSearch" [GroupMode]="item.searches == \'groups\'" [PagerCount]="item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount" [View]="item.view" (pagingSelected)="onGroupItemsPerPageChanged(item, $event);"></app-paging></div>\r\n </div>\r\n\r\n <div class="est-rg-sep-flex-left" *ngIf="RowGroupingPagingStyle == \'left\'">\r\n <div class="est-rg-ipp"><app-paging [AllSearch]="AllSearch" [CountLabel]="CountLabel" [GroupMode]="item.searches == \'groups\'" [PagerCount]="item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount" [View]="item.view" (pagingSelected)="onGroupItemsPerPageChanged(item, $event);"></app-paging></div>\r\n <div class="est-rg-page" *ngIf="(item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount) > 10"><ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { separator: item, ATP: addToPageGroup.bind(this), GTP: goToPageGroup.bind(this), Array: item.buttons }}"></ng-container></div>\r\n </div>\r\n </td>\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene la print condizionale su tabelle semplici, con header e body scritti a manazza --\x3e\r\n<ng-template #basicColumns let-item>\r\n <ng-container *ngIf="(!UseCustomCells || EmptyRowTds) && !DynamicRowColumnsDefinition">\r\n <ng-container *ngTemplateOutlet="bodyRef; context : {$implicit: item}"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene la print condizionale su tabelle definite in maniera dinamica dal modello --\x3e\r\n<ng-template #dynamicColumns let-item>\r\n <ng-container *ngIf="(!UseCustomCells || EmptyRowTds) && DynamicRowColumnsDefinition">\r\n <ng-container *ngFor="let operation of DynamicOperations; let first = first; let last = last;">\r\n <ng-container *ngIf="!operation.conditionField || (item.properties[operation.conditionField] == operation.conditionValue)">\r\n <td [class.est-no-right-padding]="last" [class.est-no-left-padding]="!first" class="est-col-min"><span title="{{operation.title}}" class="{{operation.iconClass}} est-pointer" (click)="dynamicOperation(item, operation.id)">{{operation.text}}</span></td>\r\n </ng-container>\r\n <ng-container *ngIf="operation.conditionField && (item.properties[operation.conditionField] != operation.conditionValue)">\r\n <td class="est-col-min est-no-side-padding"></td>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngFor="let rowItem of DynamicRowColumnsDefinition; let i = index">\r\n\r\n <ng-container *ngIf="rowItem.RoutePath && rowItem.Visible">\r\n <td es-td="{{rowItem.PropertyName}}" class="{{UserDefinedDynamicCols ? rowItem.Clss : \'est-nowrap\'}}" [Internal]="false" [Context]="item._hash">\r\n <a [routerLink]="dynamicMode_H.generateRouterLink(rowItem.RoutePath, rowItem.RouteParameterProperties, item)" class="est-link" [innerHTML]="item.properties[rowItem.PropertyName]"></a>\r\n </td>\r\n </ng-container>\r\n\r\n <ng-container *ngIf="!rowItem.RoutePath && rowItem.Visible">\r\n <td es-td="{{rowItem.PropertyName}}" [class.est-selected-cell]="selectionStatus[item._ordinal][i].selected" \r\n (click)="dbClickEditOrSingleClickRowSelection($event, rowItem, item, i)" \r\n class="{{UserDefinedDynamicCols ? rowItem.Clss : \'est-nowrap\'}}" \r\n [Internal]="false" \r\n [class.est-no-selection]="!!Editable"\r\n [Context]="item._hash">\r\n\r\n <div [class.est-edit-hidden]="rowItem._editing" >\r\n <ng-container *ngTemplateOutlet="findEsTd(rowItem.PropertyName, rowItem.RendererName) || defaultEsTd; context: { $implicit: {value: item.properties[rowItem.PropertyName], type: rowItem.PropertyType} }"></ng-container>\r\n </div>\r\n <div *ngIf="rowItem._editing" class="est-mt-min-5">\r\n <ng-container *ngTemplateOutlet="findEditor(rowItem.PropertyName, rowItem.EditorName) || defaultEditor; context: { $implicit: { definition: rowItem, columnIndex: i, item: item, finalizer: finalizeUserEdit.bind(this, rowItem, item, i) } }"></ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #defaultEditor let-ctx>\r\n <ng-container *ngIf="ctx.item.properties">\r\n <form-adaptive [FormLayout]="false" [Validation]="false" [FocusSubject]="FocusSubject" [(ngModel)]="ctx.item.properties[ctx.definition.PropertyName]" name="{{ ctx.definition.PropertyName + \'_\' + ctx.item._hash }}" [Type]="ctx.definition.propertyType" [Source]="ctx.definition.propertySource" (inputFinalized)="ctx.finalizer()"></form-adaptive>\r\n </ng-container>\r\n <ng-container *ngIf="!ctx.item.properties">\r\n <form-adaptive [FormLayout]="false" [Validation]="false" [FocusSubject]="FocusSubject" [(ngModel)]="ctx.item[ctx.definition.PropertyName]" name="{{ ctx.definition.PropertyName + \'_\' + ctx.item._hash }}" [Type]="ctx.definition.propertyType" [Source]="ctx.definition.propertySource" (inputFinalized)="ctx.finalizer()"></form-adaptive>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #defaultEsTd let-valType>\r\n \x3c!-- Formattare il valore in base a valType.type --\x3e\r\n {{valType.value}}\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene la print condizionale delle celle custom se configurate --\x3e\r\n<ng-template #customCells let-item let-opt="templateOptions">\r\n <ng-container *ngIf="UseCustomCells && !EmptyRowTds">\r\n\r\n <td *ngIf="HasPinnedColumns" \r\n class="est-pinned-body est-col-min" [class.est-white-selected]="item._selected">\r\n <div [style.width.px]="PinnedContainerWidth" class="est-pinned-border">\r\n <td *ngIf="!item.locked && !item._sep && Selection" class="est-no-border est-col-min" [style.width.px]="20">\r\n <input type="checkbox" [disabled]="opt.selDisabled" [class.est-pointer]="!item.locked" [(ngModel)]="item._selected" name="check{{item._hash}}" (click)="$event.stopPropagation(); handleClick($event, item);">\r\n </td>\r\n <td class="est-no-border est-col-min" *ngIf="(item.locked || item._sep) && Selection" [style.width.px]="20"></td>\r\n\r\n <ng-container *ngFor="let rowItem of RowTDs[item._hash]; let i = index">\r\n <td *ngIf="rowItem && rowItem.Pinned" [style.width.px]="rowItem.PinnedWidth" es-td="{{rowItem.ID}}" class="{{rowItem.Class}}" [class.est-no-selection]="Editable &&!!rowItem.PropertyName" [class.est-no-border]="true" [class.est-rg-hdr]="rowItem.GroupHeader" [class.est-rg-agg]="rowItem.GroupAggregation" \r\n [class.est-nowrap]="Hierarchy || !rowItem.Wraps" [Internal]="true" (click)="dbClickEditOrSingleClickRowSelection($event, rowItem, item, i)">\r\n\r\n <div [class.est-edit-hidden]="rowItem._editing" [class.est-pre]="!(Hierarchy && i == 0)">\r\n <ng-container *ngIf="Hierarchy && i == 0"><ng-container *ngTemplateOutlet="HierarchyNavigator; context: { $implicit: rowItem.Multi ? (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) : item }"></ng-container></ng-container>\r\n <ng-container *ngIf="!rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: rowItem.Multi ? (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) : item }"></ng-container></ng-container>\r\n <span *ngIf="rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) }"></ng-container></span>\r\n <ng-container *ngIf="!rowItem.Template && !rowItem.Multi">\r\n <span *ngIf="rowItem.Content && !rowItem.PropAccessor">{{rowItem.Content}}</span>\r\n <span *ngIf="!rowItem.Content && rowItem.PropAccessor">{{item.values? item.values[rowItem.PropAccessor] : item[rowItem.PropAccessor]}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf="rowItem._editing" class="est-mt-min-5">\r\n <ng-container *ngTemplateOutlet="findEditor(rowItem.PropertyName) || defaultEditor; context: { $implicit: { definition: rowItem, columnIndex: i, item: item, finalizer: finalizeUserEdit.bind(this, rowItem, item, i) } }"></ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n </div>\r\n </td>\r\n\r\n <ng-container *ngFor="let rowItem of RowTDs[item._hash]; let i = index">\r\n <ng-container *ngIf="rowItem && !rowItem.Pinned">\r\n\r\n \x3c!-- Casistica senza bodyRef, quindi con direttive per i td --\x3e\r\n <ng-container *ngIf="!bodyRef && rowItem.Visible">\r\n <td es-td="{{rowItem.ID}}" class="{{rowItem.Class}}" [class.est-selected-cell]="selectionStatus[item._ordinal][i].selected" [class.est-ltab-border]="rowItem.LeftBorder" [class.est-rtab-border]="rowItem.RightBorder" [class.est-no-selection]="Editable && !!rowItem.PropertyName" [class.est-rg-hdr]="rowItem.GroupHeader" [class.est-rg-agg]="rowItem.GroupAggregation" \r\n [class.est-nowrap]="Hierarchy || !rowItem.Wraps" [Internal]="true" \r\n (click)="dbClickEditOrSingleClickRowSelection($event, rowItem, item, i)">\r\n\r\n <div [class.est-edit-hidden]="rowItem._editing" [class.est-pre]="!(Hierarchy && i == 0)" >\r\n <ng-container *ngIf="Hierarchy && i == 0"><ng-container *ngTemplateOutlet="HierarchyNavigator; context: { $implicit: item }"></ng-container></ng-container>\r\n <ng-container *ngIf="!rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: item }"></ng-container></ng-container>\r\n <span *ngIf="rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) }"></ng-container></span>\r\n <ng-container *ngIf="!rowItem.Template && !rowItem.Multi">\r\n <span *ngIf="rowItem.Content && !rowItem.PropAccessor">{{rowItem.Content}}</span>\r\n <span *ngIf="!rowItem.Content && rowItem.PropAccessor">{{item.values? item.values[rowItem.PropAccessor] : item[rowItem.PropAccessor]}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf="rowItem._editing" class="est-mt-min-5">\r\n <ng-container *ngTemplateOutlet="findEditor(rowItem.PropertyName) || defaultEditor; context: { $implicit: { definition: rowItem, columnIndex: i, item: item, finalizer: finalizeUserEdit.bind(this, rowItem, item, i) } }"></ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #HierarchyNavigator let-item>\r\n <span *ngIf="!item.parent" class="fa fa-chevron-down" style="visibility:hidden"></span>\r\n <span *ngIf="item.parent && item._expanded" class="fa fa-chevron-down est-pointer est-no-selection" (click)="hierarchyMode_H.collapseParent(item[this.OwnKey])"></span>\r\n <span *ngIf="item.parent && !item._expanded" class="fa fa-chevron-up est-pointer est-no-selection" (click)="hierarchyMode_H.expandParent(item[this.OwnKey])"></span>\r\n &nbsp;\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene i pulsanti di eliminazione/undo eliminazione ed esportazione che vanno in fondo ad un record edlla tabella --\x3e\r\n<ng-template #bodyDeleteAndExport let-options>\r\n <ng-container *ngIf="Removal && !RemovalCondition">\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="!(options.item.removed || options.item.deleted)"><span class="fa fa-remove est-pointer text-danger" [hidden]="options.item.removable != undefined && !options.item.removable" (click)="onRemoval.emit(options.item)"></span></td>\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="(options.item.removed || options.item.deleted)"><span class="fa fa-undo text-warning est-pointer" (click)="onAbortRemoval.emit(options.item)"></span></td>\r\n </ng-container>\r\n <ng-container *ngIf="Removal && RemovalCondition">\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="!(options.item.removed || options.item.deleted) && options.item[RemovalCondition]"><span class="fa fa-remove est-pointer text-danger" [hidden]="options.item.removable != undefined && !options.item.removable" (click)="onRemoval.emit(options.item)"></span></td>\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="(options.item.removed || options.item.deleted) && options.item[RemovalCondition]"><span class="fa fa-undo text-warning est-pointer" (click)="onAbortRemoval.emit(options.item)"></span></td>\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="!options.item[RemovalCondition]"><span class="fa fa-remove est-hidden-view"></span></td>\r\n </ng-container>\r\n <td *ngIf="Export || HiddenColumns || CornerMenuOptions" class="est-sticky-last-column{{options.even && !Hierarchy ? \'-alt\' : \'\'}}"></td>\r\n</ng-template>\r\n\r\n\x3c!-- Context menu vuoto default per tutte le tabella che non ce l\'hanno, in modo che al click destro appaia "nessuna op disponibile" --\x3e\r\n<context-menu #emptyMenu>\r\n <ng-template contextMenuItem>\r\n <span>\r\n <em>{{\'No operations available\' | localize : lc}}...</em>\r\n </span>\r\n </ng-template>\r\n</context-menu>\r\n\r\n\x3c!-- Modal per cambiare posizione e visibilità delle colonne dell\'es-table --\x3e\r\n<div bsModal #changeColumnVisibilityModal="bs-modal" class="modal fade" role="dialog" aria-hidden="true">\r\n <div class="modal-dialog modal-lg" cdkDrag>\r\n <div class="modal-content">\r\n <div class="modal-header est-pointer" cdkDragHandle>\r\n <h5 class="modal-title pull-left">\r\n <ng-container *ngIf="!HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Order\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && !ColumnsOrdering">\r\n {{\'Columns Visibility\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Visibility and Order\' | localize : lc}}\r\n </ng-container>\r\n </h5>\r\n <button type="button" class="close pull-right" (click)="changeColumnVisibilityModal.hide();" aria-label="Close">\r\n <span aria-hidden="true">&times;</span>\r\n </button>\r\n </div>\r\n <div class="modal-body">\r\n <div *ngIf="!TMPColumnsList || TMPColumnsList.length == 0" class="card card-info est-padding-10 est-margin-bottom-0">\r\n {{\'There are no columns configured to be hidden/shown in this view\' | localize : lc}}\r\n </div>\r\n <div *ngIf="TMPColumnsList && TMPColumnsList.length > 0" style="max-height:500px; overflow-y:auto">\r\n \x3c!--Aaaaaaah la tristezza... qui mi servirebbe l\'es-table per facilitare la selezione multipla ecc... peccato che se la linko qui entro in un loop impressionante--\x3e\r\n <table class="table table-striped table-sm est-margin-bottom-0">\r\n <thead>\r\n <tr>\r\n <th class="est-col-min" *ngIf="HiddenColumns">\r\n <input class="est-pointer" type="checkbox" [(ngModel)]="globalColVisCheck" [ngModelOptions]="{\'standalone\': true}" (ngModelChange)="columnMetadata_H.globalColVisCheckChanged();">\r\n </th>\r\n \x3c!-- <th class="est-col-min" *ngIf="ColumnsOrdering"></th> --\x3e\r\n <th class="est-col-min est-nowrap">{{\'Column Name\' | localize : lc}}</th>\r\n \x3c!--Filler--\x3e\r\n <th></th>\r\n \x3c!-- Pinner --\x3e\r\n <th *ngIf="DirectivesBased" class="est-col-min"></th>\r\n </tr>\r\n </thead>\r\n <tbody \r\n cdkDropList \r\n [cdkDropListData]="TMPColumnsList" \r\n (cdkDropListDropped)="columnMetadata_H.columnReordered($event)" \r\n [cdkDropListSortPredicate]="columnMetadata_H.sortPredicate.bind(this.columnMetadata_H)"\r\n class="est-dropbox">\r\n\r\n <tr *ngFor="let item of TMPColumnsList; let i = index; let last = last" \r\n class="est-pointer est-droplist" \r\n [class.est-white-selected]="lastSelectedItemID == item.id" \r\n [class.est-no-selection]="!item.visible"\r\n cdkDrag\r\n [cdkDragData]="item"\r\n [cdkDragDisabled]="!ColumnsOrdering || item.fixed || item.pinned">\r\n\r\n <td *ngIf="HiddenColumns">\r\n <input type="checkbox" [class.est-hidden-view]="item.fixed" class="est-pointer" [(ngModel)]="item.visible" name="visible{{i}}" (ngModelChange)="columnMetadata_H.updateGlobalColVisCheck();" />\r\n </td>\r\n <td class="est-nowrap drag-visible" (click)="columnMetadata_H.columnClicked(item);">\r\n <ng-container *ngIf="item.template">\r\n \x3c!-- Padri --\x3e\r\n <span *ngIf="item.parentTemplates && item.parentTemplates.length > 0" class="est-fw-bold est-fs-13">\r\n (&nbsp;\r\n <ng-container *ngFor="let parent of item.parentTemplates; let last=last">\r\n <ng-container *ngIf="parent.tmpl"><ng-container *ngTemplateOutlet="parent.tmpl"></ng-container></ng-container>\r\n <ng-container *ngIf="parent.content">{{parent.content}}</ng-container>\r\n <span *ngIf="!last">&nbsp;-&nbsp;</span>\r\n </ng-container>\r\n &nbsp;)\r\n </span>\r\n \x3c!-- Template header originale --\x3e\r\n <ng-container *ngTemplateOutlet="item.template; context: { $implicit: item.multi ? item.multiContent : null }"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf="!item.template">{{item.description}}</ng-container>\r\n </td>\r\n \x3c!--Filler--\x3e\r\n <td (click)="columnMetadata_H.columnClicked(item);"></td>\r\n \x3c!-- Pinner --\x3e\r\n <td *ngIf="DirectivesBased && ColumnsPinnable"><span *ngIf="!item.fixed && item.pinnable" class="fa fa-thumb-tack" [class.text-success]="item.pinned" (click)="columnMetadata_H.pinOrUnpinColumn(item)"></span></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n <div class="modal-footer">\r\n <button type="button" class="btn btn-secondary est-margin-right-10" (click)="lastSelectedItemID = null; changeColumnVisibilityModal.hide();">{{\'Close\' | localize : lc}}</button>\r\n <button type="button" [disabled]="!TMPColumnsList || TMPColumnsList.length == 0" class="btn btn-primary" (click)="columnMetadata_H.confirmColumnVisibilitySelection() && changeColumnVisibilityModal.hide()">{{\'Confirm\' | localize : lc}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>',styles:['.est-loading-box{height:200px;text-align:center;position:relative;background:#ccc}.est-loading-content{margin:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:35px}.est-scrollable{max-height:600px;overflow:auto}.est-head-resizer{top:0;right:0;bottom:0;width:7px;position:absolute;cursor:col-resize}.est-head-resizer-internal{top:0;right:0;left:6px;bottom:0;width:1px;position:absolute;background-color:#ccc;height:100%}.est-pointer{cursor:pointer}.est-high-density td,.est-high-density th{padding:0 .2rem}.est-no-selection{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.est-edit-hidden{height:1px!important}.est-edit-hidden,.est-hidden-view{visibility:hidden}.est-no-border{border:none!important}.est-nowrap{white-space:nowrap}.est-mt-min-5{margin-top:-5px}.est-white-selected{background-color:#ddd!important}.est-line-through{text-decoration:line-through}.est-no-side-padding{padding-left:0;padding-right:0}.est-no-left-padding,.est-no-right-padding{padding-left:0}.est-col-min{width:1px}.est-margin-bottom-0{margin-bottom:0!important}.est-margin-right-10{margin-right:10px!important}.est-right-9{right:9px!important}.est-table-dotted-menu{padding:0 0 2px!important;color:#999}.est-fs-18{font-size:18px}.est-fs-13,.est-fs-14{font-size:14px}.est-fw-bold{font-weight:700}.est-padding-3{padding:3px!important}.est-page-container{position:relative}.est-bring-to-front-strong{z-index:99999999!important}.est-switch{position:relative;display:inline-block;width:30px;height:17px;margin-bottom:0;margin-right:5px;margin-left:5px}.est-switch input{display:none}.est-slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc}.est-slider,.est-slider:before{position:absolute;transition:.4s}.est-slider:before{content:"";height:13px;width:13px;left:3px;bottom:2px;background-color:#fff}input:checked+.est-slider{background-color:#2196f3}input:focus+.est-slider{box-shadow:0 0 1px #2196f3}input:checked+.est-slider:before{transform:translateX(11px)}.est-slider.round{border-radius:10px}.est-slider.round:before{border-radius:50%}.est-custom-input{width:30px;display:inline;padding:1px;height:20px}.est-row-lvl-1 td:first-child{padding-left:5px}.est-row-lvl-2 td:first-child{padding-left:20px}.est-row-lvl-3 td:first-child{padding-left:35px}.est-row-lvl-4 td:first-child{padding-left:50px}.est-row-lvl-5 td:first-child{padding-left:65px}.est-row-lvl-6 td:first-child{padding-left:80px}.est-row-lvl-7 td:first-child{padding-left:95px}.est-row-lvl-8 td:first-child{padding-left:110px}.est-row-lvl-9 td:first-child{padding-left:125px}.est-row-lvl-10 td:first-child{padding-left:140px}.est-row-lvl-11 td:first-child{padding-left:155px}.est-row-lvl-12 td:first-child{padding-left:170px}.est-row-lvl-13 td:first-child{padding-left:185px}.est-row-lvl-14 td:first-child{padding-left:200px}.est-row-lvl-15 td:first-child{padding-left:215px}.est-row-lvl-16 td:first-child{padding-left:230px}.est-row-lvl-17 td:first-child{padding-left:245px}.est-row-lvl-18 td:first-child{padding-left:260px}.est-row-lvl-19 td:first-child{padding-left:275px}.est-row-lvl-20 td:first-child{padding-left:290px}.est-row-lvl-21 td:first-child{padding-left:305px}.est-row-lvl-22 td:first-child{padding-left:320px}.est-row-lvl-23 td:first-child{padding-left:335px}.est-row-lvl-24 td:first-child{padding-left:350px}.est-row-lvl-25 td:first-child{padding-left:365px}.est-row-lvl-26 td:first-child{padding-left:380px}.est-row-lvl-27 td:first-child{padding-left:395px}.est-row-lvl-28 td:first-child{padding-left:410px}.est-row-lvl-29 td:first-child{padding-left:425px}.est-row-lvl-30 td:first-child{padding-left:440px}.est-row-lvl-31 td:first-child{padding-left:455px}.est-row-lvl-32 td:first-child{padding-left:470px}.est-row-lvl-33 td:first-child{padding-left:485px}.est-row-lvl-34 td:first-child{padding-left:500px}.est-row-lvl-35 td:first-child{padding-left:515px}.est-row-lvl-36 td:first-child{padding-left:530px}.est-row-lvl-37 td:first-child{padding-left:545px}.est-row-lvl-38 td:first-child{padding-left:560px}.est-row-lvl-39 td:first-child{padding-left:575px}.est-row-lvl-40 td:first-child{padding-left:590px}.est-row-lvl-41 td:first-child{padding-left:605px}.est-row-lvl-42 td:first-child{padding-left:620px}.est-row-lvl-43 td:first-child{padding-left:635px}.est-row-lvl-44 td:first-child{padding-left:650px}.est-row-lvl-45 td:first-child{padding-left:665px}.est-row-lvl-46 td:first-child{padding-left:680px}.est-row-lvl-47 td:first-child{padding-left:695px}.est-row-lvl-48 td:first-child{padding-left:710px}.est-row-lvl-49 td:first-child{padding-left:725px}.est-row-lvl-50 td:first-child{padding-left:740px}.est-row-lvl-51 td:first-child{padding-left:755px}.est-row-lvl-52 td:first-child{padding-left:770px}.est-row-lvl-53 td:first-child{padding-left:785px}.est-row-lvl-54 td:first-child{padding-left:800px}.est-row-lvl-55 td:first-child{padding-left:815px}.est-row-lvl-56 td:first-child{padding-left:830px}.est-row-lvl-57 td:first-child{padding-left:845px}.est-row-lvl-58 td:first-child{padding-left:860px}.est-row-lvl-59 td:first-child{padding-left:875px}.est-row-lvl-60 td:first-child{padding-left:890px}.est-row-lvl-61 td:first-child{padding-left:905px}.est-row-lvl-62 td:first-child{padding-left:920px}.est-row-lvl-63 td:first-child{padding-left:935px}.est-row-lvl-64 td:first-child{padding-left:950px}.est-row-lvl-65 td:first-child{padding-left:965px}.est-row-lvl-66 td:first-child{padding-left:980px}.est-row-lvl-67 td:first-child{padding-left:995px}.est-row-lvl-68 td:first-child{padding-left:1010px}.est-row-lvl-69 td:first-child{padding-left:1025px}.est-row-lvl-70 td:first-child{padding-left:1040px}.est-row-lvl-71 td:first-child{padding-left:1055px}.est-row-lvl-72 td:first-child{padding-left:1070px}.est-row-lvl-73 td:first-child{padding-left:1085px}.est-row-lvl-74 td:first-child{padding-left:1100px}.est-row-lvl-75 td:first-child{padding-left:1115px}.est-row-lvl-76 td:first-child{padding-left:1130px}.est-row-lvl-77 td:first-child{padding-left:1145px}.est-row-lvl-78 td:first-child{padding-left:1160px}.est-row-lvl-79 td:first-child{padding-left:1175px}.est-row-lvl-80 td:first-child{padding-left:1190px}.est-row-lvl-81 td:first-child{padding-left:1205px}.est-row-lvl-82 td:first-child{padding-left:1220px}.est-row-lvl-83 td:first-child{padding-left:1235px}.est-row-lvl-84 td:first-child{padding-left:1250px}.est-row-lvl-85 td:first-child{padding-left:1265px}.est-row-lvl-86 td:first-child{padding-left:1280px}.est-row-lvl-87 td:first-child{padding-left:1295px}.est-row-lvl-88 td:first-child{padding-left:1310px}.est-row-lvl-89 td:first-child{padding-left:1325px}.est-row-lvl-90 td:first-child{padding-left:1340px}.est-row-lvl-91 td:first-child{padding-left:1355px}.est-row-lvl-92 td:first-child{padding-left:1370px}.est-row-lvl-93 td:first-child{padding-left:1385px}.est-row-lvl-94 td:first-child{padding-left:1400px}.est-row-lvl-95 td:first-child{padding-left:1415px}.est-row-lvl-96 td:first-child{padding-left:1430px}.est-row-lvl-97 td:first-child{padding-left:1445px}.est-row-lvl-98 td:first-child{padding-left:1460px}.est-row-lvl-99 td:first-child{padding-left:1475px}.est-relative{position:relative}.est-top-pager{position:absolute;right:0;top:5px}.est-top-allselect{position:absolute;left:0;top:5px;font-weight:700}.est-padding-10{padding:10px!important}.est-margin-right-50{margin-right:50px}.est-margin-left-50{margin-left:50px}.est-quick-unpin{color:#000;margin-left:8px;font-size:14px;transform:rotate(45deg)}.est-page-sel{color:#000;margin-left:3px;margin-right:3px;padding:0 5px;font-size:inherit;border:none;border-radius:15px}.est-page-next,.est-page-prev{color:#000;font-size:inherit;padding:2px 0 0}.est-pinned-header{background-color:#fff;left:0;top:0;position:-webkit-sticky;position:sticky;z-index:1;border-bottom:1px solid #dee2e6!important;padding:0!important}.est-simple-border-bottom{border-bottom:1px solid #dee2e6}.est-pinned-internal-header{border-top:0;border-bottom:0 solid #dee2e6}.est-pinned-border{border-right:2px solid #dee2e6!important}.est-cell-padding{padding:.3rem}.est-pinned-body{background-color:#fff;left:0;position:-webkit-sticky;position:sticky;z-index:1;border-top:1px solid #dee2e6!important;padding:0!important}.est-inline{display:inline!important}.est-inline-block{display:inline-block!important}.est-link{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block}.est-link:hover{color:#23527c!important;cursor:pointer;text-decoration:underline!important}.est-sticky-last-column{right:-1px;position:-webkit-sticky;position:sticky;z-index:0;background-color:#fff}.est-sticky-last-column-alt{right:-1px;position:-webkit-sticky;position:sticky;z-index:0;background-color:#f2f2f2}.est-ltab-border{border-left:1px solid #bbb}.est-rtab-border{border-right:1px solid #bbb}.est-cell-group-padding{padding:calc(.3rem + 1px);position:absolute;top:0;left:0;height:100%;width:100%}.est-selected-cell{background-color:rgba(33,150,243,.2)}.est-margin-bottom-10{margin-bottom:10px}.est-text-center{text-align:center}.est-flex{display:flex}.est-rg-sep-flex-right{display:flex;flex-direction:row-reverse;width:100%;margin:-5px}.est-rg-sep-flex-left{display:flex;flex-direction:row;width:100%;margin:-5px}.est-rg-hdr{font-weight:700}.est-rg-agg{font-style:italic}.est-rg{background-color:hsla(0,0%,46.7%,.4666666666666667)!important}.est-rg-sep{font-size:12px;padding-right:20px!important;background-color:hsla(0,0%,73.3%,.7333333333333333)!important}.est-rg-ipp{text-align:left;display:inline-flex;margin-right:25px}.est-rg-page{text-align:right;display:inline-flex;font-size:inherit;padding-top:5px}.est-droplist.cdk-drag-placeholder{opacity:0}.est-droplist.cdk-drag-preview{z-index:999999999!important;opacity:1;box-sizing:border-box;border-radius:4px;background-color:#fff;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.est-droplist.cdk-drag-preview td:not(.drag-visible){visibility:hidden}.est-droplist.cdk-drag-preview td.drag-visible{padding-top:3px}.est-droplist.cdk-drag-animating,.est-droplist.cdk-drop-list-dragging .est-dropbox:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.est-pre{white-space:pre}.est val-datetime .mat-form-field-appearance-outline .mat-form-field-infix input{margin-bottom:3px!important;min-width:130px!important}.est .mat-form-field-flex{height:29px!important;padding:0!important}.est .mat-form-field-flex .mat-form-field-outline{color:#00f}.est .mat-form-field-flex .mat-form-field-outline .mat-form-field-outline-start{border-left:none;border-top:none;border-radius:0}.est .mat-form-field-flex .mat-form-field-outline .mat-form-field-outline-end{border-top:none;border-radius:0;border-right:none}.est .mat-form-field-wrapper{height:20px;min-height:20px!important;margin-top:0!important}.est .mat-form-field-infix{width:100%!important;min-width:50px!important}.est .mat-form-field-infix select.mat-input-element{margin-top:-5px!important}.est .mat-datepicker-input{margin-bottom:3px!important}.est input{height:20px;padding-top:0!important}']}]}],re.ctorParameters=function(){return[{type:r.NgControl,decorators:[{type:t.Self},{type:t.Optional}]},{type:s.PreferencesService,decorators:[{type:t.Optional}]},{type:R,decorators:[{type:t.Optional},{type:t.Inject,args:[O]}]},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]},{type:i.LocalizationService},{type:t.ChangeDetectorRef},{type:ie},{type:n.UtilityService},{type:n.ExportService},{type:n.DateService},{type:n.MessageService},{type:ne},{type:n.ClipboardService}]},re.propDecorators={EsTdEditorDirectives:[{type:t.ContentChildren,args:[z]}],EsTdsDirective:[{type:t.ContentChildren,args:[k]}],EsThsDirective:[{type:t.ContentChildren,args:[G]}],bodyRef:[{type:t.ContentChild,args:["body",{static:!1}]}],headerRef:[{type:t.ContentChild,args:["header",{static:!1}]}],headerGroupRef:[{type:t.ContentChild,args:["headerGroup",{static:!1}]}],secondaryHeaderGroupRef:[{type:t.ContentChild,args:["secondaryHeaderGroup",{static:!1}]}],inputField:[{type:t.ViewChild,args:["input",{static:!1}]}],CornerMenuOptions:[{type:t.Input}],ColumnsResizable:[{type:t.Input}],ColumnsPinnable:[{type:t.Input}],AutoUpdate:[{type:t.Input}],UseCustomCells:[{type:t.Input}],MaxHeight:[{type:t.Input}],ContainerClass:[{type:t.Input}],XLSXExport:[{type:t.Input}],CSVExport:[{type:t.Input}],AllSearch:[{type:t.Input}],HighCellDensity:[{type:t.Input}],Selection:[{type:t.Input}],ShowLoadingOnBootstrap:[{type:t.Input}],Removal:[{type:t.Input}],RemovalCondition:[{type:t.Input}],Export:[{type:t.Input}],ShiftClick:[{type:t.Input}],CountLabel:[{type:t.Input}],HidePaging:[{type:t.Input}],HidePagingCount:[{type:t.Input}],HidePagingButtons:[{type:t.Input}],ContextMenu:[{type:t.Input}],ExportFileName:[{type:t.Input}],TableClass:[{type:t.Input}],ExportFunction:[{type:t.Input}],HasHeaderGroup:[{type:t.Input}],HasSecondaryHeaderGroup:[{type:t.Input}],HeaderHidden:[{type:t.Input}],BodyHidden:[{type:t.Input}],SelectionDisabled:[{type:t.Input}],SingleSelection:[{type:t.Input}],RowClassAssigner:[{type:t.Input}],OrderByColumn:[{type:t.Input}],MultipleOrderingDirectives:[{type:t.Input}],HiddenColumns:[{type:t.Input}],ColumnsOrdering:[{type:t.Input}],SearchView:[{type:t.Input}],SelectAll:[{type:t.Input}],UseArrayModePaging:[{type:t.Input}],DynamicRowColumnsDefinition:[{type:t.Input}],DynamicOperations:[{type:t.Input}],Hierarchy:[{type:t.Input}],ParentKey:[{type:t.Input}],OwnKey:[{type:t.Input}],StartsExpanded:[{type:t.Input}],SavePreferences:[{type:t.Input}],PagingStyle:[{type:t.Input}],RowGroupingPagingStyle:[{type:t.Input}],ItemSourceProperty:[{type:t.Input}],UseSelectionCache:[{type:t.Input}],ShowItemGroupsColumns:[{type:t.Input}],Editable:[{type:t.Input}],RangeSelection:[{type:t.Input}],onOrderChanged:[{type:t.Output}],onSearchRequest:[{type:t.Output}],onSelectionChanged:[{type:t.Output}],onRemoval:[{type:t.Output}],onAbortRemoval:[{type:t.Output}],onModelChange:[{type:t.Output}],onCornerAction:[{type:t.Output}],onDynamicOperation:[{type:t.Output}],exportDownloader:[{type:t.ViewChild,args:["exportDownloader",{static:!1}]}],tableEmptyMenu:[{type:t.ViewChild,args:["emptyMenu",{static:!0}]}],ArraymodeItemsPerPage:[{type:t.Input}]};var se=function(){},oe=function(){function e(e,i){this.myself=e,this.renderer=i,this.orderNext={NONE:"DESC",DESC:"ASC",ASC:null},this.resizingThis=!1,this.startOffset=null,this.ID="",this.Orderable=!0,this.Display="",this.Resizable=!1,this.Pinned=!1,this.SearchInProgress=!1,this.Wrap=!1,this.Fixed=!1,this.Template=null,this.onOrderChange=new t.EventEmitter,this.onUnpinning=new t.EventEmitter,this._referenced=!1}return Object.defineProperty(e.prototype,"Visible",{get:function(){return null==this._Visible&&(this._Visible=!0),this._Visible},set:function(e){this._Visible=e,e?this.renderer.removeClass(this.myself.nativeElement,"app-display-none"):this.renderer.addClass(this.myself.nativeElement,"app-display-none")},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.Description=null===this.Display||""===this.Display?this.content.nativeElement.innerText:this.Display,this.Class=this.myself.nativeElement.className.replace("app-display-none",""),this.Resizable&&this.renderer.addClass(this.myself.nativeElement,"app-relative")},e.prototype.unpin=function(){this.onUnpinning.emit(this.ID)},e.prototype.setupNextOrderAndNotify=function(){if(this.ID){if(this.SearchInProgress)console.log("Attempt to order a column during a search. Operation ignored");else if(this.OrderBy&&this.Orderable){var e=this.orderNext[this.Order||"NONE"];this.Order=e,this.onOrderChange.emit(this.Order)}}else console.log("Attempt to order a column without ID. Operation ignored")},e.prototype.onResizeStart=function(e){this.Resizable&&(this.resizingThis=!0,this.startOffset=this.myself.nativeElement.offsetWidth-e.pageX)},e.prototype.onMouseUp=function(){this.Resizable&&(this.resizingThis=!1)},e.prototype.onMouseMove=function(e){this.Resizable&&this.resizingThis&&(this.myself.nativeElement.style.width=this.startOffset+e.pageX+"px",e.preventDefault())},e}();oe.decorators=[{type:t.Component,args:[{selector:"[es-th]",template:'<span (click)="setupNextOrderAndNotify()" [class.app-no-selection]="!!ID && Orderable" [class.app-pointer]="!!ID && Orderable">\r\n <span #content>\r\n <ng-container *ngIf="Template">\r\n <ng-container *ngTemplateOutlet="Template"></ng-container>\r\n </ng-container>\r\n <ng-content *ngIf="!Template"></ng-content>\r\n </span>&nbsp;\r\n <span class="fa" [class.fa-chevron-down]="Order == \'DESC\'" [class.fa-chevron-up]="Order == \'ASC\'"></span>\r\n</span>\r\n<span *ngIf="Pinned && !Fixed" class="app-pointer fa fa-thumb-tack est-quick-unpin" (click)="unpin()"></span>\r\n<div [hidden]="!Resizable || Fixed || Pinned" class="est-head-resizer" (mousedown)="onResizeStart($event)">\r\n <div class="est-head-resizer-internal"></div>\r\n</div>',changeDetection:t.ChangeDetectionStrategy.OnPush}]}],oe.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},oe.propDecorators={ID:[{type:t.Input,args:["es-th"]}],Order:[{type:t.Input}],Orderable:[{type:t.Input}],Display:[{type:t.Input}],Resizable:[{type:t.Input}],Pinned:[{type:t.Input}],SearchInProgress:[{type:t.Input}],OrderBy:[{type:t.Input}],Wrap:[{type:t.Input}],Fixed:[{type:t.Input}],Template:[{type:t.Input}],onOrderChange:[{type:t.Output}],onUnpinning:[{type:t.Output}],content:[{type:t.ViewChild,args:["content",{static:!1}]}],Visible:[{type:t.Input}],onMouseUp:[{type:t.HostListener,args:["window:mouseup.out-zone"]}],onMouseMove:[{type:t.HostListener,args:["window:mousemove.out-zone",["$event"]]}]};var ae=function(){function e(e,t,i){this.myself=e,this.renderer=t,this.sanitizer=i,this.ID="",this.Display=null,this.Template=null}return Object.defineProperty(e.prototype,"Visible",{get:function(){return null==this._Visible&&(this._Visible=!0),this._Visible},set:function(e){this._Visible=e,e?this.renderer.removeClass(this.myself.nativeElement,"app-display-none"):this.renderer.addClass(this.myself.nativeElement,"app-display-none")},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.Internal||(this.Content=null===this.Display||""===this.Display?this.sanitizer.bypassSecurityTrustHtml(this.myself.nativeElement.innerHTML):this.sanitizer.bypassSecurityTrustHtml(this.Display),this.Class=this.myself.nativeElement.className.replace("app-display-none",""))},e}();ae.decorators=[{type:t.Component,args:[{selector:"[es-td]",template:"<span>\r\n <ng-content></ng-content>\r\n</span>",changeDetection:t.ChangeDetectionStrategy.OnPush}]}],ae.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:d.DomSanitizer}]},ae.propDecorators={ID:[{type:t.Input,args:["es-td"]}],Internal:[{type:t.Input}],RouterLink:[{type:t.Input}],Display:[{type:t.Input}],Template:[{type:t.Input}],Context:[{type:t.Input}],Visible:[{type:t.Input}]};var le=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[ne,{provide:I,useValue:(null==t?void 0:t.locale)||"it-IT"},{provide:_,useValue:(null==t?void 0:t.debugMode)||!1},{provide:O,useValue:(null==t?void 0:t.defaults)||null}]}},e}();le.decorators=[{type:t.NgModule,args:[{imports:[l.CommonModule,r.FormsModule,c.RouterModule,i.LocalizationModule,g.ModalModule,m.BsDropdownModule,f.CsvModule,v.ContextMenuModule,h.MatSelectModule,p.MatInputModule,o.DragDropModule,u.FormsAndValidationsModule],declarations:[oe,ae,re,k,G,z,M],providers:[n.UtilityService,n.ExportService,n.HashingService,n.MessageService],exports:[re,k,G,z,M]}]}];var ce=function(){},he=function(e,t,i,n,r,s){this.id=e,this.title=t,this.iconClass=i,this.text=n,this.conditionField=r,this.conditionValue=s},pe=function(){this._selected=!1,this._rowClass=null,this._hash=null,this.properties={}},ue=function(e,t,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=""),this.value=e,this.header=t,this.header_group=i,this.exports=!1,this.export_format="",this.exports=n,this.export_format=r,this._headersHierarchy=i?i.split(">").map((function(e){return e.trim()})):[]},de=function(){},ge=function(){},me=function(){},fe=function(){};e.AppOrdering=B,e.AppSearch=H,e.CornerMenuOption=ce,e.EsTableColumnsDefinition=U,e.EsTableComponent=re,e.EsTableDefaultable=R,e.EsTableModelChange=V,e.EsTableModule=le,e.EsTableModuleConfig=se,e.EsTableMultiValue=ue,e.EsTableOperationDefinition=he,e.EsTdDirective=k,e.EsTdEditorDirective=z,e.EsThDirective=G,e.GenericItem=pe,e.Group=$,e.GroupAggregation=X,e.GroupFilter=D,e.GroupOrAggregation=J,e.ItemPropEditableReference=fe,e.ItemsSelection=E,e.ReportColumn=de,e.ReportParam=ge,e.ReportRow=me,e.TablePagerComponent=M,e.ɵa=T,e.ɵb=I,e.ɵc=_,e.ɵd=O,e.ɵe=A,e.ɵf=ie,e.ɵg=ne,e.ɵh=oe,e.ɵi=ae,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@esfaenza/localizations"),require("@esfaenza/extensions"),require("@angular/forms"),require("@esfaenza/preferences"),require("@angular/cdk/drag-drop"),require("rxjs"),require("@angular/common"),require("@angular/router"),require("@angular/material/select"),require("@angular/material/input"),require("@esfaenza/forms-and-validations"),require("@angular/platform-browser"),require("ngx-bootstrap/modal"),require("ngx-bootstrap/dropdown"),require("@ctrl/ngx-csv"),require("@esfaenza/ngx-contextmenu")):"function"==typeof define&&define.amd?define("@esfaenza/es-table",["exports","@angular/core","@esfaenza/localizations","@esfaenza/extensions","@angular/forms","@esfaenza/preferences","@angular/cdk/drag-drop","rxjs","@angular/common","@angular/router","@angular/material/select","@angular/material/input","@esfaenza/forms-and-validations","@angular/platform-browser","ngx-bootstrap/modal","ngx-bootstrap/dropdown","@ctrl/ngx-csv","@esfaenza/ngx-contextmenu"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).esfaenza=e.esfaenza||{},e.esfaenza["es-table"]={}),e.ng.core,e.localizations,e.i1,e.ng.forms,e.preferences,e.ng.cdk.dragDrop,e.rxjs,e.ng.common,e.ng.router,e.ng.material.select,e.ng.material.input,e.formsAndValidations,e.ng.platformBrowser,e.modal,e.dropdown,e.ngxCsv,e.ngxContextmenu)}(this,(function(e,t,i,n,r,s,o,a,l,c,h,p,u,d,g,m,f,v){"use strict";var y=function(e,t){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function C(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}function b(e,t){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}Object.create;function x(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function P(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e}Object.create;var I=new t.InjectionToken("EST_LOCALE"),_=new t.InjectionToken("EST_DEBUG"),O=new t.InjectionToken("EST_DEFAULTS"),T=function(e){function t(t){var i=e.call(this,null!=t?t:"it-IT")||this;return e.prototype.set.call(i,"en->it","All",["Tutto"]),e.prototype.set.call(i,"en->it","Shown Elements",["Elementi visualizzati"]),e.prototype.set.call(i,"en->it","Shown Groups",["Gruppi visualizzati"]),e.prototype.set.call(i,"en->it","Are you sure you want to retrieve all results?",["Si è sicuri di voler caricare tutti i risultati?"]),e.prototype.set.call(i,"en->it","This might slow down the page and possibly crash the entire application",["L'operazione potrebbe rallentare la pagina fino al crash dell'applicazione"]),i}return w(t,e),t}(i.LocalizationService);T.decorators=[{type:t.Injectable}],T.ctorParameters=function(){return[{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]};var M=function(){function e(e,i,n,r){this.msgExts=e,this.lc=i,this.cdr=n,this.locale=r,this.WarnOnAll=!0,this.AllSearch=!0,this.DefaultAll=999999,this.GroupMode=!1,this.GroupCount=!1,this.CountLabel=null,this.ShowCount=!0,this.ShowPaging=!0,this.pagingSelected=new t.EventEmitter,this.PagingOptions=[10,15,30,45,100]}return e.prototype.ngOnInit=function(){this.Model=this.View?this.View.itemsperpageoverride||15:this.CurrentPageSize,this.AllSearch&&this.PagingOptions.push(this.DefaultAll)},e.prototype.ngOnChanges=function(e){var t=e.View,i=e.CurrentPageSize;(t&&!t.firstChange||i&&!i.firstChange)&&(this.Model=(null==t?void 0:t.currentValue)?t.currentValue.itemsperpageoverride||15:(null==i?void 0:i.currentValue)?i.currentValue:null)},e.prototype.choice=function(e){var t=this;e==this.DefaultAll&&this.WarnOnAll?this.msgExts.simpleWarningWithChoice(this.lc.loc("Are you sure you want to retrieve all results?"),this.lc.loc("This might slow down the page and possibly crash the entire application"),(function(){t.pagingSelected.emit(e),t.Model=e}),(function(){var e=t.Model;t.Model=null,t.cdr.detectChanges(),t.Model=e,t.cdr.detectChanges()})):(this.pagingSelected.emit(e),this.Model=e)},e}();M.decorators=[{type:t.Component,args:[{selector:"app-paging",viewProviders:[{provide:i.LocalizationService,useClass:T}],template:'<ng-container *ngIf="!Hidden">\r\n <span class="est-fs-14"> {{CountLabel && !GroupMode ? CountLabel : ((GroupMode ? \'Shown Groups\' : \'Shown Elements\') | localize : lc)}}:&nbsp;</span>\r\n <ng-container *ngIf="ShowPaging && Model && (Model == DefaultAll || PagerCount >= Model || PagerCount == -1)">\r\n <mat-form-field [appearance]="\'legacy\'" class="mat-paginator-page-size-select est-fs-14 est-ipp-bold">\r\n <select matNativeControl [ngModel]="Model" name="input" (ngModelChange)="choice($event)">\r\n <ng-container *ngFor="let pOpt of PagingOptions; let i = index">\r\n <option *ngIf="pOpt == DefaultAll || PagerCount >= pOpt || PagerCount == -1 || (i > 0 && PagerCount >= PagingOptions[i-1])" [value]="pOpt">{{ pOpt == DefaultAll ? (\'All\' | localize : lc) : pOpt.toString()}}</option>\r\n </ng-container>\r\n </select>\r\n </mat-form-field>\r\n <span class="est-fs-14 est-ipp-bold" *ngIf="ShowCount && PagerCount != -1">&nbsp;/&nbsp;</span>\r\n </ng-container>\r\n <span class="est-fs-14 est-ipp-bold" *ngIf="ShowCount && PagerCount != -1">{{PagerCount | number : \'0.0-0\' : locale}}</span>\r\n</ng-container>',encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[".est-ipp-sel,.est-ipp-sel-all,.est-rg-ipp-sel,.est-rg-ipp-sel-all{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-ipp-bold{font-weight:700}.mat-paginator-page-size-select{margin:6px 4px 0;width:50px}.mat-paginator-page-size-select .mat-form-field-wrapper{height:52px!important;margin-top:-15px!important;padding:0!important}.mat-form-field-type-mat-native-select .mat-form-field-infix:after{margin-top:-5.5px!important}"]}]}],M.ctorParameters=function(){return[{type:n.MessageService},{type:i.LocalizationService},{type:t.ChangeDetectorRef},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]},M.propDecorators={CurrentPageSize:[{type:t.Input}],View:[{type:t.Input}],WarnOnAll:[{type:t.Input}],AllSearch:[{type:t.Input}],DefaultAll:[{type:t.Input}],GroupMode:[{type:t.Input}],GroupCount:[{type:t.Input}],CountLabel:[{type:t.Input}],ShowCount:[{type:t.Input}],ShowPaging:[{type:t.Input}],PagerCount:[{type:t.Input}],Hidden:[{type:t.Input}],pagingSelected:[{type:t.Output}]};var H=function(){function e(){this.itemsperpageoverride=15,this.items=[],this.orders=[],this.columns=[],this.column_ordering=[],this.savedstate=!1,this.searchinprogress=!1,this.firstsearch=!0}return e.reset=function(e){e.pages=1,e.objectcount=0,e.searchinprogress=!1,e.firstsearch=!1,e.page=1,e.itemsperpageoverride=15,e.items=[],e.orders=[],e.columns=[],e.column_ordering=[],e.savedstate=!1},e}(),V=function(e){this.all=!1,this.exclusions=[],this.group_exclusions=[],this.count=e.length,this.items=e,this.all=!1,this.exclusions=[],this.groups=[],this.group_exclusions=[]},E=function(e,t){this.column=e,this.value=t},D=function(e,t,i,n,r){this.item=e,this.header=t,this.property=i,this.old_value=n,this.new_value=r},R=function(){},k=function(e){this.Template=e,this._directive=!0,this._multi=!1,this.tdVisible=!0,this.tdIf=!0};k.decorators=[{type:t.Directive,args:[{selector:"[td]"}]}],k.ctorParameters=function(){return[{type:t.TemplateRef}]},k.propDecorators={tdVisible:[{type:t.Input}],td:[{type:t.Input}],tdForProperty:[{type:t.Input}],tdIf:[{type:t.Input}],tdClass:[{type:t.Input}],tdPropertyAccessor:[{type:t.Input}]};var G=function(e){this.Template=e,this._thAggregations=null,this._thParents=null,this._directive=!0,this._referenced=!1,this._multi=!1,this._multi_content="",this.th="",this.thPinned=!1,this.thPinnable=!0,this.thPinnedWidth=150,this.thVisible=!0,this.thFixed=!1,this.thParent="",this.thOrderable=!0,this.thWrap=!1,this.thResizable=!1,this.thIf=!0,this.thEmpty=!1,this.thGroup=!1,this.thAggregation=null,this.thProperty=null,this.thType=null,this.thSource=null};G.decorators=[{type:t.Directive,args:[{selector:"[th]"}]}],G.ctorParameters=function(){return[{type:t.TemplateRef}]},G.propDecorators={th:[{type:t.Input}],thPinned:[{type:t.Input}],thPinnable:[{type:t.Input}],thPinnedWidth:[{type:t.Input}],thVisible:[{type:t.Input}],thFixed:[{type:t.Input}],thParent:[{type:t.Input}],thOrder:[{type:t.Input}],thOrderable:[{type:t.Input}],thWrap:[{type:t.Input}],thResizable:[{type:t.Input}],thClass:[{type:t.Input}],thGroupClass:[{type:t.Input}],thIf:[{type:t.Input}],thEmpty:[{type:t.Input}],thGroup:[{type:t.Input}],thAggregation:[{type:t.Input}],thProperty:[{type:t.Input}],thType:[{type:t.Input}],thSource:[{type:t.Input}],thMulti:[{type:t.Input}],thStaticContent:[{type:t.Input}],thBackgroundColor:[{type:t.Input}]};var z=function(e){this.Template=e};z.decorators=[{type:t.Directive,args:[{selector:"[editor]"}]}],z.ctorParameters=function(){return[{type:t.TemplateRef}]},z.propDecorators={editor:[{type:t.Input}],editorForProperty:[{type:t.Input}]};var A=function(e){function t(t){var i=e.call(this,null!=t?t:"it-IT")||this;return e.prototype.set.call(i,"en->it","All the",["Tutti gli"]),e.prototype.set.call(i,"en->it","All",["Tutto"]),e.prototype.set.call(i,"en->it","Groups",["Gruppi"]),e.prototype.set.call(i,"en->it","Cannot export an empty dataset",["Impossibile esportare un dataset vuoto"]),e.prototype.set.call(i,"en->it","Performing Table bootstrap",["Sto caricando la Tabella"]),e.prototype.set.call(i,"en->it","Update every",["Aggiorna ogni"]),e.prototype.set.call(i,"en->it","second/s",["secondo/i"]),e.prototype.set.call(i,"en->it","Export View",["Esporta Vista"]),e.prototype.set.call(i,"en->it","Column Name",["Nome Colonna"]),e.prototype.set.call(i,"en->it","Columns Order",["Ordine Colonne"]),e.prototype.set.call(i,"en->it","Columns Visibility",["Visibilità Colonne"]),e.prototype.set.call(i,"en->it","There are no columns configured to be hidden/shown in this view",["Non ci sono colonne configurate per essere visualizzate/nascoste in questa vista dati"]),e.prototype.set.call(i,"en->it","Columns Visibility and Order",["Visibilità e Ordine Colonne"]),e.prototype.set.call(i,"en->it","Objects Selected",["Oggetti Selezionati"]),e.prototype.set.call(i,"en->it","Object Selected",["Oggetto Selezionato"]),e.prototype.set.call(i,"en->it","Select Everything",["Seleziona Tutto"]),e.prototype.set.call(i,"en->it","Reset Selection",["Resetta Selezione"]),e.prototype.set.call(i,"en->it","No operations available",["Nessuna operazione disponibile"]),e.prototype.set.call(i,"en->it","Values copied in the clipboard",["Valori copiati nella clipboard"]),e.prototype.set.call(i,"en->it","Size of copied data is different from the size of the selection",["La dimensione dei dati copiati differisce dalla dimensione della selezione"]),e.prototype.set.call(i,"en->it","Data for this table cannot be edited",["I dati di questa tabella non possono essere modificati"]),i}return w(t,e),t}(i.LocalizationService);A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]};var L=function(){function e(e,t,i,n,r){this.est=e,this.expExts=t,this.msgExts=i,this.utiExts=n,this.dateExts=r}return e.prototype.tryExport=function(e){var t=this;this.est.ExportFunction&&this.est.ExportFunction((function(i,n){return void 0===n&&(n=!1),C(t,void 0,void 0,(function(){var t,r=this;return b(this,(function(s){switch(s.label){case 0:return n?[2]:0==i.length?(this.msgExts.simpleWarning(this.est.lc.loc("Cannot export an empty dataset")),[2]):(this.setupExport(i),"CSV"!=e?[3,1]:(this.est.cdr.detectChanges(),setTimeout((function(){r.est.exportDownloader.nativeElement.click()})),[3,7]));case 1:if("XLSX"!=e)return[3,6];if(null!=this.ExcelJS)return this.exportExcel(),[2];s.label=2;case 2:return s.trys.push([2,4,,5]),t=this,[4,import("exceljs")];case 3:return t.ExcelJS=s.sent(),this.exportExcel(),[3,5];case 4:throw s.sent(),"Impossibile caricare la libreria per l'esportazione in Excel";case 5:return[3,7];case 6:throw"Formato di esportazione non riconosciuto";case 7:return[2]}}))}))}),e)},e.prototype.exportExcel=function(){return C(this,void 0,void 0,(function(){var e,t,i,n,r,s,o,a,l,c,h,p,u,d;return b(this,(function(g){switch(g.label){case 0:for(1,(e=new this.ExcelJS.Workbook).creator="Ema's big Es-Table",e.created=new Date,t=e.addWorksheet("Data"),(i=t.getRow(1)).font={bold:!0},this.est.headers=this.est.headers.sort((function(e,t){return e.order-t.order})),n=0;n<this.est.headers.length;n++)a=this.est.headers[n],i.getCell(n+1).value=a.label;for(n=0;n<this.est.data.length;n++)for(r=t.getRow(n+1+1),s=this.est.data[n],o=0;o<this.est.headers.length;o++)if(a=this.est.headers[o],l=r.getCell(o+1),null==(c=s[a.key])||null==c)l.value="";else switch(a.type){case"date":l.value=this.dateExts.getDateConvertion(c).toDate();case"number":l.value=parseFloat(c.replace(",","."));default:l.value=c}return[4,e.xlsx.writeBuffer()];case 1:return h=g.sent(),p=new Blob([h],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"}),u=window.URL.createObjectURL(p),d=this.est.ExportFileName,this.utiExts.fileDownload(u,d.endsWith(".csv")?d.replace(".csv",".xlsx"):d.endsWith(".xlsx")?d:d+".xlsx"),[2]}}))}))},e.prototype.setupExport=function(e){var t=this.est.DynamicRowColumnsDefinition;this.est.headers=t&&t.length>0?this.expExts.setupForGenericExport(e,t.map((function(e){return{label:e.Description,key:e.PropertyName,order:e.ColumnOrder,type:"string"}}))):this.expExts.setupForExport(e),this.est.data=e},e}(),B=function(e,t){this.id=e,this.order=t},F=function(e,t,i,n,r,s,o,a,l,c,h){this.id=e,this.description=t,this.visible=i,this.fixed=n,this.pinned=r,this.pinnable=s,this.pinnedWidth=o,this.template=a,this.parentTemplates=l,this.multi=c,this.multiContent=h},N=function(){function e(e,t,i,n,r){this.est=e,this.utilities=t,this.utiExts=i,this.prefService=n,this.rgH=r}return e.prototype.handleTHOrderChange=function(e,t){var i=this.est.viewMode?this.est.View.orders:this.est.arrayOrders,n=!0,r=null;!i&&this.est.viewMode?this.est.View.orders=[]:!i&&this.est.arrayMode&&(this.est.arrayOrders=[]);for(var s=0;s<i.length;s++){var o=i[s];o.id==e&&(t?(o.order=t,n=!1):r=s)}if(null!=r?i.splice(r,1):n&&(this.est.MultipleOrderingDirectives?i.push(new B(e,t)):this.est.viewMode?this.est.View.orders=[new B(e,t)]:this.est.arrayMode&&(this.est.arrayOrders=[new B(e,t)])),this.est.SavePreferences){var a=this.est.viewMode?this.est.MainGroupView||this.est.View:null;this.registerViewPreferences(a)}this.est.onOrderChanged.emit({id:e,order:t}),this.est.viewMode?this.est.groupSearchRequestsCache.length>0?this.rgH.emitRowGroupingSearches(e,i):this.est.emitSearchRequest(!1):this.est.arrayMode&&this.est.internalWriteValue()},e.prototype.registerViewPreferences=function(e){if(!this.est.ngControl.name)return console.error("Non posso utilizzare le preference senza avere un 'name' per la tabella"),!1;if(!this.prefService)return console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato"),!1;var t=this.est.arrayMode?this.est.arrayColumns:e.columns,i=this.est.arrayMode?this.est.arrayColumnOrdering:e.column_ordering,n=this.est.arrayMode?[]:e.orders,r={columns:JSON.parse(JSON.stringify(t)),column_ordering:JSON.parse(JSON.stringify(i)),orders:JSON.parse(JSON.stringify(n))};this.prefService.setItem(this.est.ngControl.name,r,"preference").subscribe()},e.prototype.reviewColumnsList=function(e){var t=this;if(this.est.TMPColumnsList=[],0!=e.length){for(var i=function(t){var i=e[t],r=i.th;if(!r)return"continue";if((n.est.HiddenColumns||i.thVisible)&&i.thIf){var s=n.est.ColumnsList&&0!=n.est.ColumnsList.length&&n.est.ColumnsList.find((function(e){return e.id==r}))||null,o=new F(r,i.thStaticContent,i.thVisible,i.thFixed||i.thGroup,null==s?i.thPinned:s.pinned,i.thPinnable,i.thPinnedWidth,i.Template,i._thParents,i._multi,i._multi_content);s&&(o.prev_index=s.prev_index),n.est.TMPColumnsList.push(o)}},n=this,r=0;r<e.length;r++)i(r);this.est.ColumnsList=[],this.est.TMPColumnsList.forEach((function(e){t.est.ColumnsList.push(Object.assign({},e))}))}},e.prototype.expandMultiThsAndTds=function(e,t,i){for(var n={},r=0;r<e.length;r++){(_=e[r]).thMulti&&(n[_.th]={On:_.th,tdref:null,thref:_,thgen:{},tdgen:{}})}for(r=0;r<t.length;r++){(O=t[r])._multi=!!n[O.td],O._multi&&(n[O.td].tdref=O)}e=e.filter((function(e){return!e.thMulti})),t=t.filter((function(e){return!e._multi}));var s={},o={},a={},l=[];for(r=0;r<i.length;r++){var c=i[r];for(var h in n)if(c[h]&&c[h].length)for(var p=n[h],u=p.tdref,d=p.thref,g=0;g<c[h].length;g++){var m=c[h][g];m._headersHierarchy||(m._headersHierarchy=m.header_group?m.header_group.split(">").map((function(e){return e.trim()})):[]);var f=m.header,v=m.header_group||null,y=m._headersHierarchy;if(!o[v+"_"+f]){o[v+"_"+f]=!0;var w=new G(d.Template);w._multi=!0,w._multi_content=f,w.th=h+"_"+g,w.thClass=d.thClass,w.thIf=d.thIf,w.thVisible=d.thVisible,w.thWrap=d.thWrap,w.thParent=y[y.length-1],w.thOrderable=!1;for(var C=0;C<y.length;C++){var b=y[C];if(!s[b]){s[b]=!0;var x=new G(null);x.th=b,x._multi_content=b,x.thParent=C>0?y[C-1]:null,l.push(x)}}l.push(w);var S=new k(u.Template);S._multi=!0,S.td=h+"_"+g,S.tdClass=u.tdClass,S.tdIf=u.tdIf,S.tdVisible=u.tdVisible,a[S.td]=S}}}var I=[];for(r=0;r<l.length;r++)l[r].thParent||I.push(l[r]);for(var h in s)for(r=0;r<l.length;r++){var _;(_=l[r]).thParent&&_.thParent==h&&I.push(_)}e=P(e,l);for(r=0;r<l.length;r++){var O;(O=a[l[r].th])&&t.push(O)}return{expTds:t,expThs:e}},e.prototype.moveFixedColumnsAtTheBeginning=function(e,t){for(var i={},n=0,r=0,s={},o={},a=0;a<this.est.ColumnsList.length;a++){var l=this.est.ColumnsList[a];s[l.id]=l,l.pinned&&(a!=r&&this.utilities.arrayMove(this.est.ColumnsList,a,r),r++),l.fixed&&!l.pinned&&(a!=r+n&&this.utilities.arrayMove(e,a,r+n),n++)}r=n=0;for(var c=0;c<e.length;c++){var h=e[c];i[h.th]=h,h.thPinned=!s[h.th]&&h.thPinned||s[h.th]&&s[h.th].pinned,h.thPinned&&(c!=r&&this.utilities.arrayMove(e,c,r),r++),!h.thFixed&&!h.thGroup||h.thPinned||(c!=r+n&&this.utilities.arrayMove(e,c,r+n),n++)}for(c=0;c<e.length;c++)o[e[c].th]=c;var p=new Array(e.length);for(c=0;c<t.length;c++){var u=t[c];p[o[u.td]]=u}this.est.HasPinnedColumns=r>0},e.prototype.evaluatePinnedColumnsWidth=function(){if(this.est.HasPinnedColumns){this.est.PinnedContainerWidth=0;for(var e=0;e<this.est.ColumnsList.length;e++){var t=this.est.ColumnsList[e];t.pinned&&t.visible&&(this.est.PinnedContainerWidth+=t.pinnedWidth)}this.est.PinnedContainerWidth+=this.est.Selection?25:0}},e.prototype.alignColumnsIfLoadedView=function(e){var t=this,i=this.est.viewMode&&e.savedstate,n=[];if(this.est.ColumnsList&&0!=this.est.ColumnsList.length){var r=this.est.viewMode?e.columns:this.est.arrayColumns;if(this.est.ColumnsList.forEach((function(e){var t=r.filter((function(t){return(t.startsWith("§")?t.substring(1):t)==e.id}));1==t.length&&(e.pinned=t[0].startsWith("§")),e.visible&&0==r.length?n.push(e.id):1!=t.length||e.visible?0==t.length&&e.visible&&(e.visible=!1):e.visible=!0})),0==r.length&&(this.est.viewMode?e.columns=n:this.est.arrayColumns=n),this.est.viewMode&&e.savedstate&&this.est.ColumnsOrdering&&e.column_ordering.length>0){var s=[];e.column_ordering.forEach((function(e){t.est.ColumnsList.forEach((function(t){t.id==e&&s.push(t)}))})),this.est.ColumnsList.forEach((function(e){s.find((function(t){return t==e.id}))||s.push(e)})),this.est.ColumnsList=s}this.est.viewMode&&(e.savedstate=!1),i&&this.est.changed()}},e.prototype.refreshColumnsVisibility=function(e,t,i){for(var n=[],r={},s={},o=0;o<this.est.ColumnsList.length;o++){var a=this.est.ColumnsList[o];s[a.id]=a,a.visible&&n.push((a.pinned?"§":"")+a.id)}if(i?i.columns=n:this.est.arrayColumns=n,e)for(var l=0;l<e.length;l++){var c=e[l];c.thVisible=c.thFixed||(s[c.th]?s[c.th].visible:c.thVisible),(c.thFixed||c.thGroup)&&(r[c.th]=!0)}if(t)for(l=0;l<t.length;l++){var h=t[l];h.tdVisible=r[h.td]||(s[h.td]?s[h.td].visible:h.tdVisible)}this.est.changed()},e.prototype.alignHeadersOrdering=function(e,t){for(var i=t?t.orders:this.est.arrayOrders,n=0;n<e.length;n++){var r=e[n];r.thOrder=null;for(var s=0;s<i.length;s++){var o=i[s];o.id==r.th&&(r.thOrder=o.order)}}},e.prototype.evaluateHeadersGroupingInfos=function(e){for(var t={},i={},n=0;n<e.length;n++){i[(o=e[n]).th]=o,o.thParent&&!t[o.thParent]&&(t[o.thParent]=!0)}var r=0,s=[];for(n=0;n<e.length;n++){var o;if(!t[(o=e[n]).th]){s.push(o);var a=this.jumpsToFinalParent(o,i);r=a>r?a:r}}return{leafs:s,groupingLevel:r,parentsCache:t,thsCache:i}},e.prototype.evaluateHeaderGroups=function(e){if(0!=e.groupingLevel){for(var t=[],i=e.leafs.filter((function(e){return e.thVisible&&!e.thPinned})),n=0;n<e.groupingLevel;n++){t.push([]);for(var r=0;r<i.length;r++)t[n].push("")}var s=[];for(r=0;r<this.est.OrderDirectives.length;r++){var o=e.thsCache[this.est.OrderDirectives[r]];o.thVisible&&!o.thPinned&&s.push(o)}var a="";for(r=0;r<s.length;r++){var l=s[r],c=r-1>=0?s[r-1]:null;l._lbord=l.thParent!=a,l._rbord=i.length==r+1,c&&(c._rbord=l.thParent!=a),a=l.thParent;for(n=0;n<e.groupingLevel;n++){var h=l.thParent;h&&!l.thPinned&&(t[n][r]=h,l=e.thsCache[h])}}a="";var p=0;this.est.TMPRowThGroups=[];for(n=0;n<t.length;n++){var u=[];this.est.TMPRowThGroups.push(u),(this.est.Selection||this.est.HasPinnedColumns)&&u.push({Span:1,Template:null,Pinned:this.est.HasPinnedColumns});for(var d=0;d<t[n].length;d++){var g=t[n][d];g==a?p++:(p>0&&u.push({Span:p,Template:a?e.thsCache[a].Template:null,Content:a?e.thsCache[a]._multi_content:null,Borders:!!a}),p=1,a=g)}u.push({Span:p,Template:a?e.thsCache[a].Template:null,Content:a?e.thsCache[a]._multi_content:null,Borders:!!a}),this.est.Removal&&u.push({Span:1,Template:null}),(this.est.Export||this.est.HiddenColumns||this.est.ColumnsOrdering||this.est.CornerMenuOptions)&&u.push({Span:1,Template:null}),p=0,a=""}}},e.prototype.jumpsToFinalParent=function(e,t){var i=0,n=null,r=[],s=e;do{(n=e.thParent)&&((e=t[n]).thEmpty||e._multi_content?!e.thEmpty&&e._multi_content&&r.unshift({content:e._multi_content}):r.unshift({tmpl:e.Template}),i++)}while(n);return s._thParents=r,i},e.prototype.generateDefaultOrder=function(e,t){if(0!=e.length){var i=this.est.viewMode?t.column_ordering:this.est.arrayColumnOrdering;if(i&&0!=i.length){this.est.OrderDirectives=i;var n=function(t){var i=e[t].th;r.est.OrderDirectives.find((function(e){return e==i}))||r.est.OrderDirectives.push(i)},r=this;for(s=0;s<e.length;s++)n(s)}else for(var s=0;s<e.length;s++){var o=e[s].th;this.est.OrderDirectives.push(o)}}},e.prototype.applyOrdering=function(e,t){var i=this,n=[];if(t){this.est.OrderDirectives.forEach((function(e){var t=i.est.TMPRowTHs.filter((function(t){return t.ID==e}))[0];t&&n.push(t)})),this.est.TMPRowTHs=n;for(var r=function(e){var t=s.est.TMPRowTDs[s.est.RowContexts[e]],i=[];s.est.OrderDirectives.forEach((function(e){var n=t.filter((function(t){return t.ID==e}))[0];i.push(n)})),s.est.TMPRowTDs[s.est.RowContexts[e]]=i},s=this,o=0;o<this.est.RowContexts.length;o++)r(o)}this.est.viewMode?e.column_ordering=this.est.OrderDirectives:this.est.arrayColumnOrdering=this.est.OrderDirectives,this.est.changed()},e.prototype.sendUp=function(e){var t=this.est.TMPColumnsList.indexOf(e);if(!this.est.TMPColumnsList[t-1].fixed&&!this.est.TMPColumnsList[t-1].pinned){this.utiExts.swap(this.est.TMPColumnsList,t,t-1);var i=[];this.est.TMPColumnsList.forEach((function(e){i.push(Object.assign({},e))})),this.est.TMPColumnsList=i}},e.prototype.sendDown=function(e){var t=this.est.TMPColumnsList.indexOf(e);this.utiExts.swap(this.est.TMPColumnsList,t,t+1);var i=[];this.est.TMPColumnsList.forEach((function(e){i.push(Object.assign({},e))})),this.est.TMPColumnsList=i},e.prototype.pinOrUnpinColumn=function(e){var t=this.est.TMPColumnsList.indexOf(e);if(e.pinned){if(null!=e.prev_index&&null!=e.prev_index)this.utilities.arrayMove(this.est.TMPColumnsList,t,e.prev_index);else for(i=0;i<this.est.TMPColumnsList.length;i++)if(!this.est.TMPColumnsList[i].pinned&&!this.est.TMPColumnsList[i].fixed){this.utilities.arrayMove(this.est.TMPColumnsList,t,i-1);break}}else{e.prev_index=t;for(var i=0;i<this.est.TMPColumnsList.length;i++)if(!this.est.TMPColumnsList[i].pinned){this.utilities.arrayMove(this.est.TMPColumnsList,t,i);break}}e.pinned=!e.pinned},e.prototype.columnClicked=function(e){this.est.lastSelectedItemID=e.id,this.est.HiddenColumns&&!e.fixed&&(e.visible=!e.visible,this.updateGlobalColVisCheck())},e.prototype.resetColumnVisSelection=function(){var e=this;this.est.TMPColumnsList=[],this.est.TMPColumnsList=[],this.est.ColumnsList.forEach((function(t){e.est.TMPColumnsList.push(Object.assign({},t))}));var t=[];this.est.ColumnsOrdering&&(this.est.OrderDirectives.forEach((function(i){var n=e.est.TMPColumnsList.filter((function(e){return e.id==i}))[0];n&&t.push(n)})),this.est.TMPColumnsList=t),this.updateGlobalColVisCheck()},e.prototype.refreshColumnOrdering=function(){this.est.OrderDirectives=[];for(var e=0;e<this.est.ColumnsList.length;e++)this.est.OrderDirectives.push(this.est.ColumnsList[e].id)},e.prototype.updateGlobalColVisCheck=function(){this.est.globalColVisCheck=this.est.TMPColumnsList.every((function(e){return e.visible}))},e.prototype.columnReordered=function(e){o.moveItemInArray(e.container.data,e.previousIndex,e.currentIndex)},e.prototype.sortPredicate=function(e,t){var i=this.est.ColumnsList[e];return!(i.fixed||i.pinned||t.data.pinned||t.data.pinned)},e.prototype.confirmColumnVisibilitySelection=function(){var e=this;if(this.est.TMPColumnsList.every((function(e){return!e.visible})))return!1;var t=this.est.viewMode?this.est.MainGroupView||this.est.View:null;return this.est.ColumnsList=[],this.est.TMPColumnsList.forEach((function(t){e.est.ColumnsList.push(Object.assign({},t))})),this.refreshColumnOrdering(),this.applyOrdering(t,!1),this.refreshColumnsVisibility(null,null,t),this.est.SavePreferences&&this.registerViewPreferences(t),this.est.viewMode?setTimeout((function(){if(e.est.MainGroupView)for(var t=0;t<e.est.groupSearchRequestsCache.length;t++){var i=e.est.groupSearchRequestsCache[t].view;i.columns=e.est.MainGroupView.columns,i.column_ordering=e.est.MainGroupView.column_ordering,e.est.emitSearchRequest(!0,e.est.groupSearchRequestsCache[t].view)}else e.est.emitSearchRequest(!0)})):this.est.arrayMode&&setTimeout((function(){e.est.internalWriteValue()})),this.est.lastSelectedItemID=null,!0},e.prototype.unpinColumn=function(e){this.resetColumnVisSelection(),this.pinOrUnpinColumn(this.est.TMPColumnsList.find((function(t){return t.id==e}))),this.confirmColumnVisibilitySelection()},e.prototype.globalColVisCheckChanged=function(){var e=this;this.est.TMPColumnsList.forEach((function(t){t.fixed||(t.visible=e.est.globalColVisCheck)}))},e}(),U=function(e,t,i,n,r,s,o,a,l,c,h,p,u,d){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=!0),void 0===a&&(a=null),void 0===l&&(l=!0),void 0===c&&(c=!1),void 0===h&&(h=null),void 0===p&&(p=[]),void 0===u&&(u=""),void 0===d&&(d=""),this.Description=e,this.PropertyName=t,this.RoutePath=i,this.RouteParameterProperties=n,this.DataOrder=r,this.ColumnOrder=s,this.Visible=o,this.Clss=a,this.Orderable=l,this.HeaderWraps=c,this.PropertyType=h,this.PropertySource=p,this.EditorName=u,this.RendererName=d},W=function(){function e(e){this.est=e}return e.prototype.generateRouterLink=function(e,t,i){if(this.est.DynamicTableRouterLinkCache[i._hash+e])return this.est.DynamicTableRouterLinkCache[i._hash+e];var n=this.getRouterLink(e,t,i);return this.est.DynamicTableRouterLinkCache[i._hash+e]=n,n},e.prototype.getRouterLink=function(e,t,i){for(var n=0;n<t.length;n++)e=e.replace("{"+n+"}",i.properties[t[n]]);return e=e.replace(/'/g,'"').replace(/ /g,""),JSON.parse(e)},e.prototype.eventuallyReviewDynamicColumns=function(){if(this.est.TMPBoundSource&&0!=this.est.TMPBoundSource.length&&(!!this.est.TMPBoundSource[0].properties&&!(!this.est.FirstBind&&this.est.DynamicRowColumnsDefinition&&this.est.DynamicRowColumnsDefinition.length>0)))if(this.est.DynamicRowColumnsDefinition&&0!=this.est.DynamicRowColumnsDefinition.length)this.est.UserDefinedDynamicCols=!0;else{var e=this.est.TMPBoundSource[0].properties;for(var t in this.est.DynamicRowColumnsDefinition=[],e)this.est.DynamicRowColumnsDefinition.push(new U(t,t));this.est.UserDefinedDynamicCols=!1}},e}(),j=function(){function e(e){this.est=e}return e.prototype.assignHierarchyLevels=function(e){if(e&&e.length)if(this.est.ParentKey||this.est.OwnKey||(void 0!==e[0].parentid&&(this.est.ParentKey="parentid"),void 0!==e[0].id&&(this.est.OwnKey="id")),this.est.ParentKey&&this.est.OwnKey){var t=1,i=0;do{i=this.assignLevel(e,t),t++}while(i>0)}else console.error("Per utilizzare il sistema in modalità gerarchica è obbligatorio specificare sia ParentKey che OwnKey. Fallback a sistema non gerarchico")},e.prototype.assignLevel=function(e,t){for(var i=0,n=0;n<e.length;n++){var r=e[n];if(r[this.est.ParentKey]||1!=t){if(r[this.est.ParentKey]&&t>1)for(var s=0;s<e.length;s++){var o=e[s];if(o[this.est.OwnKey]==r[this.est.ParentKey]&&o._level==t-1){r._level=t,o._expanded=this.est.StartsExpanded,o.parent=!0,r._visible=this.est.StartsExpanded,i++;break}}}else r._level=1,r._visible=!0,r._expanded=this.est.StartsExpanded,i++}return i},e.prototype.expandParent=function(e){for(var t=0;t<this.est.boundSource.length;t++){var i=this.est.boundSource[t];if(i[this.est.OwnKey]==e){i._expanded=!0;for(var n=0;n<this.est.boundSource.length;n++){var r=this.est.boundSource[n];r[this.est.ParentKey]==e&&(r._visible=!0)}return}}},e.prototype.collapseParent=function(e){for(var t=0;t<this.est.boundSource.length;t++){var i=this.est.boundSource[t];if(i[this.est.OwnKey]==e)return i._expanded=!1,void this.collapseChildOfParent(e)}},e.prototype.collapseChildOfParent=function(e){for(var t=0;t<this.est.boundSource.length;t++){var i=this.est.boundSource[t];i[this.est.ParentKey]!=e||i.parent?i[this.est.ParentKey]==e&&i.parent&&(i._expanded=!1,i._visible=!1,this.collapseChildOfParent(i[this.est.OwnKey])):i._visible=!1}},e}(),q=function(){function e(e,t){this.est=e,this.utilities=t}return e.prototype.getItemsByMode=function(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1);var n=[];return this.est.viewMode&&this.est.View instanceof H?n=this.getViewItemsBySource():this.est.arrayMode&&(this.est.View.forEach((function(e){e._item=!0})),this.est.UseArrayModePaging&&!i?(this.est.SearchView?(this.est.ArraymodeItemsPerPage=this.est.SearchView.itemsperpageoverride,this.est.arraymodePage=this.est.SearchView.page,this.est.arraymodePages=this.est.SearchView.pages):t&&this.refreshPaging(this.est.ArraymodeItemsPerPage),n=this.adaptViewToPaging()):n=this.est.View),e?n.filter((function(e){return e._selected})):n},e.prototype.refreshPaging=function(e){this.est.ArraymodeItemsPerPage=e,this.est.arraymodePages=Math.ceil(this.est.View.length/this.est.ArraymodeItemsPerPage),this.est.arraymodePage=1,this.est.internalWriteValue()},e.prototype.getViewItemsBySource=function(){var e,t,i,n=this,r=this.est.View,s=r.groupings?r.groupings.filter((function(e){return!e.aggregation})).length:0;return((null===(e=r.requestedgroups)||void 0===e?void 0:e.length)!=s||0==(null===(t=r.requestedgroups)||void 0===t?void 0:t.length))&&s>0?((i=r.groups).forEach((function(e){e._group=!0,n.utilities.cacheAggregations(e)})),i):((i=this.est.ItemSourceProperty?this.est.View[this.est.ItemSourceProperty]:this.est.View.items)||(i=[]),i.forEach((function(e){e._item=!0})),i)},e.prototype.adaptViewToPaging=function(){var e=[];if(this.est.SearchView)return this.est.View;this.est.arrayPulsanti=this.utilities.getPagesArray(6,this.est.arraymodePage,this.est.arraymodePages);for(var t=(this.est.arraymodePage-1)*this.est.ArraymodeItemsPerPage;t<this.est.arraymodePage*this.est.ArraymodeItemsPerPage;t++)t<=this.est.View.length-1&&e.push(this.est.View[t]);return e},e.prototype.arrayModeReviewOrderings=function(){var e=this;this.est.arrayOrders.length>0&&this.est.arrayOrders.forEach((function(t){e.est.boundSource=e.est.boundSource.sort((function(e,i){return(e[t.id]>i[t.id]?1:-1)*("DESC"==t.order?-1:1)}))}))},e}(),K=function(){function e(e,t){this.est=e,this.utilities=t}return e.prototype.reviewReportBindings=function(){var e=this;this.est.View.orders&&this.est.View.orders.length>0&&this.est.View.orders.forEach((function(t){e.est.View.report_columns.filter((function(e){return e.id==t.column}))[0].order=t.order}));var t=this.est.View.objectcount;-2!=t?this.est.previousCount=t:-2==t&&(t=this.est.previousCount);var i=this.est.View.itemsperpageoverride||15;this.est.View.pages=Math.ceil(t/i),this.est.arrayPulsanti=this.utilities.getPagesArray(6,this.est.View.page,this.est.View.pages)},e.prototype.generateThsAndTdsFromView=function(e){for(var t={ths:[],tds:[]},i=0;i<e.report_columns.length;i++){var n=e.report_columns[i],r=new G(null);r.th=n.id,r.thStaticContent=n.description,r.thBackgroundColor=n.color;var s=new k(null);s.td=n.id,s.tdPropertyAccessor=i.toString(),t.ths.push(r),t.tds.push(s)}return t},e}(),$=function(e,t,i){this.column=e,this.count=t,this.value=i,this.aggregations=[]},X=function(e,t,i){this.column=e,this.aggregation=t,this.value=i},J=function(e,t,i){this.column=e,this.aggregation=t,this.datatype=i},Q=function(e,t,i,n,r){this._grouplevel=e,this._thisRoute=t,this._parent=i,this.view=n,this.searches=r,this._sep=!0,this.buttons=[],this._thisKey=i+"_sep"},Z=function(e,t){this.column=e,this.value=t},Y=function(){function e(e,t,i){this.est=e,this.utilities=t,this.dateExts=i,this.rgGroupCache=new Map,this.rgItemCache=new Map,this.rgChildGroupsCache=new Map}return e.prototype.handleNewDataOnRowGrouping=function(e,t){var i,n,r,s,o,a,l,c=this;if(0==((null===(a=e.requestedgroups)||void 0===a?void 0:a.length)||0)){this.est.boundSource=this.est.TMPBoundSource,this.rgGroupCache=new Map,this.rgItemCache=new Map,this.rgChildGroupsCache=new Map,this.est.TMPBoundSource.forEach((function(e){e._thisRoute=e._group?[{column:e.column,value:e.value}]:[],e._thisKey=e._group?e.value:null,e._grouplevel=0,c.rgGroupCache.set(e._thisKey,e)}));var h=this.est.TMPBoundSource[0];this.est.MainGroupView=Object.assign({},e),this.est.groupSearchRequestsCache=[{path:"",route:[{column:h.column,value:h.value}],view:this.est.MainGroupView,group_column:this.est.TMPBoundSource[0].column}],this.est.BaseItemsCount=e.objectcount}else{for(var p,u,d=e.requestedgroups.length!=t,g=this.est.boundSource,m=0,f="",v=[],y=0;y<e.requestedgroups.length;y++){var w=e.requestedgroups[y];f+=w.value,v.push({column:w.column,value:w.value});for(var C=m;C<g.length;C++){var b=g[C];if(C>=m&&b._group&&b.column==w.column&&b.value==w.value){m=C,b._expanded=!0;break}}}if(d){try{for(var S=x(this.rgChildGroupsCache.keys()),I=S.next();!I.done;I=S.next()){(T=I.value).startsWith(f)&&this.rgChildGroupsCache.delete(T)}}catch(e){i={error:e}}finally{try{I&&!I.done&&(n=S.return)&&n.call(S)}finally{if(i)throw i.error}}try{for(var _=x(this.rgItemCache.keys()),O=_.next();!O.done;O=_.next()){var T;(T=O.value).startsWith(f)&&this.rgItemCache.delete(T)}}catch(e){r={error:e}}finally{try{O&&!O.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}this.rgChildGroupsCache.set(f,[]),u=this.rgChildGroupsCache.get(f)}else this.rgItemCache.set(f,[]),p=this.rgItemCache.get(f);this.est.TMPBoundSource.forEach((function(t){t._parent=f,t._parentRoute=v,t._thisRoute=t._group?P(v,[new Z(t.column,t.value)]):[],t._thisKey=t._group?f+t.value:f,d?(t._grouplevel=e.requestedgroups.length,c.rgGroupCache.set(t._thisKey,t),u.push(t)):p.push(t)})),d&&e.savedstate?(this.est.boundSource=this.est.boundSource.filter((function(e){return!(e._item||e._thisRoute.length>v.length)})),this.est.groupSearchRequestsCache=this.est.groupSearchRequestsCache.filter((function(e){return!(e.route.length>v.length)}))):d&&(this.est.boundSource=this.est.boundSource.filter((function(e){return!(e._item||e._thisKey.startsWith(f)&&e._thisKey!=f)}))),this.est.boundSource=this.est.boundSource.filter((function(e){return!(e._parent==f)}));var M=this.est.boundSource[m];d&&(M._groupscount=null===(l=this.est.View)||void 0===l?void 0:l.groupcount),(o=this.est.boundSource).splice.apply(o,P([m+1,0],this.est.TMPBoundSource));this.est.boundSource.splice(m+1+0,0,this.getGroupSeparator(e,f,v,e.requestedgroups.length,d?"groups":"items"));var H={path:f,route:v,view:Object.assign({},e),group_column:d?this.est.TMPBoundSource[0].column:""},V=this.est.groupSearchRequestsCache.findIndex((function(e){return e.path==H.path&&e.group_column==H.group_column}));-1==V?this.est.groupSearchRequestsCache.push(H):this.est.groupSearchRequestsCache.splice(V,1,H)}},e.prototype.arrayModeReviewGroupings=function(e){if(0!=e.length){for(var t=[],i=[],n=0;n<e.length;n++){var r=e[n];r.thGroup?t.push(new $(r.th,0,"")):r.thAggregation&&(i=P(i,this.getGroupAggregations(r)))}t.length>0&&(this.rgGroupCache.clear(),this.rgItemCache.clear(),this.rgChildGroupsCache.clear(),this.est.ArrayGrouping=!0,this.est.boundSource=this.getGroupsRecursive(t,0,this.est.boundSource,i,null))}},e.prototype.getGroupAggregations=function(e){var t=[];return e.thAggregation?this.getEsThDirectiveListOfAggregations(e).forEach((function(i){var n=i.format&&["small","long","verylong"].includes(i.format),r=i.format&&i.format.startsWith("F")&&!Number.isNaN(i.format.charAt(1))&&2==i.format.length;if(!n&&!r&&i.format)throw"Le aggergazioni supportate dall'es-table sono solo 'small', 'long', 'verylong' per le date e 'F0-9' per i numeri";t.push(new J(e.th,i.func,n?"date":r?"number":"string"))})):e.thGroup&&t.push(new J(e.th,null)),t},e.prototype.getEsThDirectiveListOfAggregations=function(e){if(!e.thAggregation)return[];if(e._thAggregations)return e._thAggregations;var t=[],i=e.thAggregation.match(/{[a-zA-Z0-9\/:]*}/gi);return i?(i.forEach((function(e){var i=e.split(":"),n=e,r="";i.length>0&&(n=i[0].substr(1),r=i[1].substr(0,i[1].length-1)),t.push({func:n,format:r,match:e})})),e._thAggregations=t,t):[]},e.prototype.getGroupsRecursive=function(e,t,i,n,r){0==t&&i.forEach((function(e){return e._visible=!1}));var s=e[t],o=[],a=e.length==t+1,l=this.utilities.groupBy(i,s.column),c=function(i){var c=l[i],p=new $(s.column,c.length,i);p.aggregations=h.generateAggregations(c,n);var u=p;if(u._group=!0,u._expanded=!1,r?(u._parent=r._thisKey,u._parentRoute=r._thisRoute,u._thisRoute=P(r._thisRoute,[{column:p.column,value:p.value}]),u._thisKey=r._thisKey+p.value,u._grouplevel=r._grouplevel+1):(u._thisRoute=[{column:p.column,value:p.value}],u._thisKey=p.value,u._grouplevel=0),0==t&&(u._visible=!0),h.utilities.calculateHash([u]),h.utilities.cacheAggregations(u),o.push(u),h.rgGroupCache.set(u._thisKey,u),a)c.forEach((function(e){return e._thisKey=u._thisKey})),o.push.apply(o,P(c)),h.rgItemCache.set(u._thisKey,c);else{var d=h.getGroupsRecursive(e,t+1,c,n,u),g=d.filter((function(e){return e._group&&e._parent==u._thisKey}));u._groupscount=g.length,o.push.apply(o,P(d)),h.rgChildGroupsCache.set(u._thisKey,g)}},h=this;for(var p in l)c(p);return o},e.prototype.generateAggregations=function(e,t){for(var i=[],n="",r=null,s=null,o=null,a=null,l=0;l<t.length;l++){var c=t[l];if(r=c.column){switch(c.datatype){case"string":s=e.map((function(e){return e[r].toString()}));break;case"date":o=e.map((function(e){return new Date(e[r]).getTime()}));break;case"number":a=e.map((function(e){return parseFloat(e[r])}))}switch(c.aggregation){case"max":switch(c.datatype){case"string":n=s.sort().reverse()[0];break;case"date":n=new Date(Math.max.apply(Math,P(o))).toString();break;case"number":n=Math.max.apply(Math,P(a)).toString()}break;case"min":switch(c.datatype){case"string":n=s.sort()[0];break;case"date":n=new Date(Math.min.apply(Math,P(o))).toString();break;case"number":n=Math.min.apply(Math,P(a)).toString()}break;case"sum":switch(c.datatype){case"string":n=s.join(", ");break;case"date":n="";break;case"number":n=a.reduce((function(e,t){return e+t}),0).toString()}}i.push(new X(c.column,c.aggregation,n))}}return i},e.prototype.getGroupSeparator=function(e,t,i,n,r){var s=new Q(n,i,t,Object.assign({},e),r);return s.buttons=this.utilities.getPagesArray(6,e.page,e.pages),this.utilities.calculateHash([s]),s},e.prototype.emitRowGroupingSearches=function(e,t){var i=this,n=this.est.groupSearchRequestsCache.filter((function(t){return t.group_column==e})).map((function(e){return e.view}));n&&0!=n.length||(n=this.est.groupSearchRequestsCache.filter((function(e){return!e.group_column})).map((function(e){return e.view}))),n&&0!=n.length&&n.forEach((function(e){e.orders=t,e.savedstate=!0,i.est.emitSearchRequest(!1,e)}))},e.prototype.getGroupCellDisplay=function(e,t,i){var n=this;if(e._sep)return"";var r=i.thAggregation;if(e.column==t){var s=e._groupscount?" - "+e._groupscount+" "+this.est.lc.loc("Groups"):"";return e.value+" ("+e.count+s+")"}var o=e._aggregationsCache.get(t);return o?(this.getEsThDirectiveListOfAggregations(i).forEach((function(e){r=r.replace(e.match,n.formatAggregationValue(o.get(e.func),e.format))})),r):""},e.prototype.formatAggregationValue=function(e,t){if(!t)return e;if(!Number.isNaN(e)&&(!t||t.startsWith("F"))&&t.startsWith("F")&&!Number.isNaN(t.substr(1)))return parseFloat(e).toFixed(parseInt(t.substr(1)));var i=null;try{i=this.dateExts.getDateConvertion(e)}catch(e){}return i?this.dateExts.getFormatted(i,"small"==t,"verylong"==t):e},e}(),ee=function(e,t,i){this.cache=e,this.index_cache=t,this.array=i},te=function(){function e(e,t){this.est=e,this.rgHandler=t,this.itemsCache=new Map,this.groupsCache=new Map,this.exclusionsCache=new Map,this.group_exclusionsCache=new Map,this.i_itemsCache=new Map,this.i_groupsCache=new Map,this.i_exclusionsCache=new Map,this.i_group_exclusionsCache=new Map}return e.prototype.clearSelectionCaches=function(){this.itemsCache.clear(),this.groupsCache.clear(),this.exclusionsCache.clear(),this.group_exclusionsCache.clear(),this.i_itemsCache.clear(),this.i_groupsCache.clear(),this.i_exclusionsCache.clear(),this.i_group_exclusionsCache.clear()},e.prototype.evaluateSelection=function(e,t){t&&this.handleSelectionEvaluation(e,t)},e.prototype.evaluateSingleCellSelection=function(e,t,i){for(var n=0;n<e.length;n++)this.est.selectionStatus[e[n]._ordinal]={},i&&i.length>0?this.fillSelectionStatusByDynamicColumns(e[n],i):this.fillSelectionStatusByEsThs(e[n],t)},e.prototype.fillSelectionStatusByDynamicColumns=function(e,t){for(var i=this,n=function(n){var s=t[n],o={selected:!1,value:s.PropertyName?e[s.PropertyName]:"Undefined Property",type:s.PropertyType,property:s.PropertyName,header:s.PropertyName,item:e};r.est.selectionStatus[e._ordinal][n]=o,o.val_setter=function(t){if(!s.PropertyName)return e[s.PropertyName]=t,o.value=t,t;var n="";switch(s.PropertyType){case"string":n=t.startsWith('"')&&t.endsWith('"')?t.substring(1,t.length-1):t;break;case"number":case"int":case"boolean":case"enum":case"autocomplete":case"float":case"currency":n=t;break;case"date":case"datetime":n=i.est.dateExts.getDateConvertion(t);break;case"time":var r=i.est.dateExts.getDateConvertion(t);n=r.hour()+":"+r.minute()+":"+r.second()}return e[s.PropertyName]=n,o.value=n,n}},r=this,s=0;s<t.length;s++)n(s)},e.prototype.fillSelectionStatusByEsThs=function(e,t){for(var i=this,n=function(n){var s=t[n],o={selected:!1,value:s.thProperty?e[s.thProperty]:"Undefined Property",type:s.thType,property:s.thProperty,header:s.th,item:e};r.est.selectionStatus[e._ordinal][n]=o,o.val_setter=function(t){if(!s.thProperty)return e[s.thProperty]=t,o.value=t,t;var n="";switch(s.thType){case"string":n=t.startsWith('"')&&t.endsWith('"')?t.substring(1,t.length-1):t;break;case"number":case"int":case"boolean":case"enum":case"autocomplete":case"float":case"currency":n=t;break;case"date":case"datetime":n=i.est.dateExts.getDateConvertion(t);break;case"time":var r=i.est.dateExts.getDateConvertion(t);n=r.hour()+":"+r.minute()+":"+r.second()}return e[s.thProperty]=n,o.value=n,n}},r=this,s=0;s<t.length;s++)n(s)},e.prototype.handleSelectionEvaluation=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],r=n._hash,s=n._group?null:this.getItemGroup(n);this.rehidrateCache(n),n._item?t.all?n._selected=!this.exclusionsCache.has(r)&&(!this.groupsCache.has(null==s?void 0:s._hash)&&this.itemsCache.has(r)||!this.group_exclusionsCache.has(null==s?void 0:s._hash)):n._selected=!this.exclusionsCache.has(r)&&(this.groupsCache.has(null==s?void 0:s._hash)||this.itemsCache.has(r)||"included"==this.parentTreeStatus(s)&&!this.group_exclusionsCache.has(null==s?void 0:s._hash)):n._group&&(t.all?n._selected=!this.group_exclusionsCache.has(r)&&"excluded"!=this.parentTreeStatus(n):n._selected=this.groupsCache.has(r)||"included"==this.parentTreeStatus(n)&&!this.group_exclusionsCache.has(r))}if(this.est.globalCheck=this.est.boundSource.length>0&&this.est.boundSource.filter((function(e){return e._group||e._item})).every((function(e){return e._selected})),this.est.canSelectAll=t.count>0&&this.est.SelectAll&&!this.est.SingleSelection,this.est.arrayMode){var o=this.est.selectedObjects;this.finalizeSelectionInformations(t),this.est.selectedObjects!=o&&this.est.onSelectionChanged.emit(t)}},e.prototype.rehidrateCache=function(e){var t=e._hash;this.itemsCache.has(t)&&this.itemsCache.set(t,e),this.group_exclusionsCache.has(t)&&this.group_exclusionsCache.set(t,e),this.groupsCache.has(t)&&this.groupsCache.set(t,e),this.exclusionsCache.has(t)&&this.exclusionsCache.set(t,e)},e.prototype.parentTreeStatus=function(e){if(!e)return"none";var t=this.rgHandler.rgGroupCache.get(e._parent);return t?this.group_exclusionsCache.has(t._hash)?"excluded":this.groupsCache.has(t._hash)?"included":this.parentTreeStatus(t):"none"},e.prototype.handleItemsSelection=function(e,t,i){var n,r,s;void 0===t&&(t=null),void 0===i&&(i=null);var o=(null===(n=this.est.View)||void 0===n?void 0:n.selection)||this.est.arraymodeSelection;if(this.est.SingleSelection&&(null===(r=e[0])||void 0===r?void 0:r._selected)&&!(null===(s=e[0])||void 0===s?void 0:s._group)){if(e.length>1&&null==t)throw"Tentativo di selezionare o deselezionare più di un elemento con SingleSelection attivo";1==e.length&&null==t&&(o=this.handleItemsSelection(this.est.boundSource.filter((function(e){return!e._group})),!1,null),e[0]._selected=!0)}for(var a=0;a<e.length;a++){var l=e[a],c=null!=t?l._selected!=t:null!=i&&l._selected!=this.est.globalCheck;if(c&&!l.locked&&(l._selected=null!=t?t:this.est.globalCheck),c||null==i){var h=o.all,p=l._group,u=l._selected,d=null,g=null,m=null,f=null,v=null,y=null,w=null,C=null,b=null;if(p){var x=this.parentTreeStatus(l);C="included"==x,b="excluded"==x,g=this.getGroupItems(o,l,null,!0),m=this.getGroupItems(o,l,"selected",!0,g),f=this.getGroupItems(o,l,"unselected",!0,g),v=this.getGroupChildGroups(o,l,null,!0),y=this.getGroupChildGroups(o,l,"selected",!0,v),w=this.getGroupChildGroups(o,l,"unselected",!0,v)}else C=null==(d=this.getItemGroup(l))?null:d._selected,b=null==d?null:!d._selected;this.est.ArrayGrouping?this.performSimpleSelectionOperations(o,l,p,u,d,m,f,g,v):this.performSelectionOperations(o,l,h,p,u,m,y,f,w,g,v,C,b)}}return null==i&&(this.est.globalCheck=!this.est.boundSource.some((function(e){return!e._selected&&!e._sep}))),this.finalizeSelectionInformations(o),o},e.prototype.performSimpleSelectionOperations=function(e,t,i,n,r,s,o,a,l){var c=this,h=this.getTriptic("item",e);i?n?(l.forEach((function(e){e._selected=!0})),o&&o.forEach((function(e){e._selected=!0,c.addItem(e,h)}))):(l.forEach((function(e){e._selected=!1})),s&&s.forEach((function(e){e._selected=!1,c.removeItem(e,h)}))):n?(this.addItem(t,h),r&&a&&a.every((function(e){return e._selected}))&&this.selectGroup(r)):(this.removeItem(t,h),r&&(r._selected=!1))},e.prototype.selectGroup=function(e){e._selected=!0;var t=this.getGroupParent(e);t&&this.getGroupChildGroups(null,t,null,!0).every((function(e){return e._selected}))&&this.selectGroup(t)},e.prototype.performSelectionOperations=function(e,t,i,n,r,s,o,a,l,c,h,p,u){var d=this,g=this.getTriptic("group",e),m=this.getTriptic("item",e),f=this.getTriptic("exclusion",e),v=this.getTriptic("group_exclusion",e);n?r?(i||p?this.removeItem(t,v):this.addItem(t,g),s&&s.forEach((function(e){return d.removeItem(e,m)})),o&&o.forEach((function(e){return d.removeItem(e,g)})),c&&c.forEach((function(e){e._selected=!0,d.removeItem(e,f)})),h&&h.forEach((function(e){e._selected=!0,d.removeItem(e,v)}))):(i||p?this.addItem(t,v):this.removeItem(t,g),a&&a.forEach((function(e){return d.removeItem(e,f)})),l&&l.forEach((function(e){return d.removeItem(e,f)})),c&&c.forEach((function(e){e._selected=!1,d.removeItem(e,m)})),h&&h.forEach((function(e){e._selected=!1,d.removeItem(e,g)}))):r?null==u&&i||p?this.removeItem(t,f):this.addItem(t,m):u||!i&&null==u?this.removeItem(t,m):this.addItem(t,f)},e.prototype.removeItem=function(e,t){var i=t.index_cache.get(e._hash);return null!=i&&(t.cache.delete(e._hash),t.index_cache.delete(e._hash),t.array[i]=null),!!i},e.prototype.addItem=function(e,t){if(null==t.index_cache.get(e._hash)){var i=t.array.push(e)-1;return t.cache.set(e._hash,e),t.index_cache.set(e._hash,i),!0}return!1},e.prototype.getTriptic=function(e,t){switch(e){case"group":return new ee(this.groupsCache,this.i_groupsCache,t.groups);case"item":return new ee(this.itemsCache,this.i_itemsCache,t.items);case"group_exclusion":return new ee(this.group_exclusionsCache,this.i_group_exclusionsCache,t.group_exclusions);case"exclusion":return new ee(this.exclusionsCache,this.i_exclusionsCache,t.exclusions)}},e.prototype.getItemGroup=function(e){var t=this.rgHandler.rgGroupCache.get(e._thisKey);return t||null},e.prototype.getGroupItems=function(e,t,i,n,r){var s,o;void 0===n&&(n=!1),void 0===r&&(r=null);var a=[];if(r)a=r;else if(n)try{for(var l=x(this.rgHandler.rgItemCache.keys()),c=l.next();!c.done;c=l.next()){var h=c.value;h.startsWith(t._thisKey)&&a.push.apply(a,P(this.rgHandler.rgItemCache.get(h)))}}catch(e){s={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(s)throw s.error}}else a=this.rgHandler.rgItemCache.get(t._thisKey);return 0!=(a=a.filter((function(e){return!i||e._selected&&"selected"==i||!e._selected&&"unselected"==i}))).length||!e||this.est.arrayMode||("unselected"==i?a=e.exclusions.filter((function(e){return null!=e&&!n&&e._thisKey==t._thisKey||n&&e._thisKey.startsWith(t._thisKey)})):"selected"==i&&(a=e.items.filter((function(e){return null!=e&&!n&&e._thisKey==t._thisKey||n&&e._thisKey.startsWith(t._thisKey)})))),a},e.prototype.getGroupParent=function(e){var t=this.rgHandler.rgGroupCache.get(e._parent);return t||null},e.prototype.getGroupChildGroups=function(e,t,i,n,r){var s,o;void 0===n&&(n=!1),void 0===r&&(r=null);var a=this.rgHandler.rgGroupCache.get(t._thisKey),l=[];if(r)l=r;else if(n)try{for(var c=x(this.rgHandler.rgChildGroupsCache.keys()),h=c.next();!h.done;h=c.next()){var p=h.value;p.startsWith(t._thisKey)&&l.push.apply(l,P(this.rgHandler.rgChildGroupsCache.get(p)))}}catch(e){s={error:e}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(s)throw s.error}}else l=this.rgHandler.rgChildGroupsCache.get(t._thisKey);return 0==(l=l.filter((function(e){return!i||e._selected&&"selected"==i||!e._selected&&"unselected"==i}))).length&&e?l="unselected"==i?e.group_exclusions.filter((function(e){return null!=e&&(!n&&e._thisRoute.length==a._thisRoute.length+1&&e._thisRoute.startsWith(t._thisKey)||n&&e._thisKey.startsWith(t._thisKey))})):e.groups.filter((function(e){return null!=e&&(!n&&e._thisRoute.length==a._thisRoute.length+1&&e._thisRoute.startsWith(t._thisKey)||n&&e._thisKey.startsWith(t._thisKey))})):l},e.prototype.finalizeSelectionInformations=function(e){for(var t=[],i=[],n=[],r=[],s=!1,o=!1,a=!1,l=!1,c=0;c<e.items.length;c++)null!=e.items[c]?i.push(e.items[c]):o=!0;for(c=0;c<e.exclusions.length;c++)null!=e.exclusions[c]?n.push(e.exclusions[c]):a=!0;if(e.groups)for(c=0;c<e.groups.length;c++)null!=e.groups[c]?t.push(e.groups[c]):s=!0;if(e.group_exclusions)for(c=0;c<e.group_exclusions.length;c++)null!=e.group_exclusions[c]?r.push(e.group_exclusions[c]):l=!0;e.items=i,e.group_exclusions=r,e.exclusions=n,e.groups=t,s&&(this.i_groupsCache=this.compactIndexMap(this.i_groupsCache)),o&&(this.i_itemsCache=this.compactIndexMap(this.i_itemsCache)),a&&(this.i_exclusionsCache=this.compactIndexMap(this.i_exclusionsCache)),l&&(this.i_group_exclusionsCache=this.compactIndexMap(this.i_group_exclusionsCache)),e.count=this.evaluateSelected(),0==e.count&&(this.est.boundSource.forEach((function(e){return e._selected=!1})),e.all=!1,e.exclusions=[],e.items=[],e.groups=[],e.group_exclusions=[],this.clearSelectionCaches()),this.est.canSelectAll=e.count>0&&this.est.SelectAll&&!this.est.SingleSelection},e.prototype.compactIndexMap=function(e){var t,i,n=0,r=new Map;try{for(var s=x(e.keys()),o=s.next();!o.done;o=s.next()){var a=o.value;r.set(a,n++)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},e.prototype.evaluateSelected=function(){var e,t=(null===(e=this.est.View)||void 0===e?void 0:e.selection)||this.est.arraymodeSelection,i=t.group_exclusions.reduce((function(e,t){return e+t.count}),0),n=t.groups.reduce((function(e,t){return e+t.count}),0);return this.est.selectedObjects=(t.all?this.est.BaseItemsCount:n)-i+t.items.length-t.exclusions.length,this.est.selectedObjects},e.prototype.selectAllOrResetSelection=function(){var e=this.est.View.selection||this.est.arraymodeSelection;this.clearSelectionCaches(),e.all=!e.all,e.exclusions=[],e.groups=[],e.group_exclusions=[],e.items=[],e.all||(this.est.canSelectAll=!1,this.est.globalCheck=!1),this.finalizeSelectionInformations(e),this.est.onSelectionChanged.emit(e),this.evaluateSelection(this.est.boundSource,e)},e.prototype.singleCellSelection=function(e,t,i){if(this.clearTextSelection(e),e.shiftKey&&this.est.ShiftClick&&this.lastSingleSelection){this.clearSelectionStatus({row:t,column:i});for(var n=t<this.lastSingleSelection.row?-1:1,r=i<this.lastSingleSelection.column?-1:1,s=this.lastSingleSelection.row;s!=t+n;s+=n)for(var o=this.lastSingleSelection.column;o!=i+r;o+=r)this.est.selectionStatus[s][o].selected=!0;this.lastSingleSelection={row:t,column:i}}else this.clearSelectionStatus({row:t,column:i}),this.est.selectionStatus[t][i].selected=!this.est.selectionStatus[t][i].selected,this.lastSingleSelection={row:t,column:i};this.est.cdr.markForCheck()},e.prototype.clearSelectionStatus=function(e){for(var t in this.est.selectionStatus)for(var i in this.est.selectionStatus[t])e&&(!e||t==e.row.toString()&&i==e.column.toString())||(this.est.selectionStatus[t][i].selected=!1)},e.prototype.getSelectionStatusSelection=function(){var e=[];for(var t in this.est.selectionStatus){var i=[];for(var n in this.est.selectionStatus[t]){var r=this.est.selectionStatus[t][n];r.selected&&i.push(r)}i.length>0&&e.push(i)}return e},e.prototype.clearTextSelection=function(e){if(("Range"==e.view.getSelection().type||e.view.getSelection().toString().length>0)&&!e.shiftKey)return!1;("Range"==e.view.getSelection().type||e.view.getSelection().toString().length>0)&&e.shiftKey&&this.est.utiExts.clearTextSelection()},e.prototype.getClipbardTextFromSelection=function(e){for(var t="",i=0;i<e.length;i++){var n=e[i];i>0&&(t+="\n");for(var r=0;r<n.length;r++){var s=n[r];t+=this.getValueByType(s)+(r<n.length-1?"\t":"")}}return t},e.prototype.getValueByType=function(e){switch(e.type){case"string":return'"'+e.value+'"';case"number":case"int":case"boolean":case"enum":case"autocomplete":case"float":case"currency":return e.value;case"date":return dayjs(e.value).format(this.est.lc.token("getSmallDateDisplayFormat"));case"datetime":return dayjs(e.value).format(this.est.lc.token("getFullDateDisplayFormat"));case"time":return dayjs(e.value).format("HH:mm:ss")}},e}(),ie=function(){function e(e){this.hashExts=e}return e.prototype.groupBy=function(e,t){for(var i={},n=0;n<e.length;n++){var r=e[n];(i[r[t]]=i[r[t]]||[]).push(r)}return i},e.prototype.cacheAggregations=function(e){e._aggregationsCache=new Map;for(var t=e._aggregationsCache,i=0;i<e.aggregations.length;i++){var n=e.aggregations[i];if(t.has(n.column))t.get(n.column).set(n.aggregation,n.value);else{var r=new Map;r.set(n.aggregation,n.value),t.set(n.column,r)}}},e.prototype.arrayMove=function(e,t,i){if(i>e.length-1||t>e.length-1||i<0||t<0)throw"Gli indici passati non fanno riferimento a una posizione dell'array. Length: "+e.length+" Old:"+t+" New: "+i;e.splice(i,0,e.splice(t,1)[0])},e.prototype.getPagesArray=function(e,t,i,n,r){void 0===n&&(n=null),void 0===r&&(r=null);var s,o,a=[];if(-1==i&&(null==n&&null==r||n==r)&&(i=t+1),-1==i&&0==n&&(i=t),i<=e)s=1,o=i-1;else{var l=(e-2)/2;o=t+l,(s=t-l)<1?(s=1,o=e-1):o>=i&&(s=i-e+1,o=i-1)}if(a.push({val:1,cssClass:1===t?"btn-main app-white-text":"app-white-button"}),o>=s){for(var c=s;c<=o;c++)1!==c&&a.push({val:c,cssClass:c===t?"btn-main app-white-text":"app-white-button"});a.push({val:i,cssClass:i===t?"btn-main app-white-text":"app-white-button"})}return a},e.prototype.calculateHash=function(e){if(e)for(var t={},i=0;i<e.length;i++){var n=e[i],r=Object.assign({},e[i]);delete r._selected,delete r._visible,delete r._hash;var s=this.hashExts.hashObject(r);t[s]=t[s]?t[s]+1:1,n._hash=s+(t[s]>1?"_"+t[s]:""),n._ordinal=i}},e.prototype.InputOrDefault=function(e,t,i){return null!=e&&null!=e?e:null!=t&&null!=t?t:null!=i&&null!=i?i:null},e}();ie.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new ie(t.ɵɵinject(n.HashingService))},token:ie,providedIn:"root"}),ie.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],ie.ctorParameters=function(){return[{type:n.HashingService}]};var ne=function(){var e=this;this.OnCopy=new a.Subject,this.OnPaste=new a.Subject,document.addEventListener("keydown",(function(t){"c"===t.key&&t.ctrlKey&&e.OnCopy.next(),"v"===t.key&&t.ctrlKey&&e.OnPaste.next()}))};ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[]};var re=function(){function e(e,i,n,r,s,o,l,c,h,p,u,d,g){var m,f,v,y,w,C,b,x,S,P,I,_,O,T,M,H,V,E=this;this.ngControl=e,this.prefService=i,this.deafults=n,this.locale=r,this.lc=s,this.cdr=o,this.utilities_H=l,this.utiExts=c,this.expExts=h,this.dateExts=p,this.msgExts=u,this.copyPasteDetector=d,this.clipboardService=g,this.FocusSubject=new a.Subject,this.doubleClickBufferMs=200,this.View=null,this.globalCheck=!1,this.lastSelected=null,this.selectedObjects=0,this.canSelectAll=!1,this.viewMode=!1,this.arrayMode=!1,this.boundSource=[],this.TMPBoundSource=[],this.boundSubSources=[],this.addedSlices=[],this.defaultAllPageOverride=999999,this.autoUpdate=!1,this.seconds="10",this.researchInProgress=!1,this.RowTDs=null,this.TMPRowTDs=null,this.RowTHs=null,this.TMPRowTHs=null,this.TMPRowThGroups=null,this.RowThGroups=null,this.DynamicTableRouterLinkCache={},this.RowContexts=[],this.OrderDirectives=[],this.lastSelectedItemID=null,this.UserDefinedDynamicCols=!1,this.FirstBind=!0,this.ColumnsList=[],this.TMPColumnsList=[],this.globalColVisCheck=!1,this.CornerMenuOptions=null,this.ColumnsResizable=null,this.ColumnsPinnable=null,this.AutoUpdate=null,this.UseCustomCells=null,this.MaxHeight=null,this.ContainerClass=null,this.XLSXExport=null,this.CSVExport=!0,this.AllSearch=null,this.HighCellDensity=null,this.Selection=null,this.ShowLoadingOnBootstrap=null,this.Removal=null,this.RemovalCondition="",this.Export=null,this.ShiftClick=null,this.CountLabel=null,this.HidePaging=null,this.HidePagingCount=null,this.HidePagingButtons=null,this.ContextMenu=null,this.ExportFileName="Export.csv",this.TableClass=null,this.HasHeaderGroup=null,this.HasSecondaryHeaderGroup=null,this.HeaderHidden=null,this.BodyHidden=null,this.SelectionDisabled=null,this.SingleSelection=null,this.RowClassAssigner=null,this.OrderByColumn=null,this.MultipleOrderingDirectives=!0,this.HiddenColumns=null,this.ColumnsOrdering=null,this.SearchView=null,this.SelectAll=null,this.UseArrayModePaging=!0,this.DynamicRowColumnsDefinition=null,this.DynamicOperations=[],this.Hierarchy=null,this.ParentKey="",this.OwnKey="",this.StartsExpanded=!0,this.SavePreferences=null,this.PagingStyle=null,this.RowGroupingPagingStyle=null,this.ItemSourceProperty="",this.UseSelectionCache=null,this.ShowItemGroupsColumns=null,this.Editable=!1,this.RangeSelection=!1,this.onOrderChanged=new t.EventEmitter,this.onSearchRequest=new t.EventEmitter,this.onSelectionChanged=new t.EventEmitter,this.onRemoval=new t.EventEmitter,this.onAbortRemoval=new t.EventEmitter,this.onModelChange=new t.EventEmitter,this.onCornerAction=new t.EventEmitter,this.onDynamicOperation=new t.EventEmitter,this.arraymodePage=1,this.arraymodePages=1,this.ArraymodeItemsPerPage=null,this.arrayColumns=[],this.arrayColumnOrdering=[],this.arrayOrders=[],this.internalWriteCall=!1,this.groupSearchRequestsCache=[],this.ResearchNeeded=!1,this.Columns={Visibile:100,VisibleUnpinned:100,Global:100},this.MainGroupView=null,this.BaseItemsCount=null,this.ArrayGrouping=!1,this.DirectivesBased=!1,this.selectionStatus={},this.PagerOptions={PagerCount:null,ShowCount:!0,ShowPaging:!0,ShowButtons:!0,ShowPagingOptions:!0,UsesView:!0,View:null,Ready:!1,Searches:"items"},this.propagateChange=function(e){},this.bodyTrackBy=function(e,t){return t._hash},this.copySubscription=this.copyPasteDetector.OnCopy.subscribe((function(){E.handleCopy()})),this.pasteSubscription=this.copyPasteDetector.OnPaste.subscribe((function(){E.handlePaste()})),this.export_H=new L(this,this.expExts,this.msgExts,this.utiExts,this.dateExts),this.rowGrouping_H=new Y(this,this.utilities_H,this.dateExts),this.columnMetadata_H=new N(this,this.utilities_H,this.utiExts,this.prefService,this.rowGrouping_H),this.dynamicMode_H=new W(this),this.hierarchyMode_H=new j(this),this.items_H=new q(this,this.utilities_H),this.reportMode_H=new K(this,this.utilities_H),this.selection_H=new te(this,this.rowGrouping_H),e&&(e.valueAccessor=this),this.ColumnsResizable=this.utilities_H.InputOrDefault(this.ColumnsResizable,null===(m=this.deafults)||void 0===m?void 0:m.ColumnsResizable),this.AutoUpdate=this.utilities_H.InputOrDefault(this.AutoUpdate,null===(f=this.deafults)||void 0===f?void 0:f.AutoUpdate),this.AllSearch=this.utilities_H.InputOrDefault(this.AllSearch,null===(v=this.deafults)||void 0===v?void 0:v.AllSearch,!0),this.Export=this.utilities_H.InputOrDefault(this.Export,null===(y=this.deafults)||void 0===y?void 0:y.Export),this.HidePaging=this.utilities_H.InputOrDefault(this.HidePaging,null===(w=this.deafults)||void 0===w?void 0:w.HidePaging,!1),this.HidePagingCount=this.utilities_H.InputOrDefault(this.HidePagingCount,null===(C=this.deafults)||void 0===C?void 0:C.HidePagingCount),this.HidePagingButtons=this.utilities_H.InputOrDefault(this.HidePagingButtons,null===(b=this.deafults)||void 0===b?void 0:b.HidePagingButtons),this.ContainerClass=this.utilities_H.InputOrDefault(this.ContainerClass,null===(x=this.deafults)||void 0===x?void 0:x.ContainerClass,""),this.TableClass=this.utilities_H.InputOrDefault(this.TableClass,null===(S=this.deafults)||void 0===S?void 0:S.TableClass,"table table-striped table-hover table-sm"),this.Selection=this.utilities_H.InputOrDefault(this.Selection,null===(P=this.deafults)||void 0===P?void 0:P.Selection),this.SavePreferences=this.utilities_H.InputOrDefault(this.SavePreferences,null===(I=this.deafults)||void 0===I?void 0:I.SavePreferences),this.PagingStyle=this.utilities_H.InputOrDefault(this.PagingStyle,null===(_=this.deafults)||void 0===_?void 0:_.PagingStyle,"bottom"),this.RowGroupingPagingStyle=this.utilities_H.InputOrDefault(this.RowGroupingPagingStyle,null===(O=this.deafults)||void 0===O?void 0:O.RowGroupingPagingStyle,"left"),this.UseSelectionCache=this.utilities_H.InputOrDefault(this.UseSelectionCache,null===(T=this.deafults)||void 0===T?void 0:T.UseSelectionCache,!0),this.ShowItemGroupsColumns=this.utilities_H.InputOrDefault(this.ShowItemGroupsColumns,null===(M=this.deafults)||void 0===M?void 0:M.ShowItemGroupsColumns,!1),this.ArraymodeItemsPerPage=this.utilities_H.InputOrDefault(this.ArraymodeItemsPerPage,null===(H=this.deafults)||void 0===H?void 0:H.ArraymodeItemsPerPage,15),this.ColumnsPinnable=this.utilities_H.InputOrDefault(this.ColumnsPinnable,null===(V=this.deafults)||void 0===V?void 0:V.ColumnsPinnable,!0)}return e.prototype.ngOnInit=function(){var e=this;this.ctxMenuSubscription=(this.ContextMenu||this.tableEmptyMenu).open.subscribe((function(t){if(!t.item._sep){var i=!t.item._selected;t.item._selected=!0;var n=e.selection_H.handleItemsSelection([t.item]);e.changed(),i&&e.onSelectionChanged.emit(n)}}))},e.prototype.ngAfterViewInit=function(){var e=this.EsTdsDirective&&this.EsTdsDirective.length>0&&this.EsThsDirective&&this.EsThsDirective.length>0,t=!(this.bodyRef||this.headerRef||this.headerGroupRef||this.secondaryHeaderGroupRef);if((e||t)&&(null==this.UseCustomCells&&(this.UseCustomCells=!0),null==this.HiddenColumns&&this.UseCustomCells&&(this.HiddenColumns=!0),null==this.ColumnsOrdering&&this.UseCustomCells&&(this.ColumnsOrdering=!0),null==this.OrderByColumn&&this.UseCustomCells&&(this.OrderByColumn=!0),null==this.SelectAll&&this.Selection&&(this.SelectAll=!0),null==this.ShiftClick&&this.Selection&&(this.ShiftClick=!0),this.DirectivesBased=!0),this.Hierarchy&&!this.UseCustomCells)throw'Es-table error: Per poter utilizzare l\'es-table con [Hierarchy]="true" è richiesto anche [UseCustomCells]="true"'},e.prototype.ngOnDestroy=function(){this.copySubscription&&this.copySubscription.unsubscribe(),this.pasteSubscription&&this.pasteSubscription.unsubscribe(),this.ctxMenuSubscription&&this.ctxMenuSubscription.unsubscribe()},e.prototype.ngOnChanges=function(e){return C(this,void 0,void 0,(function(){return b(this,(function(t){return e.SearchView&&this.SearchView&&(this.arrayPulsanti=this.utilities_H.getPagesArray(6,this.SearchView.page,this.SearchView.pages||1,this.SearchView.items.length,this.SearchView.itemsperpageoverride)),[2]}))}))},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.changed=function(){this.propagateChange(this.View)},e.prototype.writeValue=function(e){var t;return C(this,void 0,void 0,(function(){var i,n,r,s,o,a,l;return b(this,(function(c){switch(c.label){case 0:return this.View=e||null,this.researchInProgress=!1,this.View||this.SearchView?(!this.View||void 0===this.View.itemsperpageoverride||this.View instanceof H?!this.SearchView||void 0===this.SearchView.itemsperpageoverride||this.SearchView instanceof H||(this.SearchView.__proto__=new H):this.View.__proto__=new H,this.View&&this.View instanceof H?(this.setMode("view"),i=0==((null===(t=this.View.requestedgroups)||void 0===t?void 0:t.length)||0),this.View.selection&&(this.View.internalsearchrequest||!i)&&this.UseSelectionCache||(this.selection_H.clearSelectionCaches(),this.View.selection=new V([]),this.onSelectionChanged.emit(this.View.selection)),this.View.internalsearchrequest=!1,this.SavePreferences?this.ngControl.name?[3,1]:(console.error("Non posso utilizzare le preference senza avere un 'name' per questa tabella"),[3,4]):[3,4]):[3,5]):(this.boundSource=this.TMPBoundSource||[],this.cdr.markForCheck(),[2]);case 1:return this.prefService?[3,2]:(console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato"),[3,4]);case 2:return[4,this.prefService.getItem(this.ngControl.name).toPromise()];case 3:if(n=c.sent(),this.View){for(r=(null==n?void 0:n.columns)||[],s=!0,o=void 0,a=void 0,this.View.report_columns?(o=this.View.report_columns.map((function(e){return e.id})),a=r):(o=r,a=this.View.columns),l=0;l<a.length;l++)if(-1==o.indexOf(a[l])){s=!1;break}s&&(this.View.columns=(null==n?void 0:n.columns)||[],this.View.column_ordering=(null==n?void 0:n.column_ordering)||[],this.View.orders=(null==n?void 0:n.orders)||[])}c.label=4;case 4:return i&&(this.arrayPulsanti=this.utilities_H.getPagesArray(6,this.View.page,this.View.pages||1,this.View.items.length,this.View.itemsperpageoverride)),[3,10];case 5:return this.View&&null!=this.View.length&&null!=this.View.length?(this.setMode("array"),this.UseSelectionCache&&this.arraymodeSelection||(this.selection_H.clearSelectionCaches(),this.arraymodeSelection=new V([]),this.onSelectionChanged.emit(this.arraymodeSelection)),this.SavePreferences?this.ngControl.name?[3,6]:(console.error("Non posso utilizzare le preference senza avere un 'name' per questa tabella"),[3,9]):[3,9]):[3,10];case 6:return this.prefService?[3,7]:(console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato"),[3,9]);case 7:return[4,this.prefService.getItem(this.ngControl.name).toPromise()];case 8:for(n=c.sent(),r=(null==n?void 0:n.columns)||[],s=!0,o=void 0,a=void 0,this.View.report_columns?(o=this.View.report_columns.map((function(e){return e.id})),a=r):(o=r,a=this.View.columns),l=0;l<a.length;l++)if(-1==o.indexOf(a[l])){s=!1;break}s&&(this.View.columns=(null==n?void 0:n.columns)||[],this.View.column_ordering=(null==n?void 0:n.column_ordering)||[],this.View.orders=(null==n?void 0:n.orders)||[]),c.label=9;case 9:this.SearchView&&(this.arrayPulsanti=this.utilities_H.getPagesArray(6,this.SearchView.page,this.SearchView.pages||1,this.SearchView.items.length,this.SearchView.itemsperpageoverride)),c.label=10;case 10:return this.finalizeContext(),this.postBoundSourceCalculation(),[2]}}))}))},e.prototype.finalizeContext=function(){var e=this.View,t=e.groupings&&e.groupings.filter((function(e){return!e.aggregation})).length>0||this.arrayMode&&this.EsThsDirective.some((function(e){return e.thGroup}));if(this.arrayMode&&t&&(this.UseArrayModePaging=!1),this.TMPBoundSource=this.items_H.getItemsByMode(!1,!this.internalWriteCall),this.Hierarchy&&!t&&this.hierarchyMode_H.assignHierarchyLevels(this.TMPBoundSource),this.utilities_H.calculateHash(this.TMPBoundSource),this.TMPBoundSource&&this.RowClassAssigner||this.Hierarchy)for(var i=0;i<this.TMPBoundSource.length;i++){var n=this.TMPBoundSource[i];n._rowClass=this.RowClassAssigner?this.RowClassAssigner(n):"",n._rowClass+=this.Hierarchy?" est-row-lvl-"+n._level:""}},e.prototype.setupPagingInformations=function(){var e;if(this.PagerOptions.ShowCount=!this.HidePagingCount,this.PagerOptions.ShowButtons=!this.HidePagingButtons,this.PagerOptions.ShowPaging=!this.HidePaging,this.PagerOptions.UsesView=!0,this.arrayMode&&this.UseArrayModePaging&&!this.SearchView)this.PagerOptions.PagerCount=this.View.length||0,this.PagerOptions.ShowButtons=this.PagerOptions.ShowButtons&&this.View.length>10,this.PagerOptions.View=this.View,this.PagerOptions.UsesView=!1,this.PagerOptions.ShowPagingOptions=this.PagerOptions.ShowButtons;else if(!this.arrayMode||this.UseArrayModePaging&&!this.SearchView){if(this.viewMode){var t=this.MainGroupView||this.View,i=(null==t?void 0:t.groupcount)||(null==t?void 0:t.objectcount);this.PagerOptions.Searches=null!=(null==t?void 0:t.groupcount)&&null!=(null==t?void 0:t.groupcount)?"groups":"items",this.PagerOptions.PagerCount=i||0,this.PagerOptions.View=t,this.PagerOptions.ShowCount=this.PagerOptions.ShowCount||t&&i&&-1!=i,this.PagerOptions.ShowButtons=this.PagerOptions.ShowButtons&&(t.pagingavailable||this.PagerOptions.ShowCount),this.PagerOptions.ShowPagingOptions=this.PagerOptions.ShowButtons}}else this.SearchView?(this.PagerOptions.View=this.SearchView,this.PagerOptions.PagerCount=this.SearchView.objectcount||0):this.PagerOptions.PagerCount=this.View.length||0,this.PagerOptions.ShowButtons=this.PagerOptions.ShowButtons&&(this.View.length>10||((null===(e=this.SearchView)||void 0===e?void 0:e.objectcount)||0)>10),this.PagerOptions.ShowCount=this.PagerOptions.ShowCount||this.View&&this.View.length||this.SearchView&&this.SearchView.objectcount&&-1!=this.SearchView.objectcount,this.PagerOptions.ShowPaging=this.PagerOptions.ShowButtons||this.PagerOptions.ShowCount,this.PagerOptions.ShowPagingOptions=this.PagerOptions.ShowButtons},e.prototype.postBoundSourceCalculation=function(){this.RowContexts=[],this.OrderDirectives=[],this.lastSelectedItemID=null,this.internalPostBoundSource()},e.prototype.internalPostBoundSource=function(){var e=this.View,t=this.EsThsDirective&&this.EsThsDirective.length>0?this.EsThsDirective.toArray():[],i=this.EsTdsDirective&&this.EsTdsDirective.length>0?this.EsTdsDirective.toArray():[];if(this.dynamicMode_H.eventuallyReviewDynamicColumns(),this.bindDisplayToLoadedItemsOrGroups(e),this.setupPagingInformations(),(this.viewMode||this.arrayMode)&&this.UseCustomCells){var n=this.viewMode?e:null,r=this.viewMode?P(n.items||[],n.groups||[]):e,s=this.viewMode?n.selection:this.arraymodeSelection,o=this.columnMetadata_H.expandMultiThsAndTds(t,i,r);if(t=o.expThs,i=o.expTds,!this.arrayMode&&n.report_columns){var a=this.reportMode_H.generateThsAndTdsFromView(n);t=a.ths,i=a.tds}var l=this.columnMetadata_H.evaluateHeadersGroupingInfos(t);this.arrayMode&&(this.items_H.arrayModeReviewOrderings(),this.rowGrouping_H.arrayModeReviewGroupings(l.leafs)),this.columnMetadata_H.reviewColumnsList(l.leafs),this.columnMetadata_H.alignColumnsIfLoadedView(n),this.columnMetadata_H.moveFixedColumnsAtTheBeginning(l.leafs,i),this.columnMetadata_H.alignHeadersOrdering(l.leafs,n),this.columnMetadata_H.refreshColumnsVisibility(l.leafs,i,n),this.columnMetadata_H.evaluatePinnedColumnsWidth(),this.columnMetadata_H.generateDefaultOrder(l.leafs,n),this.columnMetadata_H.evaluateHeaderGroups(l),this.evaluateRowThs(l.leafs),this.evaluateRowTds(l.leafs,i),this.columnMetadata_H.applyOrdering(n,!0),this.MoveTemporaryVariablesToRealOnes(),this.selection_H.evaluateSelection(r,s),this.selection_H.evaluateSingleCellSelection(r,l.leafs,this.DynamicRowColumnsDefinition),this.ResearchNeeded&&(this.changed(),this.emitSearchRequest(!1),this.ResearchNeeded=!1)}else if((this.viewMode||this.arrayMode)&&!this.UseCustomCells){var c=this.viewMode?e.items:e;s=this.viewMode?e.selection:this.arraymodeSelection;this.selection_H.evaluateSelection(c,s)}this.cdr.markForCheck(),this.FirstBind=!1},e.prototype.bindDisplayToLoadedItemsOrGroups=function(e){var t,i;if(!this.TMPBoundSource||0==this.TMPBoundSource.length)return this.BaseItemsCount=0,void(this.boundSource=[]);if(this.arrayMode||!this.UseCustomCells)return this.boundSource=this.TMPBoundSource,void(this.BaseItemsCount=(null==e?void 0:e.objectcount)||(null==e?void 0:e.length)||0);var n=(null===(i=null===(t=null==e?void 0:e.groupings)||void 0===t?void 0:t.filter((function(e){return!e.aggregation})))||void 0===i?void 0:i.length)||0;if(0==n)return this.boundSource=this.TMPBoundSource,void(this.BaseItemsCount=(null==e?void 0:e.objectcount)||0);this.rowGrouping_H.handleNewDataOnRowGrouping(e,n)},e.prototype.MoveTemporaryVariablesToRealOnes=function(){this.RowTDs=this.TMPRowTDs,this.RowTHs=this.TMPRowTHs,this.RowThGroups=this.TMPRowThGroups?this.TMPRowThGroups.reverse():null,this.EmptyRowTds=this.isEmpty(this.RowTDs),this.Columns.Visibile=this.RowTHs.filter((function(e){return e.Visible})).length,this.Columns.VisibleUnpinned=this.RowTHs.filter((function(e){return e.Visible&&!e.Pinned})).length,this.Columns.Global=this.Columns.VisibleUnpinned+(this.HasPinnedColumns?1:0)+(this.Selection?1:0)+(this.Removal?1:0)+(this.Export||this.HiddenColumns||this.ColumnsOrdering||this.CornerMenuOptions?1:0)},e.prototype.isEmpty=function(e){for(var t in e)return!1;return!0},e.prototype.setSelectionStatus=function(e,t,i){var n;if(t){if(!this.SelectAll)return void console.error("Impossibile impostare la selezione con l'all selection quando l'Input SelectAll è false");var r=(null===(n=this.View)||void 0===n?void 0:n.selection)||this.arraymodeSelection;(r.all&&!i||!r.all&&i)&&this.selection_H.selectAllOrResetSelection()}else this.selection_H.handleItemsSelection(e,i);this.cdr.markForCheck()},e.prototype.thOrderChanged=function(e,t){this.viewMode||this.arrayMode?this.OrderByColumn&&this.columnMetadata_H.handleTHOrderChange(e,t):console.warn("Order changed on a table not in viewMode or Array mode. Operation not supported")},e.prototype.emitSearchRequest=function(e,t){this.viewMode&&!t&&(this.View.internalsearchrequest=!0,this.changed()),t&&(e&&(t.page=1),t.internalsearchrequest=!0),this.researchInProgress=!0,this.onSearchRequest.emit(t||e)},e.prototype.evaluateRowTds=function(e,t){if(0!=t.length){for(var i={},n={},r=0;r<this.ColumnsList.length;r++){var s=this.ColumnsList[r];n[s.id]=s}for(var o=0;o<e.length;o++){i[(v=e[o]).th]=v}this.TMPRowTDs={};var a={};for(o=0;o<t.length;o++)for(var l=t[o],c=0;c<this.boundSource.length;c++){var h=this.boundSource[c],p=h._hash,u=l.td;if((v=i[l.td])&&(v._referenced=!0),v&&(l.tdIf||v.thGroup)){var d=v,g=v.thFixed||v.thGroup||v.thPinned,m=h._item?{LeftBorder:d._lbord,RightBorder:d._rbord,ID:u,Pinned:n[l.td].pinned,PinnedWidth:d.thPinnedWidth,GroupHeader:!1,GroupAggregation:!1,Visible:n[l.td].visible,Wraps:!1,Class:l.tdClass,Template:d.thGroup&&!this.ShowItemGroupsColumns?null:l.Template,Multi:l._multi,MultiProp:l._multi?l.td.split("_")[0]:null,MultiIndex:l._multi?l.td.split("_")[1]:null,PropertyName:v.thProperty,PropertyType:v.thType,PropertySource:v.thSource,PropAccessor:l.tdPropertyAccessor}:{LeftBorder:d._lbord,RightBorder:d._rbord,ID:u,Pinned:n[l.td].pinned,PinnedWidth:d.thPinnedWidth,GroupHeader:d.thGroup,GroupAggregation:!!d.thAggregation,Visible:n[l.td].visible,Wraps:!1,Class:d.thGroupClass||"",Content:this.rowGrouping_H.getGroupCellDisplay(h,u,v)};this.TMPRowTDs[p]?this.TMPRowTDs[p].push(m):(this.RowContexts.push(p),this.TMPRowTDs[p]=[m],a[p]=g?1:0)}}if(0!=this.TMPBoundSource.length){var f=[];for(o=0;o<e.length;o++){var v;(v=e[o])._referenced||f.push(v.th)}if(f.length>0)throw"L'ID di uno o più EsTh non hanno alcun EsTd associato: "+f.join(", ")}}},e.prototype.evaluateRowThs=function(e){var t;if(0!=e.length){for(var i={},n=this.View,r=this.viewMode&&(n&&!n.groupings||0==n.groupings.length),s=0;s<this.ColumnsList.length;s++){var o=this.ColumnsList[s];i[o.id]=o}this.TMPRowTHs=[];for(s=0;s<e.length;s++){var a=e[s],l=void 0;if(a.thIf||a.thGroup){var c=(a.thClass||"")+(a.thGroup?" est-col-min":"");if(l={Pinned:i[a.th].pinned,Fixed:a.thFixed,PinnedWidth:a.thPinnedWidth,ID:a.th,Visible:a.thVisible,Class:c,Order:a.thOrder,Orderable:a.thOrderable,Template:a.Template,Content:a.thStaticContent,Wrap:a.thWrap,LeftBorder:a._lbord,RightBorder:a._rbord,Multi:a._multi,MultiContent:a._multi_content},this.TMPRowTHs.push(l),r&&(a.thAggregation||a.thGroup)){var h=this.rowGrouping_H.getGroupAggregations(a);n.groupings?(t=n.groupings).push.apply(t,P(h)):n.groupings=h,this.ResearchNeeded=!0}}}}},e.prototype.addToPageGroup=function(e,t){this.goToPageGroup(t.view.page+e,t)},e.prototype.goToPageGroup=function(e,t){var i=t.view;0===e||e>i.pages&&i.pages>0||(i.page=e,t.buttons=this.utilities_H.getPagesArray(6,i.page,i.pages),this.emitSearchRequest(!1,i))},e.prototype.handleGroupClick=function(e){var t=this.View,i=e;if(i._expanded=!i._expanded,!this.ArrayGrouping){if(i._expanded){if(t.itemsperpageoverride=15,t.requestedgroups)i._grouplevel?(t.requestedgroups=[],i._parentRoute.forEach((function(e){t.requestedgroups.push(new E(e.column,e.value))})),t.requestedgroups.push(new E(e.column,e.value))):t.requestedgroups=[new E(e.column,e.value)];else t.requestedgroups=[new E(e.column,e.value)];this.changed(),this.emitSearchRequest(!0)}else{var n=(i._parent||"")+e.value;this.boundSource=this.boundSource.filter((function(e){return!e._parent||!e._parent.startsWith(n)})),this.groupSearchRequestsCache=this.groupSearchRequestsCache.filter((function(e){return e.path!=n}))}return!0}this.boundSource.filter((function(e){return e._group&&(i._expanded&&e._parent==i._thisKey||!i._expanded&&e._parent&&e._parent.startsWith(i._thisKey))||e._item&&(i._expanded&&e._thisKey==i._thisKey||!i._expanded&&e._thisKey.startsWith(i._thisKey))})).forEach((function(e){e._visible=i._expanded,e._group&&(e._expanded=!1)}))},e.prototype.globalCheckChanged=function(e){void 0===e&&(e=null);var t=this.boundSource.find((function(e){return e._group}))?this.boundSource.filter((function(e){return e._group&&!e._parent})):this.boundSource,i=this.selection_H.handleItemsSelection(t,e,this.globalCheck);this.changed(),this.onSelectionChanged.emit(i)},e.prototype.handleClick=function(e,t){this.selection_H.clearTextSelection(e);var i=[];if(e.shiftKey&&this.ShiftClick&&!this.SingleSelection)for(var n=!1,r=this.boundSource.filter((function(e){return!e._group&&!e._sep})),s=0;s<r.length;s++){var o=r[s];n&&(o._selected=!0,i.push(o)),o!=t&&o!=this.lastSelected||n?o!=t&&o!=this.lastSelected||!n||(n=!1):(n=!0,o._selected=!0,i.push(o))}else t._selected=!t._selected,this.lastSelected=t,i.push(t);var a=this.selection_H.handleItemsSelection(i);return this.changed(),this.onSelectionChanged.emit(a),!0},e.prototype.addToPage=function(e){var t,i=this.MainGroupView?this.MainGroupView:this.View;this.goToPage(((null===(t=this.SearchView||i)||void 0===t?void 0:t.page)||0)+e)},e.prototype.goToPage=function(e){var t,i=this.MainGroupView?this.MainGroupView:this.arrayMode?this.SearchView:this.View;if(i.page&&i.pages){var n=this.SearchView||i;if(!(0===e||e>n.pages&&n.pages>0)){n.page=e;var r=i.items.length||(null===(t=i.groups)||void 0===t?void 0:t.length)||0,s=i.itemsperpageoverride||15;this.arrayPulsanti=this.utilities_H.getPagesArray(6,n.page,n.pages,r,s);var o=!!this.MainGroupView;this.emitSearchRequest(!1,o?i:this.SearchView?this.SearchView:null)}}},e.prototype.onItemsPerPageChanged=function(e){this.PagerOptions.View.itemsperpageoverride=e,this.changed(),this.MainGroupView?this.emitSearchRequest(!0,this.MainGroupView):this.SearchView?(this.SearchView.page=1,this.emitSearchRequest(!0,this.SearchView)):this.emitSearchRequest(!0)},e.prototype.onGroupItemsPerPageChanged=function(e,t){e.view.itemsperpageoverride=t,this.emitSearchRequest(!0,e.view)},e.prototype.autoUpdateChanged=function(){var e=this;/^[1-9]\d*$/.test(this.seconds)||(this.seconds="10");var t=1e3*parseInt(this.seconds,null);this.autoUpdate?this.updateTimer=setInterval((function(){e.emitSearchRequest(!1)}),t):clearInterval(this.updateTimer)},e.prototype.dynamicOperation=function(e,t){this.onDynamicOperation.emit({id:t,item:e})},e.prototype.findEsTd=function(e,t){void 0===t&&(t=null);var i=this.EsTdsDirective.find((function(i){return t?i.td===t:i.tdForProperty===e}));return t&&e&&!i&&(i=this.EsTdsDirective.find((function(t){return t.tdForProperty===e}))),i?i.Template:null},e.prototype.findEditor=function(e,t){void 0===t&&(t=null);var i=this.EsTdEditorDirectives.find((function(i){return t?i.editor===t:i.editorForProperty===e}));return t&&e&&!i&&(i=this.EsTdEditorDirectives.find((function(t){return t.editorForProperty===e}))),i?i.Template:null},e.prototype.arrayAddToPage=function(e){this.arrayGoToPage(this.arraymodePage+e)},e.prototype.arrayGoToPage=function(e){0===e||e>this.arraymodePages||(this.arraymodePage=e,this.internalWriteValue())},e.prototype.cornerActionClicked=function(e){this.onCornerAction.emit({id:e,estable:this})},e.prototype.setMode=function(e){this.viewMode="view"==e,this.arrayMode="array"==e},e.prototype.internalWriteValue=function(){this.internalWriteCall=!0,this.writeValue(this.View),this.internalWriteCall=!1},e.prototype.forceRefresh=function(){var e,t;this.arrayMode&&(e=this.arraymodePage,t=this.ArraymodeItemsPerPage),this.writeValue(this.View),this.cdr.detectChanges(),this.arrayMode&&(this.ArraymodeItemsPerPage=t,this.arrayGoToPage(e))},e.prototype.dbClickEditOrSingleClickRowSelection=function(e,t,i,n){var r=this;if(!t._editing&&!e.ctrlKey)if(e.altKey&&this.RangeSelection)this.selection_H.singleCellSelection(e,i._ordinal,n);else{if(this.Editable)return this.cellDbClickTimer?(this.Editable&&t.PropertyName&&this.setupUserEdit(t,i),void this.clearCellClickTimer()):void(this.cellDbClickTimer=setTimeout((function(){r.clearCellClickTimer(),r.handleRowClick(e,i,r.Selection,!0)}),this.doubleClickBufferMs));this.handleRowClick(e,i,this.Selection,!0)}},e.prototype.handleCopy=function(){var e=this.selection_H.getSelectionStatusSelection();if(e.length>0&&e[0].length>0){var t=this.selection_H.getClipbardTextFromSelection(e);this.clipboardService.copyTextToClipboard(t),this.msgExts.simpleInfo(this.lc.loc("Values copied in the clipboard"),"toastr",1e3)}},e.prototype.handlePaste=function(){var e=this,t=this.selection_H.getSelectionStatusSelection();t.length>0&&t[0].length>0&&this.clipboardService.getClipboard("matrix",(function(i){if(i.length>0&&1==i[i.length-1].length&&""==i[i.length-1][0]&&i.splice(i.length-1,1),i.length>0&&i[0].length>0){if(!e.Editable)return void e.msgExts.simpleWarning(e.lc.loc("Data for this table cannot be edited"));if(!(t.length==i.length&&t[0].length==i[0].length||1==i.length&&1==i[0].length))return void e.msgExts.simpleWarning(e.lc.loc("Size of copied data is different from the size of the selection"));for(var n=[],r=0;r<t.length;r++)for(var s=t[r],o=0;o<s.length;o++){var a=s[o],l=1==i.length&&1==i[0].length?i[0][0]:i[r][o],c=a.value,h=a.val_setter(l),p=e.dateExts.getDateConvertion(c),u=e.dateExts.getDateConvertion(h);p&&u&&p.isSame&&p.isSame(u)||c===h||n.push(new D(a.item,a.header,a.property,c,h))}e.cdr.markForCheck(),n.length>0&&e.onModelChange.emit(n)}}))},e.prototype.clearCellClickTimer=function(){clearTimeout(this.cellDbClickTimer),this.cellDbClickTimer=null},e.prototype.handleRowClick=function(e,t,i,n){if(void 0===n&&(n=!1),e.ctrlKey||this.UseCustomCells&&!n)return!0;this.selection_H.clearSelectionStatus(),!i||t.locked||t._sep||t._group?t._group&&this.handleGroupClick(t):this.handleClick(e,t),this.cdr.markForCheck()},e.prototype.setupUserEdit=function(e,t){var i=this;this.Editable&&e.PropertyName&&(e._editing=!0,e.old_value=t[e.PropertyName]),this.cdr.detectChanges(),setTimeout((function(){i.FocusSubject.next()}))},e.prototype.finalizeUserEdit=function(e,t,i){e._editing=!1;var n=e.old_value,r=t[e.PropertyName],s=this.dateExts.getDateConvertion(n),o=this.dateExts.getDateConvertion(r);s&&o&&s.isSame&&s.isSame(o)||n===r||(this.onModelChange.emit([new D(t,e.ID,e.PropertyName,n,r)]),this.selectionStatus[t._ordinal][i].val_setter(r))},e}();re.decorators=[{type:t.Component,args:[{selector:"es-table",viewProviders:[{provide:i.LocalizationService,useClass:A}],changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,template:'\x3c!-- Patacchino di autoaggiornamento --\x3e\r\n<div class="w-100" *ngIf="AutoUpdate">\r\n <div class="pull-right">\r\n {{\'Update every\' | localize : lc}}&nbsp;<input [readonly]="autoUpdate" maxlength="3" class="form-control est-custom-input" type="text" [(ngModel)]="seconds" />&nbsp;{{\'second/s\' | localize : lc}}\r\n </div>\r\n <div class="pull-right m-t-2">\r\n <label class="est-switch">\r\n <input type="checkbox" [(ngModel)]="autoUpdate" (ngModelChange)="autoUpdateChanged();" />\r\n <div class="est-slider round"></div>\r\n </label>\r\n </div>\r\n <div class="clearfix"></div>\r\n</div>\r\n\r\n<div *ngIf="View" class="est-relative">\r\n <div *ngIf="FirstBind && ShowLoadingOnBootstrap" class="est-loading-box">\r\n <div class="est-loading-content">\r\n <span class="fa fa-spinner fa-spin"></span>&nbsp;{{\'Performing Table bootstrap\' | localize: lc}}...\r\n </div>\r\n </div>\r\n\r\n <div class="est-top-pager" *ngIf="PagingStyle == \'both\' || PagingStyle == \'top\'">\r\n <ng-container *ngTemplateOutlet="pagingElement"></ng-container>\r\n </div>\r\n\r\n <div class="est-top-allselect" *ngIf="canSelectAll || (View?.selection || arraymodeSelection)?.all">\r\n <span>{{ (selectedObjects == -1 ? (\'All the\' | localize : lc) : ((selectedObjects || 0) | number : \'0.0-0\' : locale)) + \' \' + ((selectedObjects == 1 ? \'Object Selected\' : \'Objects Selected\') | localize : lc) }}</span>&nbsp;\r\n <span class="est-link est-inline" (click)="selection_H.selectAllOrResetSelection()">{{ (View?.selection || arraymodeSelection)?.all ? (\'Reset Selection\' | localize : lc) : (\'Select Everything\' | localize : lc)}}</span>\r\n </div>\r\n\r\n <div class="table-responsive datatable {{ContainerClass}}" [style.max-height.px]="MaxHeight">\r\n <table class="{{ TableClass }} est-margin-bottom-10 est" [class.est-high-density]="HighCellDensity">\r\n <thead [hidden]="HeaderHidden || FirstBind">\r\n \x3c!-- Aggiungo il pezzo che gestisce la selezione di tutto se attivo da config --\x3e\r\n <tr *ngIf="(SelectAll && !SingleSelection) || PagingStyle != \'bottom\'">\r\n <th class="est-no-selection" [attr.colspan]="Columns.Global" [class.est-hidden-view]="!canSelectAll && !(View?.selection || arraymodeSelection)?.all && PagingStyle == \'bottom\'">\r\n <p class="est-hidden-view app-margin-bottom-0">§</p>\r\n </th>\r\n </tr>\r\n\r\n \x3c!-- Blocco header group --\x3e\r\n <ng-container *ngIf="RowThGroups">\r\n <tr *ngFor="let level of RowThGroups">\r\n <th *ngFor="let cell of level" [attr.colspan]="cell.Span" \r\n [class.est-pinned-header]="cell.Pinned" [class.est-col-min]="cell.Pinned"\r\n [class.est-ltab-border]="cell.Borders" [class.est-rtab-border]="cell.Borders"\r\n class="est-text-center">\r\n <ng-container *ngIf="cell.Pinned;">\r\n <div class="est-pinned-border est-cell-group-padding"></div>\r\n </ng-container>\r\n <ng-container *ngIf="!cell.Pinned && cell.Content; Else: cell.Template">\r\n {{cell.Content}}\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </ng-container>\r\n\r\n <ng-container *ngIf="!RowThGroups">\r\n <tr *ngIf="HasHeaderGroup">\r\n <ng-container *ngTemplateOutlet="headerGroupRef"></ng-container>\r\n <th *ngIf="Export"></th>\r\n </tr>\r\n \r\n \x3c!-- Blocco header group secondario --\x3e\r\n <tr *ngIf="HasSecondaryHeaderGroup">\r\n <ng-container *ngTemplateOutlet="secondaryHeaderGroupRef"></ng-container>\r\n <th *ngIf="Export"></th>\r\n </tr>\r\n </ng-container>\r\n\r\n \x3c!-- Blocco effettivo degli header --\x3e\r\n <tr>\r\n \x3c!-- Aggiungo una checkbox se la selezione è attiva --\x3e\r\n <th class="est-col-min" *ngIf="Selection && !HasPinnedColumns">\r\n <input *ngIf="!SingleSelection" class="est-pointer" type="checkbox" [disabled]="SelectionDisabled" [(ngModel)]="globalCheck" [ngModelOptions]="{\'standalone\': true}" (ngModelChange)="globalCheckChanged();">\r\n </th>\r\n\r\n \x3c!-- Header che valgono per view mode e array mode --\x3e\r\n <ng-container *ngIf="arrayMode || viewMode">\r\n \x3c!-- In una tabella base prendo semplicemente i th scritti dall\'utente nell\'HTML --\x3e\r\n <ng-container *ngIf="(!UseCustomCells || !RowTHs || RowTHs.length == 0) && !DynamicRowColumnsDefinition">\r\n <ng-container *ngTemplateOutlet="headerRef"></ng-container>\r\n </ng-container>\r\n\r\n \x3c!-- Se ho un modello dinamico dell\'oggetto creo le colonne in base alle proprietà --\x3e\r\n <ng-container *ngIf="(!UseCustomCells || !RowTHs || RowTHs.length == 0) && DynamicRowColumnsDefinition">\r\n <th *ngFor="let operation of DynamicOperations" class="est-col-min est-no-side-padding"></th>\r\n \r\n <ng-container *ngFor="let rowHeader of DynamicRowColumnsDefinition">\r\n <ng-container *ngIf="rowHeader.Visible">\r\n <th *ngIf="OrderByColumn" es-th="{{rowHeader.PropertyName}}" class="{{UserDefinedDynamicCols ? ((rowHeader.Clss || \'\') + (rowHeader.HeaderWraps ? \'\' : \' est-nowrap\')) : \' est-nowrap\'}}" [Order]="rowHeader.DataOrder" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn" [SearchInProgress]="!!researchInProgress" (onOrderChange)="thOrderChanged(rowHeader.PropertyName, $event)">{{rowHeader.Description}}</th>\r\n <th *ngIf="!OrderByColumn" es-th="{{rowHeader.PropertyName}}" class="{{UserDefinedDynamicCols ? ((rowHeader.Clss || \'\') + (rowHeader.HeaderWraps ? \'\' : \' est-nowrap\')) : \' est-nowrap\'}}" [Order]="rowHeader.DataOrder" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn">{{rowHeader.Description}}</th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n \x3c!-- Se non ho un modello dinamico ma invece delle celle custom, genero gli header in base ai row th --\x3e\r\n <ng-container *ngIf="UseCustomCells && RowTHs && RowTHs.length > 0">\r\n <th *ngIf="HasPinnedColumns" class="est-pinned-header est-col-min">\r\n <div [style.width.px]="PinnedContainerWidth" class="est-pinned-border est-simple-border-bottom">\r\n <th class="est-col-min est-no-border" *ngIf="Selection" [style.width.px]="20">\r\n <input *ngIf="!SingleSelection" class="est-pointer" type="checkbox" [disabled]="SelectionDisabled" [(ngModel)]="globalCheck" [ngModelOptions]="{\'standalone\': true}" (ngModelChange)="globalCheckChanged();">\r\n </th>\r\n <ng-container *ngFor="let rowHeader of RowTHs">\r\n <th *ngIf="rowHeader && rowHeader.Visible && rowHeader.Pinned" [style.width.px]="rowHeader.PinnedWidth" es-th="{{rowHeader.ID}}" \r\n class="{{rowHeader.Class || \'\'}}" \r\n [class.est-pinned-internal-header]="true" \r\n [class.est-no-border]="true" \r\n [class.est-nowrap]="!rowHeader.Wrap" \r\n [Pinned]="true" [Fixed]="rowHeader.Fixed" [Order]="rowHeader.Order" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn" [SearchInProgress]="!!researchInProgress" (onUnpinning)="columnMetadata_H.unpinColumn($event)" (onOrderChange)="thOrderChanged(rowHeader.ID, $event)">\r\n <ng-container *ngIf="rowHeader.Template"><ng-container *ngTemplateOutlet="rowHeader.Template; context: { $implicit: rowHeader.Multi ? rowHeader.MultiContent : null } "></ng-container></ng-container>\r\n <span *ngIf="!rowHeader.Template">{{rowHeader.Content}}</span>\r\n </th>\r\n </ng-container>\r\n </div>\r\n </th>\r\n <ng-container *ngFor="let rowHeader of RowTHs">\r\n\r\n <th *ngIf="rowHeader && rowHeader.Visible && !rowHeader.Pinned" es-th="{{rowHeader.ID}}" class="{{rowHeader.Class || \'\'}}" [class.est-ltab-border]="rowHeader.LeftBorder" [class.est-rtab-border]="rowHeader.RightBorder" [class.est-nowrap]="!rowHeader.Wrap" [Order]="rowHeader.Order" [Resizable]="ColumnsResizable" [Orderable]="rowHeader.Orderable" [OrderBy]="OrderByColumn" [SearchInProgress]="!!researchInProgress" (onOrderChange)="thOrderChanged(rowHeader.ID, $event)">\r\n <ng-container *ngIf="rowHeader.Template"><ng-container *ngTemplateOutlet="rowHeader.Template; context: { $implicit: rowHeader.Multi ? rowHeader.MultiContent : null }"></ng-container></ng-container>\r\n <span *ngIf="!rowHeader.Template">{{rowHeader.Content}}</span>\r\n </th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n \x3c!--Per l\'eliminazione mi serve un header aggiuntivo--\x3e\r\n <th *ngIf="Removal" [class.est-right-9]="Export || HiddenColumns" class="est-col-min est-sticky-last-column"><span class="fa fa-trash"></span></th>\r\n\r\n \x3c!--Per l\'esportazione mi serve l\'header extra da cui faccio uscire i 3 pallocchi--\x3e\r\n <th *ngIf="Export || HiddenColumns || ColumnsOrdering || CornerMenuOptions" class="est-table-dotted-menu est-sticky-last-column est-col-min text-sm-center">\r\n \r\n \x3c!-- Link nascosto che serve a scaricare il file --\x3e\r\n <a *ngIf="headers" hidden #exportDownloader csvLink [data]="data" [headers]="headers" [delimiter]="\';\'" [filename]="ExportFileName.endsWith(\'.xlsx\') ? ExportFileName.replace(\'.xlsx\', \'.csv\') : ExportFileName.endsWith(\'.csv\') ? ExportFileName : ExportFileName + \'.csv\'"></a>\r\n\r\n \x3c!-- Blocco con i 3 pallocchi che tira fuori il context menu delle operazioni --\x3e\r\n <div class="btn-group" container="body" placement="bottom right" dropdown #dropdown="bs-dropdown" [autoClose]="true">\r\n <span dropdownToggle class="fa fa-ellipsis-v est-fs-18 est-pointer est-padding-3"></span>\r\n\r\n <div *dropdownMenu class="dropdown-menu dropdown-menu-right est-bring-to-front-strong">\r\n <div class="est-pointer">\r\n <a class="dropdown-item" *ngIf="HiddenColumns || ColumnsOrdering" (click)="columnMetadata_H.resetColumnVisSelection(); changeColumnVisibilityModal.show();">\r\n <ng-container *ngIf="!HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Order\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && !ColumnsOrdering">\r\n {{\'Columns Visibility\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Visibility and Order\' | localize : lc}}\r\n </ng-container>\r\n </a>\r\n <a class="dropdown-item" *ngIf="Export && CSVExport" (click)="export_H.tryExport(\'CSV\')">{{\'Export View\' | localize : lc}} (CSV)</a>\r\n <a class="dropdown-item" *ngIf="Export && XLSXExport" (click)="export_H.tryExport(\'XLSX\')">{{\'Export View\' | localize : lc}} (XLSX)</a>\r\n <a class="dropdown-item" *ngFor="let option of CornerMenuOptions" (click)="cornerActionClicked(option.id)">{{option.description}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody [hidden]="BodyHidden || FirstBind" >\r\n \x3c!--Con selection attiva richiamo il template che gestisce il context menu--\x3e\r\n <ng-container *ngIf="Selection">\r\n <ng-container *ngTemplateOutlet="TBodySelection; context: { $implicit: { selDisabled: arrayMode ? false : SelectionDisabled, sel: Selection }}"></ng-container>\r\n </ng-container>\r\n\r\n \x3c!--Senza selection richiamo il template che NON gestisce il context menu--\x3e\r\n <ng-container *ngIf="!Selection">\r\n <ng-container *ngTemplateOutlet="TBody"></ng-container>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n <div *ngIf="PagingStyle == \'both\' || PagingStyle == \'bottom\'">\r\n <ng-container *ngTemplateOutlet="pagingElement"></ng-container>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Template che contiene tutte le info di paginazione in modo da poterlo replicare anche sopra --\x3e\r\n<ng-template #pagingElement>\r\n <ng-container *ngIf="!FirstBind">\r\n \x3c!-- Pulsanti avanti-indietro di paginazione --\x3e\r\n <div *ngIf="PagerOptions.ShowPaging && PagerOptions.ShowButtons && (PagerOptions.PagerCount > 10 || PagerOptions.PagerCount == -1)" class="pull-right btn-toolbar">\r\n <ng-container *ngIf="View?.pagingavailable || viewMode">\r\n <ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { Margin: true, ATP: addToPage.bind(this), GTP: goToPage.bind(this), Array: arrayPulsanti }}"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf="arrayMode && UseArrayModePaging && !SearchView">\r\n <ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { Margin: true, ATP: arrayAddToPage.bind(this), GTP: arrayGoToPage.bind(this), Array: arrayPulsanti }}"></ng-container>\r\n </ng-container>\r\n </div>\r\n \x3c!-- Paginatore dove appare la count e le opzioni di paginazione --\x3e\r\n <div class="pull-right" *ngIf="PagerOptions.ShowCount || PagerOptions.ShowPagingOptions">\r\n <div class="est-mt-min-5" *ngIf="PagerOptions.ShowPaging">\r\n <app-paging *ngIf="!PagerOptions.UsesView" [CountLabel]="CountLabel" [ShowPaging]="PagerOptions.ShowPagingOptions" [ShowCount]="PagerOptions.ShowCount" [PagerCount]="PagerOptions.PagerCount" [WarnOnAll]="false" [CurrentPageSize]="ArraymodeItemsPerPage" (pagingSelected)="items_H.refreshPaging($event)"></app-paging>\r\n <app-paging *ngIf="PagerOptions.UsesView" [CountLabel]="CountLabel" [ShowPaging]="PagerOptions.ShowPagingOptions" [ShowCount]="PagerOptions.ShowCount" [PagerCount]="PagerOptions.PagerCount" [GroupMode]="PagerOptions.Searches == \'groups\'" [AllSearch]="AllSearch" [View]="PagerOptions.View" (pagingSelected)="onItemsPerPageChanged($event);"></app-paging>\r\n </div>\r\n </div>\r\n <div class="clearfix"></div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\x3c!-- Template che contiene i pulsanti per cambiare pagina --\x3e\r\n<ng-template #pagingButtons let-options>\r\n <div class="est-flex" [class.est-margin-left-50]="options.Margin">\r\n <a class="btn" class="est-page-prev app-pointer" (click)="options.ATP(-1, options.separator)"><span class="fa fa-chevron-left"></span></a>\r\n <div *ngIf="options.Array" class="est-inline"><a *ngFor="let p of options.Array" class="btn est-page-sel {{p.cssClass}}" (click)="options.GTP(p.val, options.separator)">{{p.val}}</a></div>\r\n <a class="btn" class="est-page-next app-pointer" (click)="options.ATP(1, options.separator)"><span class="fa fa-chevron-right"></span></a>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- Questi due template rappresentano effettivamente il body della tabella. essendo il tr l\'unica cosa che davvero cambia, il resto è templatizzato --\x3e\r\n<ng-template #TBodySelection let-templateOptions>\r\n <ng-container *ngFor="let item of boundSource; let even = even; let i=index; trackBy: bodyTrackBy">\r\n <tr *ngIf="item._visible || (!Hierarchy && !ArrayGrouping)" \r\n [class]="item._rowClass ? item._rowClass : \'\'" \r\n [class.est-line-through]="item.removed || item.deleted" \r\n [class.est-pointer]="!item.locked" \r\n [class.est-white-selected]="item._selected && !item.locked"\r\n [class.est-rg]="item._group"\r\n [class.est-rg-sep]="item._sep"\r\n [contextMenu]="!item.locked ? (ContextMenu || emptyMenu) : emptyMenu" [contextMenuSubject]="item"\r\n (click)="handleRowClick($event, item, true)">\r\n\r\n <td *ngIf="!item.locked && !item._sep && !HasPinnedColumns">\r\n <input type="checkbox" \r\n [disabled]="templateOptions.selDisabled" \r\n [class.est-pointer]="!item.locked"\r\n [(ngModel)]="item._selected" name="check{{i}}" \r\n (click)="$event.stopPropagation(); handleClick($event, item);">\r\n </td>\r\n <td *ngIf="(item.locked || item._sep) && !HasPinnedColumns"></td>\r\n\r\n <ng-container *ngIf="item._sep"><ng-container *ngTemplateOutlet="groupPager; context: { $implicit: item }"></ng-container> </ng-container>\r\n\r\n <ng-container *ngIf="!item._sep">\r\n <ng-container *ngTemplateOutlet="basicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="dynamicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="customCells; context: { $implicit: item, templateOptions: templateOptions }"></ng-container>\r\n </ng-container>\r\n <ng-container *ngTemplateOutlet="bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}"></ng-container>\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #TBody>\r\n <ng-container *ngFor="let item of boundSource; let even = even;">\r\n <tr *ngIf="item._visible || !Hierarchy" \r\n [class]="item._rowClass ? item._rowClass : \'\'" \r\n [class.est-line-through]="item.removed || item.deleted"\r\n [class.est-rg]="item._group"\r\n [class.est-rg-sep]="item._sep"\r\n (click)="handleRowClick($event, item, false)">\r\n\r\n <ng-container *ngIf="item._sep"><ng-container *ngTemplateOutlet="groupPager; context: { $implicit: item }"></ng-container></ng-container>\r\n\r\n <ng-container *ngIf="!item._sep">\r\n <ng-container *ngTemplateOutlet="basicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="dynamicColumns; context: { $implicit: item }"></ng-container>\r\n <ng-container *ngTemplateOutlet="customCells; context: { $implicit: item }"></ng-container>\r\n </ng-container>\r\n <ng-container *ngTemplateOutlet="bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}"></ng-container>\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #groupPager let-item>\r\n <td class="est-pinned-body " *ngIf="HasPinnedColumns"><div class="est-pinned-border est-cell-group-padding"></div></td>\r\n <td *ngIf="item._grouplevel > 1" [attr.colspan]="item._grouplevel-1"></td>\r\n <td [attr.colspan]="Columns.VisibleUnpinned - (item._grouplevel > 0 ? item._grouplevel - 1 : 0)">\r\n <div class="est-rg-sep-flex-right" *ngIf="RowGroupingPagingStyle == \'right\'">\r\n <div class="est-rg-page"><ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { separator: item, ATP: addToPageGroup.bind(this), GTP: goToPageGroup.bind(this), Array: item.buttons }}"></ng-container></div>\r\n <div class="est-rg-ipp" *ngIf="(item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount) > 10"><app-paging [CountLabel]="CountLabel" [AllSearch]="AllSearch" [GroupMode]="item.searches == \'groups\'" [PagerCount]="item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount" [View]="item.view" (pagingSelected)="onGroupItemsPerPageChanged(item, $event);"></app-paging></div>\r\n </div>\r\n\r\n <div class="est-rg-sep-flex-left" *ngIf="RowGroupingPagingStyle == \'left\'">\r\n <div class="est-rg-ipp"><app-paging [AllSearch]="AllSearch" [CountLabel]="CountLabel" [GroupMode]="item.searches == \'groups\'" [PagerCount]="item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount" [View]="item.view" (pagingSelected)="onGroupItemsPerPageChanged(item, $event);"></app-paging></div>\r\n <div class="est-rg-page" *ngIf="(item.searches == \'groups\' ? item.view.groupcount : item.view.objectcount) > 10"><ng-container *ngTemplateOutlet="pagingButtons; context: { $implicit: { separator: item, ATP: addToPageGroup.bind(this), GTP: goToPageGroup.bind(this), Array: item.buttons }}"></ng-container></div>\r\n </div>\r\n </td>\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene la print condizionale su tabelle semplici, con header e body scritti a manazza --\x3e\r\n<ng-template #basicColumns let-item>\r\n <ng-container *ngIf="(!UseCustomCells || EmptyRowTds) && !DynamicRowColumnsDefinition">\r\n <ng-container *ngTemplateOutlet="bodyRef; context : {$implicit: item}"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene la print condizionale su tabelle definite in maniera dinamica dal modello --\x3e\r\n<ng-template #dynamicColumns let-item>\r\n <ng-container *ngIf="(!UseCustomCells || EmptyRowTds) && DynamicRowColumnsDefinition">\r\n <ng-container *ngFor="let operation of DynamicOperations; let first = first; let last = last;">\r\n <ng-container *ngIf="!operation.conditionField || (item.properties[operation.conditionField] == operation.conditionValue)">\r\n <td [class.est-no-right-padding]="last" [class.est-no-left-padding]="!first" class="est-col-min"><span title="{{operation.title}}" class="{{operation.iconClass}} est-pointer" (click)="dynamicOperation(item, operation.id)">{{operation.text}}</span></td>\r\n </ng-container>\r\n <ng-container *ngIf="operation.conditionField && (item.properties[operation.conditionField] != operation.conditionValue)">\r\n <td class="est-col-min est-no-side-padding"></td>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngFor="let rowItem of DynamicRowColumnsDefinition; let i = index">\r\n\r\n <ng-container *ngIf="rowItem.RoutePath && rowItem.Visible">\r\n <td es-td="{{rowItem.PropertyName}}" class="{{UserDefinedDynamicCols ? rowItem.Clss : \'est-nowrap\'}}" [Internal]="false" [Context]="item._hash">\r\n <a [routerLink]="dynamicMode_H.generateRouterLink(rowItem.RoutePath, rowItem.RouteParameterProperties, item)" class="est-link" [innerHTML]="item.properties[rowItem.PropertyName]"></a>\r\n </td>\r\n </ng-container>\r\n\r\n <ng-container *ngIf="!rowItem.RoutePath && rowItem.Visible">\r\n <td es-td="{{rowItem.PropertyName}}" [class.est-selected-cell]="selectionStatus[item._ordinal][i].selected" \r\n (click)="dbClickEditOrSingleClickRowSelection($event, rowItem, item, i)" \r\n class="{{UserDefinedDynamicCols ? rowItem.Clss : \'est-nowrap\'}}" \r\n [Internal]="false" \r\n [class.est-no-selection]="!!Editable"\r\n [Context]="item._hash">\r\n\r\n <div [class.est-edit-hidden]="rowItem._editing" >\r\n <ng-container *ngTemplateOutlet="findEsTd(rowItem.PropertyName, rowItem.RendererName) || defaultEsTd; context: { $implicit: {value: item.properties[rowItem.PropertyName], type: rowItem.PropertyType} }"></ng-container>\r\n </div>\r\n <div *ngIf="rowItem._editing" class="est-mt-min-5">\r\n <ng-container *ngTemplateOutlet="findEditor(rowItem.PropertyName, rowItem.EditorName) || defaultEditor; context: { $implicit: { definition: rowItem, columnIndex: i, item: item, finalizer: finalizeUserEdit.bind(this, rowItem, item, i) } }"></ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #defaultEditor let-ctx>\r\n <ng-container *ngIf="ctx.item.properties">\r\n <form-adaptive [FormLayout]="false" [Validation]="false" [FocusSubject]="FocusSubject" [(ngModel)]="ctx.item.properties[ctx.definition.PropertyName]" name="{{ ctx.definition.PropertyName + \'_\' + ctx.item._hash }}" [Type]="ctx.definition.propertyType" [Source]="ctx.definition.propertySource" (inputFinalized)="ctx.finalizer()"></form-adaptive>\r\n </ng-container>\r\n <ng-container *ngIf="!ctx.item.properties">\r\n <form-adaptive [FormLayout]="false" [Validation]="false" [FocusSubject]="FocusSubject" [(ngModel)]="ctx.item[ctx.definition.PropertyName]" name="{{ ctx.definition.PropertyName + \'_\' + ctx.item._hash }}" [Type]="ctx.definition.propertyType" [Source]="ctx.definition.propertySource" (inputFinalized)="ctx.finalizer()"></form-adaptive>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #defaultEsTd let-valType>\r\n \x3c!-- Formattare il valore in base a valType.type --\x3e\r\n {{valType.value}}\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene la print condizionale delle celle custom se configurate --\x3e\r\n<ng-template #customCells let-item let-opt="templateOptions">\r\n <ng-container *ngIf="UseCustomCells && !EmptyRowTds">\r\n\r\n <td *ngIf="HasPinnedColumns" \r\n class="est-pinned-body est-col-min" [class.est-white-selected]="item._selected">\r\n <div [style.width.px]="PinnedContainerWidth" class="est-pinned-border">\r\n <td *ngIf="!item.locked && !item._sep && Selection" class="est-no-border est-col-min" [style.width.px]="20">\r\n <input type="checkbox" [disabled]="opt.selDisabled" [class.est-pointer]="!item.locked" [(ngModel)]="item._selected" name="check{{item._hash}}" (click)="$event.stopPropagation(); handleClick($event, item);">\r\n </td>\r\n <td class="est-no-border est-col-min" *ngIf="(item.locked || item._sep) && Selection" [style.width.px]="20"></td>\r\n\r\n <ng-container *ngFor="let rowItem of RowTDs[item._hash]; let i = index">\r\n <td *ngIf="rowItem && rowItem.Pinned" [style.width.px]="rowItem.PinnedWidth" es-td="{{rowItem.ID}}" class="{{rowItem.Class}}" [class.est-no-selection]="Editable &&!!rowItem.PropertyName" [class.est-no-border]="true" [class.est-rg-hdr]="rowItem.GroupHeader" [class.est-rg-agg]="rowItem.GroupAggregation" \r\n [class.est-nowrap]="Hierarchy || !rowItem.Wraps" [Internal]="true" (click)="dbClickEditOrSingleClickRowSelection($event, rowItem, item, i)">\r\n\r\n <div [class.est-edit-hidden]="rowItem._editing" [class.est-pre]="!(Hierarchy && i == 0)">\r\n <ng-container *ngIf="Hierarchy && i == 0"><ng-container *ngTemplateOutlet="HierarchyNavigator; context: { $implicit: rowItem.Multi ? (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) : item }"></ng-container></ng-container>\r\n <ng-container *ngIf="!rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: rowItem.Multi ? (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) : item }"></ng-container></ng-container>\r\n <span *ngIf="rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) }"></ng-container></span>\r\n <ng-container *ngIf="!rowItem.Template && !rowItem.Multi">\r\n <span *ngIf="rowItem.Content && !rowItem.PropAccessor">{{rowItem.Content}}</span>\r\n <span *ngIf="!rowItem.Content && rowItem.PropAccessor">{{item.values? item.values[rowItem.PropAccessor] : item[rowItem.PropAccessor]}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf="rowItem._editing" class="est-mt-min-5">\r\n <ng-container *ngTemplateOutlet="findEditor(rowItem.PropertyName) || defaultEditor; context: { $implicit: { definition: rowItem, columnIndex: i, item: item, finalizer: finalizeUserEdit.bind(this, rowItem, item, i) } }"></ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n </div>\r\n </td>\r\n\r\n <ng-container *ngFor="let rowItem of RowTDs[item._hash]; let i = index">\r\n <ng-container *ngIf="rowItem && !rowItem.Pinned">\r\n\r\n \x3c!-- Casistica senza bodyRef, quindi con direttive per i td --\x3e\r\n <ng-container *ngIf="!bodyRef && rowItem.Visible">\r\n <td es-td="{{rowItem.ID}}" class="{{rowItem.Class}}" [class.est-selected-cell]="selectionStatus[item._ordinal][i].selected" [class.est-ltab-border]="rowItem.LeftBorder" [class.est-rtab-border]="rowItem.RightBorder" [class.est-no-selection]="Editable && !!rowItem.PropertyName" [class.est-rg-hdr]="rowItem.GroupHeader" [class.est-rg-agg]="rowItem.GroupAggregation" \r\n [class.est-nowrap]="Hierarchy || !rowItem.Wraps" [Internal]="true" \r\n (click)="dbClickEditOrSingleClickRowSelection($event, rowItem, item, i)">\r\n\r\n <div [class.est-edit-hidden]="rowItem._editing" [class.est-pre]="!(Hierarchy && i == 0)" >\r\n <ng-container *ngIf="Hierarchy && i == 0"><ng-container *ngTemplateOutlet="HierarchyNavigator; context: { $implicit: item }"></ng-container></ng-container>\r\n <ng-container *ngIf="!rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: item }"></ng-container></ng-container>\r\n <span *ngIf="rowItem.Multi && rowItem.Template"><ng-container *ngTemplateOutlet="rowItem.Template; context: { $implicit: (item[rowItem.MultiProp] ? item[rowItem.MultiProp][rowItem.MultiIndex] : {}) }"></ng-container></span>\r\n <ng-container *ngIf="!rowItem.Template && !rowItem.Multi">\r\n <span *ngIf="rowItem.Content && !rowItem.PropAccessor">{{rowItem.Content}}</span>\r\n <span *ngIf="!rowItem.Content && rowItem.PropAccessor">{{item.values? item.values[rowItem.PropAccessor] : item[rowItem.PropAccessor]}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf="rowItem._editing" class="est-mt-min-5">\r\n <ng-container *ngTemplateOutlet="findEditor(rowItem.PropertyName) || defaultEditor; context: { $implicit: { definition: rowItem, columnIndex: i, item: item, finalizer: finalizeUserEdit.bind(this, rowItem, item, i) } }"></ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #HierarchyNavigator let-item>\r\n <span *ngIf="!item.parent" class="fa fa-chevron-down" style="visibility:hidden"></span>\r\n <span *ngIf="item.parent && item._expanded" class="fa fa-chevron-down est-pointer est-no-selection" (click)="hierarchyMode_H.collapseParent(item[this.OwnKey])"></span>\r\n <span *ngIf="item.parent && !item._expanded" class="fa fa-chevron-up est-pointer est-no-selection" (click)="hierarchyMode_H.expandParent(item[this.OwnKey])"></span>\r\n &nbsp;\r\n</ng-template>\r\n\r\n\x3c!-- Questo template contiene i pulsanti di eliminazione/undo eliminazione ed esportazione che vanno in fondo ad un record edlla tabella --\x3e\r\n<ng-template #bodyDeleteAndExport let-options>\r\n <ng-container *ngIf="Removal && !RemovalCondition">\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="!(options.item.removed || options.item.deleted)"><span class="fa fa-remove est-pointer text-danger" [hidden]="options.item.removable != undefined && !options.item.removable" (click)="onRemoval.emit(options.item)"></span></td>\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="(options.item.removed || options.item.deleted)"><span class="fa fa-undo text-warning est-pointer" (click)="onAbortRemoval.emit(options.item)"></span></td>\r\n </ng-container>\r\n <ng-container *ngIf="Removal && RemovalCondition">\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="!(options.item.removed || options.item.deleted) && options.item[RemovalCondition]"><span class="fa fa-remove est-pointer text-danger" [hidden]="options.item.removable != undefined && !options.item.removable" (click)="onRemoval.emit(options.item)"></span></td>\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="(options.item.removed || options.item.deleted) && options.item[RemovalCondition]"><span class="fa fa-undo text-warning est-pointer" (click)="onAbortRemoval.emit(options.item)"></span></td>\r\n <td class="est-sticky-last-column{{options.even? \'-alt\' : \'\'}} {{Export || HiddenColumns || CornerMenuOptions ? \'est-right-9\' : \'\'}}" *ngIf="!options.item[RemovalCondition]"><span class="fa fa-remove est-hidden-view"></span></td>\r\n </ng-container>\r\n <td *ngIf="Export || HiddenColumns || CornerMenuOptions" class="est-sticky-last-column{{options.even && !Hierarchy ? \'-alt\' : \'\'}}"></td>\r\n</ng-template>\r\n\r\n\x3c!-- Context menu vuoto default per tutte le tabella che non ce l\'hanno, in modo che al click destro appaia "nessuna op disponibile" --\x3e\r\n<context-menu #emptyMenu>\r\n <ng-template contextMenuItem>\r\n <span>\r\n <em>{{\'No operations available\' | localize : lc}}...</em>\r\n </span>\r\n </ng-template>\r\n</context-menu>\r\n\r\n\x3c!-- Modal per cambiare posizione e visibilità delle colonne dell\'es-table --\x3e\r\n<div bsModal #changeColumnVisibilityModal="bs-modal" class="modal fade" role="dialog" aria-hidden="true">\r\n <div class="modal-dialog modal-lg" cdkDrag>\r\n <div class="modal-content">\r\n <div class="modal-header est-pointer" cdkDragHandle>\r\n <h5 class="modal-title pull-left">\r\n <ng-container *ngIf="!HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Order\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && !ColumnsOrdering">\r\n {{\'Columns Visibility\' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf="HiddenColumns && ColumnsOrdering">\r\n {{\'Columns Visibility and Order\' | localize : lc}}\r\n </ng-container>\r\n </h5>\r\n <button type="button" class="close pull-right" (click)="changeColumnVisibilityModal.hide();" aria-label="Close">\r\n <span aria-hidden="true">&times;</span>\r\n </button>\r\n </div>\r\n <div class="modal-body">\r\n <div *ngIf="!TMPColumnsList || TMPColumnsList.length == 0" class="card card-info est-padding-10 est-margin-bottom-0">\r\n {{\'There are no columns configured to be hidden/shown in this view\' | localize : lc}}\r\n </div>\r\n <div *ngIf="TMPColumnsList && TMPColumnsList.length > 0" style="max-height:500px; overflow-y:auto">\r\n \x3c!--Aaaaaaah la tristezza... qui mi servirebbe l\'es-table per facilitare la selezione multipla ecc... peccato che se la linko qui entro in un loop impressionante--\x3e\r\n <table class="table table-striped table-sm est-margin-bottom-0">\r\n <thead>\r\n <tr>\r\n <th class="est-col-min" *ngIf="HiddenColumns">\r\n <input class="est-pointer" type="checkbox" [(ngModel)]="globalColVisCheck" [ngModelOptions]="{\'standalone\': true}" (ngModelChange)="columnMetadata_H.globalColVisCheckChanged();">\r\n </th>\r\n \x3c!-- <th class="est-col-min" *ngIf="ColumnsOrdering"></th> --\x3e\r\n <th class="est-col-min est-nowrap">{{\'Column Name\' | localize : lc}}</th>\r\n \x3c!--Filler--\x3e\r\n <th></th>\r\n \x3c!-- Pinner --\x3e\r\n <th *ngIf="DirectivesBased" class="est-col-min"></th>\r\n </tr>\r\n </thead>\r\n <tbody \r\n cdkDropList \r\n [cdkDropListData]="TMPColumnsList" \r\n (cdkDropListDropped)="columnMetadata_H.columnReordered($event)" \r\n [cdkDropListSortPredicate]="columnMetadata_H.sortPredicate.bind(this.columnMetadata_H)"\r\n class="est-dropbox">\r\n\r\n <tr *ngFor="let item of TMPColumnsList; let i = index; let last = last" \r\n class="est-pointer est-droplist" \r\n [class.est-white-selected]="lastSelectedItemID == item.id" \r\n [class.est-no-selection]="!item.visible"\r\n cdkDrag\r\n [cdkDragData]="item"\r\n [cdkDragDisabled]="!ColumnsOrdering || item.fixed || item.pinned">\r\n\r\n <td *ngIf="HiddenColumns">\r\n <input type="checkbox" [class.est-hidden-view]="item.fixed" class="est-pointer" [(ngModel)]="item.visible" name="visible{{i}}" (ngModelChange)="columnMetadata_H.updateGlobalColVisCheck();" />\r\n </td>\r\n <td class="est-nowrap drag-visible" (click)="columnMetadata_H.columnClicked(item);">\r\n <ng-container *ngIf="item.template">\r\n \x3c!-- Padri --\x3e\r\n <span *ngIf="item.parentTemplates && item.parentTemplates.length > 0" class="est-fw-bold est-fs-13">\r\n (&nbsp;\r\n <ng-container *ngFor="let parent of item.parentTemplates; let last=last">\r\n <ng-container *ngIf="parent.tmpl"><ng-container *ngTemplateOutlet="parent.tmpl"></ng-container></ng-container>\r\n <ng-container *ngIf="parent.content">{{parent.content}}</ng-container>\r\n <span *ngIf="!last">&nbsp;-&nbsp;</span>\r\n </ng-container>\r\n &nbsp;)\r\n </span>\r\n \x3c!-- Template header originale --\x3e\r\n <ng-container *ngTemplateOutlet="item.template; context: { $implicit: item.multi ? item.multiContent : null }"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf="!item.template">{{item.description}}</ng-container>\r\n </td>\r\n \x3c!--Filler--\x3e\r\n <td (click)="columnMetadata_H.columnClicked(item);"></td>\r\n \x3c!-- Pinner --\x3e\r\n <td *ngIf="DirectivesBased && ColumnsPinnable"><span *ngIf="!item.fixed && item.pinnable" class="fa fa-thumb-tack" [class.text-success]="item.pinned" (click)="columnMetadata_H.pinOrUnpinColumn(item)"></span></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n <div class="modal-footer">\r\n <button type="button" class="btn btn-secondary est-margin-right-10" (click)="lastSelectedItemID = null; changeColumnVisibilityModal.hide();">{{\'Close\' | localize : lc}}</button>\r\n <button type="button" [disabled]="!TMPColumnsList || TMPColumnsList.length == 0" class="btn btn-primary" (click)="columnMetadata_H.confirmColumnVisibilitySelection() && changeColumnVisibilityModal.hide()">{{\'Confirm\' | localize : lc}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>',styles:['.est-loading-box{height:200px;text-align:center;position:relative;background:#ccc}.est-loading-content{margin:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:35px}.est-scrollable{max-height:600px;overflow:auto}.est-head-resizer{top:0;right:0;bottom:0;width:7px;position:absolute;cursor:col-resize}.est-head-resizer-internal{top:0;right:0;left:6px;bottom:0;width:1px;position:absolute;background-color:#ccc;height:100%}.est-pointer{cursor:pointer}.est-high-density td,.est-high-density th{padding:0 .2rem}.est-no-selection{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.est-edit-hidden{height:1px!important}.est-edit-hidden,.est-hidden-view{visibility:hidden}.est-no-border{border:none!important}.est-nowrap{white-space:nowrap}.est-mt-min-5{margin-top:-5px}.est-white-selected{background-color:#ddd!important}.est-line-through{text-decoration:line-through}.est-no-side-padding{padding-left:0;padding-right:0}.est-no-left-padding,.est-no-right-padding{padding-left:0}.est-col-min{width:1px}.est-margin-bottom-0{margin-bottom:0!important}.est-margin-right-10{margin-right:10px!important}.est-right-9{right:9px!important}.est-table-dotted-menu{padding:0 0 2px!important;color:#999}.est-fs-18{font-size:18px}.est-fs-13,.est-fs-14{font-size:14px}.est-fw-bold{font-weight:700}.est-padding-3{padding:3px!important}.est-page-container{position:relative}.est-bring-to-front-strong{z-index:99999999!important}.est-switch{position:relative;display:inline-block;width:30px;height:17px;margin-bottom:0;margin-right:5px;margin-left:5px}.est-switch input{display:none}.est-slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc}.est-slider,.est-slider:before{position:absolute;transition:.4s}.est-slider:before{content:"";height:13px;width:13px;left:3px;bottom:2px;background-color:#fff}input:checked+.est-slider{background-color:#2196f3}input:focus+.est-slider{box-shadow:0 0 1px #2196f3}input:checked+.est-slider:before{transform:translateX(11px)}.est-slider.round{border-radius:10px}.est-slider.round:before{border-radius:50%}.est-custom-input{width:30px;display:inline;padding:1px;height:20px}.est-row-lvl-1 td:first-child{padding-left:5px}.est-row-lvl-2 td:first-child{padding-left:20px}.est-row-lvl-3 td:first-child{padding-left:35px}.est-row-lvl-4 td:first-child{padding-left:50px}.est-row-lvl-5 td:first-child{padding-left:65px}.est-row-lvl-6 td:first-child{padding-left:80px}.est-row-lvl-7 td:first-child{padding-left:95px}.est-row-lvl-8 td:first-child{padding-left:110px}.est-row-lvl-9 td:first-child{padding-left:125px}.est-row-lvl-10 td:first-child{padding-left:140px}.est-row-lvl-11 td:first-child{padding-left:155px}.est-row-lvl-12 td:first-child{padding-left:170px}.est-row-lvl-13 td:first-child{padding-left:185px}.est-row-lvl-14 td:first-child{padding-left:200px}.est-row-lvl-15 td:first-child{padding-left:215px}.est-row-lvl-16 td:first-child{padding-left:230px}.est-row-lvl-17 td:first-child{padding-left:245px}.est-row-lvl-18 td:first-child{padding-left:260px}.est-row-lvl-19 td:first-child{padding-left:275px}.est-row-lvl-20 td:first-child{padding-left:290px}.est-row-lvl-21 td:first-child{padding-left:305px}.est-row-lvl-22 td:first-child{padding-left:320px}.est-row-lvl-23 td:first-child{padding-left:335px}.est-row-lvl-24 td:first-child{padding-left:350px}.est-row-lvl-25 td:first-child{padding-left:365px}.est-row-lvl-26 td:first-child{padding-left:380px}.est-row-lvl-27 td:first-child{padding-left:395px}.est-row-lvl-28 td:first-child{padding-left:410px}.est-row-lvl-29 td:first-child{padding-left:425px}.est-row-lvl-30 td:first-child{padding-left:440px}.est-row-lvl-31 td:first-child{padding-left:455px}.est-row-lvl-32 td:first-child{padding-left:470px}.est-row-lvl-33 td:first-child{padding-left:485px}.est-row-lvl-34 td:first-child{padding-left:500px}.est-row-lvl-35 td:first-child{padding-left:515px}.est-row-lvl-36 td:first-child{padding-left:530px}.est-row-lvl-37 td:first-child{padding-left:545px}.est-row-lvl-38 td:first-child{padding-left:560px}.est-row-lvl-39 td:first-child{padding-left:575px}.est-row-lvl-40 td:first-child{padding-left:590px}.est-row-lvl-41 td:first-child{padding-left:605px}.est-row-lvl-42 td:first-child{padding-left:620px}.est-row-lvl-43 td:first-child{padding-left:635px}.est-row-lvl-44 td:first-child{padding-left:650px}.est-row-lvl-45 td:first-child{padding-left:665px}.est-row-lvl-46 td:first-child{padding-left:680px}.est-row-lvl-47 td:first-child{padding-left:695px}.est-row-lvl-48 td:first-child{padding-left:710px}.est-row-lvl-49 td:first-child{padding-left:725px}.est-row-lvl-50 td:first-child{padding-left:740px}.est-row-lvl-51 td:first-child{padding-left:755px}.est-row-lvl-52 td:first-child{padding-left:770px}.est-row-lvl-53 td:first-child{padding-left:785px}.est-row-lvl-54 td:first-child{padding-left:800px}.est-row-lvl-55 td:first-child{padding-left:815px}.est-row-lvl-56 td:first-child{padding-left:830px}.est-row-lvl-57 td:first-child{padding-left:845px}.est-row-lvl-58 td:first-child{padding-left:860px}.est-row-lvl-59 td:first-child{padding-left:875px}.est-row-lvl-60 td:first-child{padding-left:890px}.est-row-lvl-61 td:first-child{padding-left:905px}.est-row-lvl-62 td:first-child{padding-left:920px}.est-row-lvl-63 td:first-child{padding-left:935px}.est-row-lvl-64 td:first-child{padding-left:950px}.est-row-lvl-65 td:first-child{padding-left:965px}.est-row-lvl-66 td:first-child{padding-left:980px}.est-row-lvl-67 td:first-child{padding-left:995px}.est-row-lvl-68 td:first-child{padding-left:1010px}.est-row-lvl-69 td:first-child{padding-left:1025px}.est-row-lvl-70 td:first-child{padding-left:1040px}.est-row-lvl-71 td:first-child{padding-left:1055px}.est-row-lvl-72 td:first-child{padding-left:1070px}.est-row-lvl-73 td:first-child{padding-left:1085px}.est-row-lvl-74 td:first-child{padding-left:1100px}.est-row-lvl-75 td:first-child{padding-left:1115px}.est-row-lvl-76 td:first-child{padding-left:1130px}.est-row-lvl-77 td:first-child{padding-left:1145px}.est-row-lvl-78 td:first-child{padding-left:1160px}.est-row-lvl-79 td:first-child{padding-left:1175px}.est-row-lvl-80 td:first-child{padding-left:1190px}.est-row-lvl-81 td:first-child{padding-left:1205px}.est-row-lvl-82 td:first-child{padding-left:1220px}.est-row-lvl-83 td:first-child{padding-left:1235px}.est-row-lvl-84 td:first-child{padding-left:1250px}.est-row-lvl-85 td:first-child{padding-left:1265px}.est-row-lvl-86 td:first-child{padding-left:1280px}.est-row-lvl-87 td:first-child{padding-left:1295px}.est-row-lvl-88 td:first-child{padding-left:1310px}.est-row-lvl-89 td:first-child{padding-left:1325px}.est-row-lvl-90 td:first-child{padding-left:1340px}.est-row-lvl-91 td:first-child{padding-left:1355px}.est-row-lvl-92 td:first-child{padding-left:1370px}.est-row-lvl-93 td:first-child{padding-left:1385px}.est-row-lvl-94 td:first-child{padding-left:1400px}.est-row-lvl-95 td:first-child{padding-left:1415px}.est-row-lvl-96 td:first-child{padding-left:1430px}.est-row-lvl-97 td:first-child{padding-left:1445px}.est-row-lvl-98 td:first-child{padding-left:1460px}.est-row-lvl-99 td:first-child{padding-left:1475px}.est-relative{position:relative}.est-top-pager{position:absolute;right:0;top:5px}.est-top-allselect{position:absolute;left:0;top:5px;font-weight:700}.est-padding-10{padding:10px!important}.est-margin-right-50{margin-right:50px}.est-margin-left-50{margin-left:50px}.est-quick-unpin{color:#000;margin-left:8px;font-size:14px;transform:rotate(45deg)}.est-page-sel{color:#000;margin-left:3px;margin-right:3px;padding:0 5px;font-size:inherit;border:none;border-radius:15px}.est-page-next,.est-page-prev{color:#000;font-size:inherit;padding:2px 0 0}.est-pinned-header{background-color:#fff;left:0;top:0;position:-webkit-sticky;position:sticky;z-index:1;border-bottom:1px solid #dee2e6!important;padding:0!important}.est-simple-border-bottom{border-bottom:1px solid #dee2e6}.est-pinned-internal-header{border-top:0;border-bottom:0 solid #dee2e6}.est-pinned-border{border-right:2px solid #dee2e6!important}.est-cell-padding{padding:.3rem}.est-pinned-body{background-color:#fff;left:0;position:-webkit-sticky;position:sticky;z-index:1;border-top:1px solid #dee2e6!important;padding:0!important}.est-inline{display:inline!important}.est-inline-block{display:inline-block!important}.est-link{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block}.est-link:hover{color:#23527c!important;cursor:pointer;text-decoration:underline!important}.est-sticky-last-column{right:-1px;position:-webkit-sticky;position:sticky;z-index:0;background-color:#fff}.est-sticky-last-column-alt{right:-1px;position:-webkit-sticky;position:sticky;z-index:0;background-color:#f2f2f2}.est-ltab-border{border-left:1px solid #bbb}.est-rtab-border{border-right:1px solid #bbb}.est-cell-group-padding{padding:calc(.3rem + 1px);position:absolute;top:0;left:0;height:100%;width:100%}.est-selected-cell{background-color:rgba(33,150,243,.2)}.est-margin-bottom-10{margin-bottom:10px}.est-text-center{text-align:center}.est-flex{display:flex}.est-rg-sep-flex-right{display:flex;flex-direction:row-reverse;width:100%;margin:-5px}.est-rg-sep-flex-left{display:flex;flex-direction:row;width:100%;margin:-5px}.est-rg-hdr{font-weight:700}.est-rg-agg{font-style:italic}.est-rg{background-color:hsla(0,0%,46.7%,.4666666666666667)!important}.est-rg-sep{font-size:12px;padding-right:20px!important;background-color:hsla(0,0%,73.3%,.7333333333333333)!important}.est-rg-ipp{text-align:left;display:inline-flex;margin-right:25px}.est-rg-page{text-align:right;display:inline-flex;font-size:inherit;padding-top:5px}.est-droplist.cdk-drag-placeholder{opacity:0}.est-droplist.cdk-drag-preview{z-index:999999999!important;opacity:1;box-sizing:border-box;border-radius:4px;background-color:#fff;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.est-droplist.cdk-drag-preview td:not(.drag-visible){visibility:hidden}.est-droplist.cdk-drag-preview td.drag-visible{padding-top:3px}.est-droplist.cdk-drag-animating,.est-droplist.cdk-drop-list-dragging .est-dropbox:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.est-pre{white-space:pre}.est val-datetime .mat-form-field-appearance-outline .mat-form-field-infix input{margin-bottom:3px!important;min-width:130px!important}.est .mat-form-field-flex{height:29px!important;padding:0!important}.est .mat-form-field-flex .mat-form-field-outline{color:#00f}.est .mat-form-field-flex .mat-form-field-outline .mat-form-field-outline-start{border-left:none;border-top:none;border-radius:0}.est .mat-form-field-flex .mat-form-field-outline .mat-form-field-outline-end{border-top:none;border-radius:0;border-right:none}.est .mat-form-field-wrapper{height:20px;min-height:20px!important;margin-top:0!important}.est .mat-form-field-infix{width:100%!important;min-width:50px!important}.est .mat-form-field-infix select.mat-input-element{margin-top:-5px!important}.est .mat-datepicker-input{margin-bottom:3px!important}.est input{height:20px;padding-top:0!important}']}]}],re.ctorParameters=function(){return[{type:r.NgControl,decorators:[{type:t.Self},{type:t.Optional}]},{type:s.PreferencesService,decorators:[{type:t.Optional}]},{type:R,decorators:[{type:t.Optional},{type:t.Inject,args:[O]}]},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]},{type:i.LocalizationService},{type:t.ChangeDetectorRef},{type:ie},{type:n.UtilityService},{type:n.ExportService},{type:n.DateService},{type:n.MessageService},{type:ne},{type:n.ClipboardService}]},re.propDecorators={EsTdEditorDirectives:[{type:t.ContentChildren,args:[z]}],EsTdsDirective:[{type:t.ContentChildren,args:[k]}],EsThsDirective:[{type:t.ContentChildren,args:[G]}],bodyRef:[{type:t.ContentChild,args:["body",{static:!1}]}],headerRef:[{type:t.ContentChild,args:["header",{static:!1}]}],headerGroupRef:[{type:t.ContentChild,args:["headerGroup",{static:!1}]}],secondaryHeaderGroupRef:[{type:t.ContentChild,args:["secondaryHeaderGroup",{static:!1}]}],inputField:[{type:t.ViewChild,args:["input",{static:!1}]}],CornerMenuOptions:[{type:t.Input}],ColumnsResizable:[{type:t.Input}],ColumnsPinnable:[{type:t.Input}],AutoUpdate:[{type:t.Input}],UseCustomCells:[{type:t.Input}],MaxHeight:[{type:t.Input}],ContainerClass:[{type:t.Input}],XLSXExport:[{type:t.Input}],CSVExport:[{type:t.Input}],AllSearch:[{type:t.Input}],HighCellDensity:[{type:t.Input}],Selection:[{type:t.Input}],ShowLoadingOnBootstrap:[{type:t.Input}],Removal:[{type:t.Input}],RemovalCondition:[{type:t.Input}],Export:[{type:t.Input}],ShiftClick:[{type:t.Input}],CountLabel:[{type:t.Input}],HidePaging:[{type:t.Input}],HidePagingCount:[{type:t.Input}],HidePagingButtons:[{type:t.Input}],ContextMenu:[{type:t.Input}],ExportFileName:[{type:t.Input}],TableClass:[{type:t.Input}],ExportFunction:[{type:t.Input}],HasHeaderGroup:[{type:t.Input}],HasSecondaryHeaderGroup:[{type:t.Input}],HeaderHidden:[{type:t.Input}],BodyHidden:[{type:t.Input}],SelectionDisabled:[{type:t.Input}],SingleSelection:[{type:t.Input}],RowClassAssigner:[{type:t.Input}],OrderByColumn:[{type:t.Input}],MultipleOrderingDirectives:[{type:t.Input}],HiddenColumns:[{type:t.Input}],ColumnsOrdering:[{type:t.Input}],SearchView:[{type:t.Input}],SelectAll:[{type:t.Input}],UseArrayModePaging:[{type:t.Input}],DynamicRowColumnsDefinition:[{type:t.Input}],DynamicOperations:[{type:t.Input}],Hierarchy:[{type:t.Input}],ParentKey:[{type:t.Input}],OwnKey:[{type:t.Input}],StartsExpanded:[{type:t.Input}],SavePreferences:[{type:t.Input}],PagingStyle:[{type:t.Input}],RowGroupingPagingStyle:[{type:t.Input}],ItemSourceProperty:[{type:t.Input}],UseSelectionCache:[{type:t.Input}],ShowItemGroupsColumns:[{type:t.Input}],Editable:[{type:t.Input}],RangeSelection:[{type:t.Input}],onOrderChanged:[{type:t.Output}],onSearchRequest:[{type:t.Output}],onSelectionChanged:[{type:t.Output}],onRemoval:[{type:t.Output}],onAbortRemoval:[{type:t.Output}],onModelChange:[{type:t.Output}],onCornerAction:[{type:t.Output}],onDynamicOperation:[{type:t.Output}],exportDownloader:[{type:t.ViewChild,args:["exportDownloader",{static:!1}]}],tableEmptyMenu:[{type:t.ViewChild,args:["emptyMenu",{static:!0}]}],ArraymodeItemsPerPage:[{type:t.Input}]};var se=function(){},oe=function(){function e(e,i){this.myself=e,this.renderer=i,this.orderNext={NONE:"DESC",DESC:"ASC",ASC:null},this.resizingThis=!1,this.startOffset=null,this.ID="",this.Orderable=!0,this.Display="",this.Resizable=!1,this.Pinned=!1,this.SearchInProgress=!1,this.Wrap=!1,this.Fixed=!1,this.Template=null,this.onOrderChange=new t.EventEmitter,this.onUnpinning=new t.EventEmitter,this._referenced=!1}return Object.defineProperty(e.prototype,"Visible",{get:function(){return null==this._Visible&&(this._Visible=!0),this._Visible},set:function(e){this._Visible=e,e?this.renderer.removeClass(this.myself.nativeElement,"app-display-none"):this.renderer.addClass(this.myself.nativeElement,"app-display-none")},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.Description=null===this.Display||""===this.Display?this.content.nativeElement.innerText:this.Display,this.Class=this.myself.nativeElement.className.replace("app-display-none",""),this.Resizable&&this.renderer.addClass(this.myself.nativeElement,"app-relative")},e.prototype.unpin=function(){this.onUnpinning.emit(this.ID)},e.prototype.setupNextOrderAndNotify=function(){if(this.ID){if(this.SearchInProgress)console.log("Attempt to order a column during a search. Operation ignored");else if(this.OrderBy&&this.Orderable){var e=this.orderNext[this.Order||"NONE"];this.Order=e,this.onOrderChange.emit(this.Order)}}else console.log("Attempt to order a column without ID. Operation ignored")},e.prototype.onResizeStart=function(e){this.Resizable&&(this.resizingThis=!0,this.startOffset=this.myself.nativeElement.offsetWidth-e.pageX)},e.prototype.onMouseUp=function(){this.Resizable&&(this.resizingThis=!1)},e.prototype.onMouseMove=function(e){this.Resizable&&this.resizingThis&&(this.myself.nativeElement.style.width=this.startOffset+e.pageX+"px",e.preventDefault())},e}();oe.decorators=[{type:t.Component,args:[{selector:"[es-th]",template:'<span (click)="setupNextOrderAndNotify()" [class.app-no-selection]="!!ID && Orderable" [class.app-pointer]="!!ID && Orderable">\r\n <span #content>\r\n <ng-container *ngIf="Template">\r\n <ng-container *ngTemplateOutlet="Template"></ng-container>\r\n </ng-container>\r\n <ng-content *ngIf="!Template"></ng-content>\r\n </span>&nbsp;\r\n <span class="fa" [class.fa-chevron-down]="Order == \'DESC\'" [class.fa-chevron-up]="Order == \'ASC\'"></span>\r\n</span>\r\n<span *ngIf="Pinned && !Fixed" class="app-pointer fa fa-thumb-tack est-quick-unpin" (click)="unpin()"></span>\r\n<div [hidden]="!Resizable || Fixed || Pinned" class="est-head-resizer" (mousedown)="onResizeStart($event)">\r\n <div class="est-head-resizer-internal"></div>\r\n</div>',changeDetection:t.ChangeDetectionStrategy.OnPush}]}],oe.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},oe.propDecorators={ID:[{type:t.Input,args:["es-th"]}],Order:[{type:t.Input}],Orderable:[{type:t.Input}],Display:[{type:t.Input}],Resizable:[{type:t.Input}],Pinned:[{type:t.Input}],SearchInProgress:[{type:t.Input}],OrderBy:[{type:t.Input}],Wrap:[{type:t.Input}],Fixed:[{type:t.Input}],Template:[{type:t.Input}],onOrderChange:[{type:t.Output}],onUnpinning:[{type:t.Output}],content:[{type:t.ViewChild,args:["content",{static:!1}]}],Visible:[{type:t.Input}],onMouseUp:[{type:t.HostListener,args:["window:mouseup.out-zone"]}],onMouseMove:[{type:t.HostListener,args:["window:mousemove.out-zone",["$event"]]}]};var ae=function(){function e(e,t,i){this.myself=e,this.renderer=t,this.sanitizer=i,this.ID="",this.Display=null,this.Template=null}return Object.defineProperty(e.prototype,"Visible",{get:function(){return null==this._Visible&&(this._Visible=!0),this._Visible},set:function(e){this._Visible=e,e?this.renderer.removeClass(this.myself.nativeElement,"app-display-none"):this.renderer.addClass(this.myself.nativeElement,"app-display-none")},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.Internal||(this.Content=null===this.Display||""===this.Display?this.sanitizer.bypassSecurityTrustHtml(this.myself.nativeElement.innerHTML):this.sanitizer.bypassSecurityTrustHtml(this.Display),this.Class=this.myself.nativeElement.className.replace("app-display-none",""))},e}();ae.decorators=[{type:t.Component,args:[{selector:"[es-td]",template:"<span>\r\n <ng-content></ng-content>\r\n</span>",changeDetection:t.ChangeDetectionStrategy.OnPush}]}],ae.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:d.DomSanitizer}]},ae.propDecorators={ID:[{type:t.Input,args:["es-td"]}],Internal:[{type:t.Input}],RouterLink:[{type:t.Input}],Display:[{type:t.Input}],Template:[{type:t.Input}],Context:[{type:t.Input}],Visible:[{type:t.Input}]};var le=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[ne,{provide:I,useValue:(null==t?void 0:t.locale)||"it-IT"},{provide:_,useValue:(null==t?void 0:t.debugMode)||!1},{provide:O,useValue:(null==t?void 0:t.defaults)||null}]}},e}();le.decorators=[{type:t.NgModule,args:[{imports:[l.CommonModule,r.FormsModule,c.RouterModule,i.LocalizationModule,g.ModalModule,m.BsDropdownModule,f.CsvModule,v.ContextMenuModule,h.MatSelectModule,p.MatInputModule,o.DragDropModule,u.FormsAndValidationsModule],declarations:[oe,ae,re,k,G,z,M],providers:[n.UtilityService,n.ExportService,n.HashingService,n.MessageService],exports:[re,k,G,z,M]}]}];var ce=function(){},he=function(e,t,i,n,r,s){this.id=e,this.title=t,this.iconClass=i,this.text=n,this.conditionField=r,this.conditionValue=s},pe=function(){this._selected=!1,this._rowClass=null,this._hash=null,this.properties={}},ue=function(e,t,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=""),this.value=e,this.header=t,this.header_group=i,this.exports=!1,this.export_format="",this.exports=n,this.export_format=r,this._headersHierarchy=i?i.split(">").map((function(e){return e.trim()})):[]},de=function(){},ge=function(){},me=function(){},fe=function(){};e.AppOrdering=B,e.AppSearch=H,e.CornerMenuOption=ce,e.EsTableColumnsDefinition=U,e.EsTableComponent=re,e.EsTableDefaultable=R,e.EsTableModelChange=D,e.EsTableModule=le,e.EsTableModuleConfig=se,e.EsTableMultiValue=ue,e.EsTableOperationDefinition=he,e.EsTdDirective=k,e.EsTdEditorDirective=z,e.EsThDirective=G,e.GenericItem=pe,e.Group=$,e.GroupAggregation=X,e.GroupFilter=E,e.GroupOrAggregation=J,e.ItemPropEditableReference=fe,e.ItemsSelection=V,e.ReportColumn=de,e.ReportParam=ge,e.ReportRow=me,e.TablePagerComponent=M,e.ɵa=T,e.ɵb=I,e.ɵc=_,e.ɵd=O,e.ɵe=A,e.ɵf=ie,e.ɵg=ne,e.ɵh=oe,e.ɵi=ae,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=esfaenza-es-table.umd.min.js.map