@asi-ngtools/lib
Version:
This project is a little components library, simple to use, which will help you to simplify your project.
1 lines • 169 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/router"),require("lodash"),require("@angular/common/http"),require("@angular/platform-browser"),require("@angular/animations"),require("@angular/common"),require("@ngx-translate/core"),require("@angular/forms"),require("moment"),require("rxjs"),require("rxjs/operators"),require("@angular/core")):"function"==typeof define&&define.amd?define("@asi-ngtools/lib",["exports","@angular/router","lodash","@angular/common/http","@angular/platform-browser","@angular/animations","@angular/common","@ngx-translate/core","@angular/forms","moment","rxjs","rxjs/operators","@angular/core"],t):t((e["asi-ngtools"]=e["asi-ngtools"]||{},e["asi-ngtools"].lib={}),e.ng.router,e.lodash,e.ng.common.http,e.ng.platformBrowser,e.ng.animations,e.ng.common,e.core,e.ng.forms,e.moment,e.rxjs,e.rxjs.operators,e.ng.core)}(this,function(exports,router,lodash,http,platformBrowser,animations,common,core,forms,moment,rxjs,operators,core$1){"use strict";moment=moment&&moment.hasOwnProperty("default")?moment["default"]:moment;var AsiComponentTemplate=function(){function e(){}return e.decorators=[{type:core$1.Component,args:[{selector:"asi-option, asi-tag, asi-selected, asi-empty, asi-header, asi-cell, asi-tree-node, asi-tree-leaf, asi-clear",template:"<ng-content></ng-content>"}]}],e.ctorParameters=function(){return[]},e}(),AsiComponentTemplateOptionDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiOptionDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateTagDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiTagDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateSelectedDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiSelectedDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateEmptyDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiEmptyDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateClearDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiClearDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateTableHeaderDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiTableHeaderDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateTabHeaderDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiTabHeaderDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateNavHeaderDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiNavHeaderDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateCollapseHeaderDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiCollapseHeaderDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateCellDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiCellDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateColumnDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiColumnDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateTreeNodeDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiTreeNodeDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),AsiComponentTemplateTreeLeafDef=function(){function e(e){this.template=e}return e.decorators=[{type:core$1.Directive,args:[{selector:"[asiTreeLeafDef]"}]}],e.ctorParameters=function(){return[{type:core$1.TemplateRef}]},e}(),DefaultControlValueAccessor=function(){function e(){this.disabled=!1,this.onValueChange=new core$1.EventEmitter,this.onChange=function(){},this.onTouched=function(){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this.onTouched(),this.onChange(e),this.onValueChange.emit(this.value)},enumerable:!0,configurable:!0}),e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){this._value=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.propDecorators={_value:[{type:core$1.Input,args:["value"]}],disabled:[{type:core$1.Input}],onValueChange:[{type:core$1.Output}]},e}(),AsiNgToolsBaseModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[core.TranslateService]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiComponentTemplateTabHeaderDef,AsiComponentTemplateTableHeaderDef,AsiComponentTemplateOptionDef,AsiComponentTemplateEmptyDef,AsiComponentTemplateClearDef,AsiComponentTemplateSelectedDef,AsiComponentTemplateColumnDef,AsiComponentTemplateCellDef,AsiComponentTemplateTagDef,AsiComponentTemplateTreeNodeDef,AsiComponentTemplateTreeLeafDef,AsiComponentTemplateNavHeaderDef,AsiComponentTemplateCollapseHeaderDef,AsiComponentTemplate],imports:[core.TranslateModule,forms.FormsModule,forms.ReactiveFormsModule,common.CommonModule,router.RouterModule],exports:[core.TranslateModule,forms.FormsModule,forms.ReactiveFormsModule,common.CommonModule,router.RouterModule,AsiComponentTemplateTabHeaderDef,AsiComponentTemplateTableHeaderDef,AsiComponentTemplateOptionDef,AsiComponentTemplateEmptyDef,AsiComponentTemplateClearDef,AsiComponentTemplateSelectedDef,AsiComponentTemplateTagDef,AsiComponentTemplateColumnDef,AsiComponentTemplateCellDef,AsiComponentTemplateTreeNodeDef,AsiComponentTemplateTreeLeafDef,AsiComponentTemplateCollapseHeaderDef,AsiComponentTemplate],entryComponents:[],providers:[core.TranslateService]}]}],e}(),AsiButtonComponent=function(){function e(e,t){this.renderer=e,this.elementRef=t,this.type="button",this.design="flat",this.size="standard",this.disabled=!1}return e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"button-"+this.design),this.renderer.addClass(this.elementRef.nativeElement,"button-"+this.size)},e.prototype.ngOnChanges=function(){this.disabled?this.renderer.addClass(this.elementRef.nativeElement,"disabled"):this.renderer.removeClass(this.elementRef.nativeElement,"disabled")},e.decorators=[{type:core$1.Component,args:[{selector:"asi-button",host:{"class":"asi-component asi-button"},template:'<button [attr.id]="id" [attr.name]="name" [attr.type]="type" [disabled]="disabled" [attr.disabled]="disabled ? \'disabled\' : null">\n <ng-content></ng-content>\n</button>\n'}]}],e.ctorParameters=function(){return[{type:core$1.Renderer2},{type:core$1.ElementRef}]},e.propDecorators={id:[{type:core$1.Input}],name:[{type:core$1.Input}],type:[{type:core$1.Input}],design:[{type:core$1.Input}],size:[{type:core$1.Input}],disabled:[{type:core$1.Input}]},e}(),AsiLinkButtonComponent=function(){function e(e,t){this.renderer=e,this.elementRef=t,this.design="flat",this.href="",this.target="_self",this.disabled=!1}return e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"link-button-"+this.design)},e.prototype.ngOnChanges=function(){this.disabled?this.renderer.addClass(this.elementRef.nativeElement,"disabled"):this.renderer.removeClass(this.elementRef.nativeElement,"disabled")},e.decorators=[{type:core$1.Component,args:[{selector:"asi-link-button",host:{"class":"asi-component asi-link-button"},template:'<a [attr.href]="href" [attr.target]="target">\r\n <ng-content></ng-content>\r\n</a>\r\n'}]}],e.ctorParameters=function(){return[{type:core$1.Renderer2},{type:core$1.ElementRef}]},e.propDecorators={design:[{type:core$1.Input}],href:[{type:core$1.Input}],target:[{type:core$1.Input}],disabled:[{type:core$1.Input}]},e}(),AsiButtonModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiButtonComponent,AsiLinkButtonComponent],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiButtonComponent,AsiLinkButtonComponent],entryComponents:[],providers:[]}]}],e}(),extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function __extends(e,t){function o(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function __values(e){var t="function"==typeof Symbol&&e[Symbol.iterator],o=0;return t?t.call(e):{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}}}function __read(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,i,r=o.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=r.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(o=r["return"])&&o.call(r)}finally{if(i)throw i.error}}return s}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}var months_fr=[{num:1,libelle:"Janvier"},{num:2,libelle:"Février"},{num:3,libelle:"Mars"},{num:4,libelle:"Avril"},{num:5,libelle:"Mai"},{num:6,libelle:"Juin"},{num:7,libelle:"Juillet"},{num:8,libelle:"Août"},{num:9,libelle:"Septembre"},{num:10,libelle:"Octobre"},{num:11,libelle:"Novembre"},{num:12,libelle:"Décembre"}],months_en=[{num:1,libelle:"January"},{num:2,libelle:"February"},{num:3,libelle:"March"},{num:4,libelle:"April"},{num:5,libelle:"May"},{num:6,libelle:"June"},{num:7,libelle:"July"},{num:8,libelle:"August"},{num:9,libelle:"September"},{num:10,libelle:"October"},{num:11,libelle:"November"},{num:12,libelle:"Decemder"}];function map(e,t){return e?e.map(t):e}function filter(e,t){return e?e.filter(t):e}function isArray(e){return Array.isArray(e)}function times(e,t){for(var o=[],n=-1;++n<e;)o.push(t(n));return o}function forEach(e,t){e&&e.forEach(t)}function remove(e,t){var o=[];if(e)for(var n=e.length;n--;){var i=e[n];t(i,n)&&(e.splice(n,1),o.push(i))}return o}function removeAtIndex(e,t){e&&e.splice(t,1)}function get(e,t,o){var n=Array.isArray(t)?t:t.split(".").filter(function(e){return e.length});return n.length?get(e[n.shift()],n,o):e===undefined?o:e}function find(e,t){return e?e.find(t):undefined}function truncate(e,t){return e?e.substring(0,t):e}function indexOf(e,t){return e?e.indexOf(t):-1}function concat(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=[];return e.forEach(function(e){o=o.concat(e)}),o}function replace(e,t,o){return e?e.replace(t,o):e}function orderByWithoutCase(e,i,t){var r="asc"===t?-1:1;return e.sort(function(e,t){if(!e[i]&&!t[i])return 0;if(e[i]&&!t[i])return-1;if(!e[i]&&t[i])return 1;var o=e[i].toLowerCase(),n=t[i].toLowerCase();return o<n?r:n<o?-r:0}),e}function cloneDeep(e){return lodash.cloneDeep(e)}function isEmpty(e){return null==e||0===e.length}function join(e,t){return e?e.join(t):e}function observe(e){return rxjs.isObservable(e)?e:e instanceof Promise?rxjs.from(e):rxjs.of(e)}var AsiDmyPickerComponent=function(r){function e(e,t,o,n){var i=r.call(this)||this;return i.platformId=e,i.injector=t,i.renderer=o,i.elementRef=n,i.labelPosition="top",i.dayHidden=!1,i.days=[],i.months=[],i.years=[],i}return __extends(e,r),e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"label-"+this.labelPosition),this.isFr()?(this.months=months_fr,this.dayLabel="Jour",this.monthLabel="Mois",this.yearLabel="Annee"):(this.months=months_en,this.dayLabel="Day",this.monthLabel="Month",this.yearLabel="Year"),this.initDays(),this.initYears()},e.prototype.isFr=function(){if(common.isPlatformBrowser(this.platformId))return"fr"===navigator.language||"fr-FR"===navigator.language;var e=this.injector.get("request");if(e&&e.asiNgtools){var t=e.asiNgtools.language;if(t)return"fr"===t.substring(0,2)}return!1},e.prototype.initDays=function(){var t=this;times(31,function(e){t.days.push(e+1)})},e.prototype.initYears=function(){for(var e=new Array,t=(new Date).getFullYear();1900<=t;t--)e.push(t);this.years=e},e.prototype.onMonthChange=function(e){this.value={day:this.day,month:null!=e?e.num:null,year:this.year}},e.prototype.onYearChange=function(e){this.value={day:this.day,month:null!=this.month?this.month.num:null,year:e}},e.prototype.onDayChange=function(e){this.value={day:e,month:null!=this.month?this.month.num:null,year:this.year}},e.prototype.writeValue=function(e){this.year=null!=e?(this.day=e.day,this.month=this.getMontFromNum(e.month),e.year):(this.day=null,this.month=null),this._value={day:this.day,month:this.month,year:this.year}},e.prototype.getMontFromNum=function(t){return null==t?null:find(this.months,function(e){return e.num===t})},e.decorators=[{type:core$1.Component,args:[{selector:"asi-dmypicker",host:{"class":"asi-component asi-dmypicker"},template:'<label class="input-label" [translate]="label"></label>\r\n<div class="asi-dmypicker-container">\r\n <asi-select class="asi-dmy-days" [disabled]="disabled" [withEmptyValue]="true" [hidden]="dayHidden" [data]="days" [(ngModel)]="day"\r\n (ngModelChange)="onDayChange($event)">\r\n <asi-empty *asiEmptyDef>{{dayLabel}}</asi-empty>\r\n <asi-selected *asiSelectedDef="let data">{{data}}</asi-selected>\r\n <asi-option *asiOptionDef="let data">{{data}}</asi-option>\r\n </asi-select>\r\n <asi-select class="asi-dmy-months" [disabled]="disabled" [withEmptyValue]="true" [data]="months" [(ngModel)]="month" (ngModelChange)="onMonthChange($event)">\r\n <asi-empty *asiEmptyDef>{{monthLabel}}</asi-empty>\r\n <asi-selected *asiSelectedDef="let data">{{data.num + " - " + data.libelle}}</asi-selected>\r\n <asi-option *asiOptionDef="let data">{{data.num + " - " + data.libelle}}</asi-option>\r\n </asi-select>\r\n <asi-select class="asi-dmy-years" [disabled]="disabled" [withEmptyValue]="true" [data]="years" [(ngModel)]="year" (ngModelChange)="onYearChange($event)">\r\n <asi-empty *asiEmptyDef>{{yearLabel}}</asi-empty>\r\n <asi-selected *asiSelectedDef="let data">{{data}}</asi-selected>\r\n <asi-option *asiOptionDef="let data">{{data}}</asi-option>\r\n </asi-select>\r\n</div>',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core$1.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:core$1.Inject,args:[core$1.PLATFORM_ID]}]},{type:core$1.Injector},{type:core$1.Renderer2},{type:core$1.ElementRef}]},e.propDecorators={label:[{type:core$1.Input}],labelPosition:[{type:core$1.Input}],dayHidden:[{type:core$1.Input}]},e}(DefaultControlValueAccessor),AsiCheckboxComponent=function(n){function e(e,t){var o=n.call(this)||this;return o.renderer=e,o.elementRef=t,o.labelPosition="top",o.type="checkbox",o}return __extends(e,n),e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"label-"+this.labelPosition)},e.prototype.toggleCheck=function(){this.value=!this.value},e.decorators=[{type:core$1.Component,args:[{selector:"asi-checkbox",host:{"class":"asi-component asi-checkbox"},template:'<label class="input-label" *ngIf="label != null">{{label | translate}}</label>\r\n\r\n<button type="button" [disabled]="disabled" (click)="toggleCheck()" class="checkbox asi-focus-error" [ngClass]="{ \'checked\': value, \'radio\' : type == \'radio\' }">\r\n <div><span class="checkbox-button"></span></div>\r\n</button>',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core$1.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:core$1.Renderer2},{type:core$1.ElementRef}]},e.propDecorators={label:[{type:core$1.Input}],labelPosition:[{type:core$1.Input}],type:[{type:core$1.Input}]},e}(DefaultControlValueAccessor),AsiCheckBoxModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiCheckboxComponent],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiCheckboxComponent],entryComponents:[],providers:[]}]}],e}(),AsiSelectComponent=function(n){function e(e,t){var o=n.call(this)||this;return o.renderer=e,o.elementRef=t,o.labelPosition="top",o.multiple=!1,o.withEmptyValue=!1,o.open=!1,o.allChecked=!1,o}return __extends(e,n),e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"label-"+this.labelPosition),this.multiple&&this.renderer.addClass(this.elementRef.nativeElement,"multiple")},e.prototype.onDropdownClose=function(){this.open=!1},e.prototype.isOpened=function(){return this.open},e.prototype.ngOnChanges=function(){this.initData()},e.prototype.initData=function(){var o=this;this.selectDatas=[],this.data=this.data||[],this.withEmptyValue&&this.selectDatas.push(null),this.data.forEach(function(e){var t={selected:!1,value:e};o.selectDatas.push(t)})},e.prototype.checkAll=function(t){var o=this;this.allChecked=t,this.selectDatas.forEach(function(e){null!=e&&t!==e.selected&&o.internalSelectValue(null,e)}),this.onModelChange(this._value)},e.prototype.updateAllChecked=function(){this.allChecked=null==find(this.selectDatas,function(e){return null!=e&&!e.selected})},e.prototype.selectValue=function(e,t){this.internalSelectValue(e,t),this.onModelChange(this._value)},e.prototype.internalSelectValue=function(e,t){var o=this;if(null==t)return this.onModelChange(null),void(this.open=!1);var n=t.value;this.multiple?(null!=e&&e.stopPropagation(),null==this._value&&(this._value=[]),isEmpty(remove(this._value,function(e){return null!=e&&(null!=o.trackBy?e[o.trackBy]===n[o.trackBy]:e===n)}))?(this.value.push(n),t.selected=!0):t.selected=!1,isEmpty(this._value)&&(this._value=null),null!=e&&this.updateAllChecked()):(this.open=!1,this._value=n)},e.prototype.toggleSelect=function(){this.open=!this.open},e.prototype.writeValue=function(e){var o=this;isNaN(e)&&isEmpty(e)?this._value=null:this._value=e,this.multiple&&(null!=this._value?this.selectDatas.forEach(function(t){null!=t&&(t.selected=null!=find(o.value,function(e){return null!=e&&(null!=o.trackBy?e[o.trackBy]===t.value[o.trackBy]:e===t.value)}))}):this.selectDatas.forEach(function(e){null!=e&&(e.selected=!1)}),this.updateAllChecked()),this.manageHasValue()},e.prototype.onModelChange=function(e){this.value=e,this.manageHasValue()},e.prototype.manageHasValue=function(){null!=this.value?this.renderer.addClass(this.elementRef.nativeElement,"has-value"):this.renderer.removeClass(this.elementRef.nativeElement,"has-value")},e.decorators=[{type:core$1.Component,args:[{selector:"asi-select",host:{"class":"asi-component asi-select"},template:'<label class="input-label" *ngIf="label != null">{{label | translate}}</label>\r\n\r\n<div class="asi-select-container" aria-labelledby="select">\r\n <div class="asi-select-header asi-focus-error" (keyup.esc)="toggleSelect()">\r\n <asi-checkbox *ngIf="multiple" [disabled]="disabled" [ngModel]="allChecked" (onValueChange)="checkAll($event)">\r\n </asi-checkbox>\r\n <button type="button" class="item-container" [disabled]="disabled" (click)="toggleSelect()">\r\n <span>\r\n <div class="item">\r\n <ng-template *ngIf="value != null" [ngTemplateOutlet]="selectedDef.template"\r\n [ngTemplateOutletContext]="{$implicit : value}"></ng-template>\r\n <ng-template *ngIf="value == null" [ngTemplateOutlet]="emptyDef?.template"\r\n [ngTemplateOutletContext]="{$implicit : value}"></ng-template>\r\n </div>\r\n <div class="drop-icon-container">\r\n <span class="drop-icon" [innerHtml]="\'▼\'"></span>\r\n </div>\r\n </span>\r\n </button>\r\n </div>\r\n\r\n <asi-dropdown [open]="open" (onClose)="onDropdownClose()" dropDownClass="asi-select-dropdown">\r\n <div class="drop-down-select">\r\n <div class="drop-down-panel">\r\n <button type="button" class="drop-down-item" [ngClass]="{\'empty\' : data == null , \'selected\' : data?.selected}"\r\n (keyup.esc)="toggleSelect()" (click)="selectValue($event, data)" *ngFor="let data of selectDatas">\r\n <span class="option">\r\n <asi-checkbox *ngIf="multiple && data != null" [ngModel]="data.selected"\r\n (click)="selectValue($event, data)"></asi-checkbox>\r\n <div class="item" aria-labelledby="item">\r\n <ng-template *ngIf="data != null" [ngTemplateOutlet]="optionDef.template"\r\n [ngTemplateOutletContext]="{$implicit : data.value}"></ng-template>\r\n </div>\r\n </span>\r\n </button>\r\n </div>\r\n </div>\r\n </asi-dropdown>\r\n</div>\r\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core$1.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:core$1.Renderer2},{type:core$1.ElementRef}]},e.propDecorators={label:[{type:core$1.Input}],labelPosition:[{type:core$1.Input}],data:[{type:core$1.Input}],multiple:[{type:core$1.Input}],trackBy:[{type:core$1.Input}],withEmptyValue:[{type:core$1.Input}],optionDef:[{type:core$1.ContentChild,args:[AsiComponentTemplateOptionDef]}],emptyDef:[{type:core$1.ContentChild,args:[AsiComponentTemplateEmptyDef]}],selectedDef:[{type:core$1.ContentChild,args:[AsiComponentTemplateSelectedDef]}]},e}(DefaultControlValueAccessor),AsiDropdownContainer=function(){function t(e,t,o){this.document=e,this.renderer=t,this.elementRef=o,this.calculWidth=!0,this.subjectContainer=new rxjs.Subject}return t.prototype.documentClick=function(e){var t=this;this.drop.nativeElement.contains(e.target)||this.asiDropDownService.canClose(this.index,this.canClose).subscribe(function(e){e&&setTimeout(function(){t.close()})})},t.prototype.close=function(){this.subjectContainer.next(this),this.subjectContainer.complete()},t.prototype.onClose=function(){return this.subjectContainer.asObservable()},t.prototype.forElement=function(e){var t=(this.referenceElement=e).getBoundingClientRect(),o=getComputedStyle(this.document.body),n=parseInt(o.marginTop.slice(0,-2),10),i=parseInt(o.marginLeft.slice(0,-2),10),r=t.top+this.getScrollTopValue()-n;r>this.document.body.clientHeight/2?(this.drop.nativeElement.style.bottom=this.document.body.clientHeight-r+"px",this.drop.nativeElement.style.marginBottom="5px"):(this.drop.nativeElement.style.top=r+e.offsetHeight+"px",this.drop.nativeElement.style.marginTop="5px");var s,a=t.top-n;a>this.document.body.clientHeight/2?(s=this.document.body.clientHeight-(this.getScrollTopValue()+a),this.drop.nativeElement.style.bottom=s+"px",this.drop.nativeElement.style.marginBottom="2px"):(s=this.getScrollTopValue()+a+e.offsetHeight,this.drop.nativeElement.style.top=s+"px",this.drop.nativeElement.style.marginTop="2px"),this.drop.nativeElement.style.left=t.left+this.getScrollLeftValue()-i+"px",this.drop.nativeElement.style.width=e.offsetWidth+"px"},t.prototype.getScrollTopValue=function(){return this.document.body.scrollTop+this.document.documentElement.scrollTop},t.prototype.getScrollLeftValue=function(){return this.document.body.scrollLeft+this.document.documentElement.scrollLeft},t.prototype.show=function(e){var o=this;setTimeout(function(){o.template=e.contentTemplate;var t=o.drop.nativeElement.style.visibility;o.drop.nativeElement.style.visibility="hidden",e.dropDownClass&&o.renderer.addClass(o.elementRef.nativeElement,e.dropDownClass),setTimeout(function(){var e=o.drop.nativeElement.offsetLeft+o.drop.nativeElement.offsetWidth;e>o.document.documentElement.clientWidth&&(o.drop.nativeElement.style.left=o.drop.nativeElement.offsetLeft+o.document.documentElement.scrollLeft-(e-o.document.documentElement.clientWidth)+"px"),o.drop.nativeElement.style.visibility=t})})},t.prototype.injectService=function(e){this.asiDropDownService=e},t.prototype.setIndex=function(e){this.index=e,this.elementRef.nativeElement.style.zIndex=t.BASE_INDEX+e},t.prototype.setCalculWidth=function(e){this.drop.nativeElement.style.width=e?this.referenceElement.offsetWidth+"px":""},t.BASE_INDEX=125,t.decorators=[{type:core$1.Component,args:[{selector:"asi-dropdown-container",host:{"class":"asi-component asi-dropdown-container"},template:'<div #drop class="dropdown-container">\r\n <ng-template [ngTemplateOutlet]="template"></ng-template>\r\n</div>'}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:core$1.Inject,args:[platformBrowser.DOCUMENT]}]},{type:core$1.Renderer2},{type:core$1.ElementRef}]},t.propDecorators={calculWidth:[{type:core$1.Input}],drop:[{type:core$1.ViewChild,args:["drop",{read:core$1.ElementRef}]}],documentClick:[{type:core$1.HostListener,args:["document:mouseup",["$event"]]}]},t}(),AsiDropdownService=function(){function e(e,t){this.resolver=e,this.appRef=t,this.containers=[]}return e.prototype.showDropdown=function(e,t){var o=this,n=this.getContainer();return n.instance.injectService(this),n.instance.forElement(e),n.instance.show(t),n.instance.setIndex(this.containers.length),n.instance.canClose=t.canClose,n.instance.onClose().subscribe(function(t){remove(o.containers,function(e){return t.index===e.instance.index})}),this.containers.push(n),n},e.prototype.canClose=function(e,t){return e>=this.containers.length-1?t?observe(t(document.activeElement)):rxjs.of(!0):rxjs.of(!1)},e.prototype.getContainer=function(){var e=this.appRef.components[0].instance;if(!e.viewContainerRef){var t=this.appRef.componentTypes[0].name;throw new Error('AsiDropdown : Please add "viewContainerRef : ViewContainerRef" declaration in your root component constructor : '+t)}var o=this.resolver.resolveComponentFactory(AsiDropdownContainer);return e.viewContainerRef.createComponent(o,0)},e.decorators=[{type:core$1.Injectable}],e.ctorParameters=function(){return[{type:core$1.ComponentFactoryResolver},{type:core$1.ApplicationRef}]},e}(),AsiDropDown=function(){function e(e,t){this.asiDropdownService=e,this.elementRef=t,this.open=!1,this.calculWidth=!0,this.dropDownClass="",this.onClose=new core$1.EventEmitter}return e.prototype.ngOnChanges=function(e){var t=this;e.open&&(e.open.currentValue?setTimeout(function(){null==t.relativeTo?t.dropdown=t.asiDropdownService.showDropdown(t.elementRef.nativeElement.parentElement,t):t.relativeTo.nativeElement?t.dropdown=t.asiDropdownService.showDropdown(t.relativeTo.nativeElement,t):t.relativeTo.elementRef.nativeElement?t.dropdown=t.asiDropdownService.showDropdown(t.relativeTo.elementRef.nativeElement,t):(console.warn("Default choice for the down down cannot find nativeElement on the relativeTo element"),t.dropdown=t.asiDropdownService.showDropdown(t.elementRef.nativeElement.parentElement,t)),t.dropdown.instance.setCalculWidth(t.calculWidth),t.dropdown.instance.onClose().subscribe(function(){t.destroyDropdown()})}):this.dropdown&&this.dropdown.instance.close())},e.prototype.destroyDropdown=function(){this.open=!1,this.onClose.emit(),this.dropdown.destroy()},e.decorators=[{type:core$1.Component,args:[{selector:"asi-dropdown",template:'<ng-template><div class="asi-dropdown"><ng-content></ng-content></div></ng-template>'}]}],e.ctorParameters=function(){return[{type:AsiDropdownService},{type:core$1.ElementRef}]},e.propDecorators={open:[{type:core$1.Input}],calculWidth:[{type:core$1.Input}],relativeTo:[{type:core$1.Input}],dropDownClass:[{type:core$1.Input}],onClose:[{type:core$1.Output}],canClose:[{type:core$1.Input}],contentTemplate:[{type:core$1.ViewChild,args:[core$1.TemplateRef]}]},e}(),AsiDropdownModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[AsiDropdownService]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiDropdownContainer,AsiDropDown],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiDropDown],entryComponents:[AsiDropdownContainer],providers:[AsiDropdownService]}]}],e}(),AsiSelectModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiSelectComponent],imports:[AsiNgToolsBaseModule.forRoot(),AsiCheckBoxModule.forRoot(),AsiDropdownModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiSelectComponent],entryComponents:[],providers:[]}]}],e}(),AsiDmyPickerModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiDmyPickerComponent],imports:[AsiNgToolsBaseModule.forRoot(),AsiSelectModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiDmyPickerComponent],entryComponents:[],providers:[]}]}],e}(),AsiTinyMCE=function(o){function e(e){var t=o.call(this)||this;return t.zone=e,t["class"]="asi-component asi-tinymce",t.labelPosition="top",t}return __extends(e,o),e.prototype.ngOnInit=function(){this["class"]+=" label-"+this.labelPosition},e.prototype.ngAfterViewInit=function(){var t=this;tinymce.init({selector:"#"+this.elementId,plugins:["link","paste","table","textcolor","colorpicker"],toolbar:"fontselect fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | outdent indent blockquote | forecolor backcolor",skin_url:"../assets/tinymce/skin",setup:function(e){(t.editor=e).on("keyup",function(){t.onModelChange()}),e.on("Change",function(){t.onModelChange()})},init_instance_callback:function(e){null!=t.value&&e.setContent(t.value)}})},e.prototype.onModelChange=function(){var t=this;this.zone.run(function(){var e=t.editor.getContent();t.value=e,t.onValueChange.emit(e)})},e.prototype.ngOnDestroy=function(){tinymce.remove(this.editor)},e.decorators=[{type:core$1.Component,args:[{selector:"asi-tinymce",template:'<textarea id="{{elementId}}"></textarea>',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core$1.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:core$1.NgZone}]},e.propDecorators={"class":[{type:core$1.HostBinding,args:["class"]}],label:[{type:core$1.Input}],labelPosition:[{type:core$1.Input}],elementId:[{type:core$1.Input}]},e}(DefaultControlValueAccessor),AsiTinyMCEModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiTinyMCE],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiTinyMCE],entryComponents:[],providers:[]}]}],e}(),AsiMenuItem=function(){function e(){this.disabled=!1,this.onClick=new core$1.EventEmitter}return e.prototype.emitClick=function(e){this.onClick.emit(e)},e.decorators=[{type:core$1.Component,args:[{selector:"asi-menu-item",template:"<ng-template><ng-content></ng-content></ng-template>"}]}],e.propDecorators={routerLink:[{type:core$1.Input}],disabled:[{type:core$1.Input}],onClick:[{type:core$1.Output}],template:[{type:core$1.ViewChild,args:[core$1.TemplateRef]}]},e}(),AsiMenu=function(){function e(){this.disabled=!1,this.burger=!1,this.vertical=!1,this.items=new Array}return e.prototype.toggleBurger=function(){this.burgerOpen=!this.burgerOpen},e.prototype.ngAfterContentInit=function(){var t=this;this.items=[],this.queryItems.forEach(function(e){t.items.push(e)}),this.queryItems.changes.subscribe(function(e){t.items=e}),this.burgerOpen=!this.burger},e.decorators=[{type:core$1.Component,args:[{selector:"asi-menu",host:{"class":"asi-component asi-menu"},template:'<div class="asi-menu-container">\n <span *ngIf="burger" (click)="toggleBurger()">\n <ng-template *ngIf="burgerTemplate != null" [ngTemplateOutlet]="burgerTemplate"></ng-template>\n </span>\n <ul class="asi-menu-panel">\n <li *ngIf="burgerOpen" class="items-container" [ngClass]="{\'vertical\' : vertical, \'burger\' : burger }">\n <button *ngFor="let item of items" class="item-container" routerLinkActive="active" [routerLink]="item.routerLink" [disabled]="disabled || item.disabled"\n (click)="item.emitClick($event)">\n <ng-template *ngIf="item.template != null" [ngTemplateOutlet]="item.template"></ng-template>\n </button>\n </li>\n </ul>\n</div>\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={disabled:[{type:core$1.Input}],burger:[{type:core$1.Input}],vertical:[{type:core$1.Input}],queryItems:[{type:core$1.ContentChildren,args:[AsiMenuItem]}],burgerTemplate:[{type:core$1.ContentChild,args:["burger"]}]},e}(),AsiMenuModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiMenu,AsiMenuItem],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiMenu,AsiMenuItem],entryComponents:[],providers:[]}]}],e}(),AsiTextareaComponent=function(n){function e(e,t){var o=n.call(this)||this;return o.renderer=e,o.elementRef=t,o.labelPosition="top",o.placeholder="",o.rows=2,o.cols=100,o.maxlength=-1,o.textareaControl=new forms.FormControl,o}return __extends(e,n),e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"label-"+this.labelPosition)},e.prototype.ngAfterViewInit=function(){var t=this;this.textareaControl.valueChanges.subscribe(function(e){""===e?t.value=null:t.isValide(e)?t.value=e:-1!==t.maxlength&&e.length>t.maxlength&&(t.value=e.substr(0,t.maxlength)),t.textareaElm.nativeElement.value=t._value||""})},e.prototype.isValide=function(e){return null==e||(-1===this.maxlength||e.length<=this.maxlength)&&(null==this.pattern||this.pattern.test(e))},e.prototype.writeValue=function(e){this.isValide(e)?this.textareaControl.setValue(e,{emitEvent:!1}):-1!==this.maxlength&&e.length>this.maxlength?this.textareaControl.setValue(truncate(e,this.maxlength),{emitEvent:!1}):this.textareaElm.nativeElement.value="Incorrect value"},e.decorators=[{type:core$1.Component,args:[{selector:"asi-textarea",host:{"class":"asi-component asi-textarea"},template:'<label class="input-label" *ngIf="label != null">{{label | translate}}</label>\n<textarea #textarea\n[attr.id]="id"\n[attr.name]="name"\n[attr.rows]="rows"\n[attr.cols]="cols"\nclass="asi-focus-error"\n[attr.disabled]="disabled ? \'\' : null"\n[placeholder]="placeholder"\n[formControl]="textareaControl"></textarea>\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core$1.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:core$1.Renderer2},{type:core$1.ElementRef}]},e.propDecorators={id:[{type:core$1.Input}],name:[{type:core$1.Input}],label:[{type:core$1.Input}],labelPosition:[{type:core$1.Input}],placeholder:[{type:core$1.Input}],rows:[{type:core$1.Input}],cols:[{type:core$1.Input}],maxlength:[{type:core$1.Input}],pattern:[{type:core$1.Input}],textareaElm:[{type:core$1.ViewChild,args:["textarea"]}]},e}(DefaultControlValueAccessor),AsiTextareaModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiTextareaComponent],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiTextareaComponent],entryComponents:[],providers:[]}]}],e}(),AsiTableInliner=function(){function e(){}return e.decorators=[{type:core$1.Directive,args:[{selector:"asi-table-inliner"}]}],e.propDecorators={colSpan:[{type:core$1.Input}],columnClass:[{type:core$1.Input}],cellDef:[{type:core$1.ContentChild,args:[AsiComponentTemplateCellDef]}]},e}(),AsiTableColumn=function(){function e(){this.inversSort=!1,this.sortable=!1,this.inlineColumn=!1,this.type="text",this.onChecked=new core$1.EventEmitter,this.onAllChecked=new core$1.EventEmitter,this.asc=null,this.inliners=new Array}return e.prototype.ngOnInit=function(){this.asc=this.sortByDefault},e.prototype.toggleSort=function(){return this.asc=!this.asc},e.prototype.unsort=function(){this.asc=null},e.prototype.getAsc=function(){return this.inversSort?!this.asc:this.asc},e.prototype.getSortName=function(){return null!=this.sortName?this.sortName:this.name},e.prototype.ngAfterContentInit=function(){var t=this;this.queryColumns.forEach(function(e){t.inliners.push(e)})},e.decorators=[{type:core$1.Directive,args:[{selector:"asi-table-column"}]}],e.ctorParameters=function(){return[]},e.propDecorators={name:[{type:core$1.Input}],sortName:[{type:core$1.Input}],libelle:[{type:core$1.Input}],showIf:[{type:core$1.Input}],hideIf:[{type:core$1.Input}],inversSort:[{type:core$1.Input}],sortable:[{type:core$1.Input}],sortByDefault:[{type:core$1.Input}],columnClass:[{type:core$1.Input}],inlineColumn:[{type:core$1.Input}],type:[{type:core$1.Input}],customSort:[{type:core$1.Input}],onChecked:[{type:core$1.Output}],onAllChecked:[{type:core$1.Output}],cellDef:[{type:core$1.ContentChild,args:[AsiComponentTemplateCellDef]}],headerDef:[{type:core$1.ContentChild,args:[AsiComponentTemplateTableHeaderDef]}],queryColumns:[{type:core$1.ContentChildren,args:[AsiTableInliner]}]},e}(),AsiPaginationService=function(){function e(){}return e.prototype.getNbPages=function(e,t){return Math.ceil(e.length/t)},e.prototype.getPage=function(e,t,o){var n=new Array;return null!=e&&(n=o<this.getNbPages(e,t)?e.slice((o-1)*t,o*t):e.slice((o-1)*t)),n},e.decorators=[{type:core$1.Injectable}],e.ctorParameters=function(){return[]},e}(),AsiPaginationComponent=function(){function o(){this.nbElements=0,this.nbVisibleElements=0,this.selectedPagination=1,this.onPaginationChanged=new core$1.EventEmitter}return o.prototype.onFirstPage=function(){return 1===this.selectedPagination},o.prototype.onLastPage=function(){return this.selectedPagination===this.nbElements},o.prototype.isCurrentPagination=function(e){return this.selectedPagination===e},o.prototype.changePagination=function(e){e!==o.TRI_POINT&&(this.selectedPagination=e,this.onPaginationChanged.emit(this.selectedPagination))},o.prototype.previousPage=function(){1<this.selectedPagination&&(this.selectedPagination--,this.onPaginationChanged.emit(this.selectedPagination))},o.prototype.nextPage=function(){this.selectedPagination<this.nbElements&&(this.selectedPagination++,this.onPaginationChanged.emit(this.selectedPagination))},o.prototype.goLastPage=function(){this.selectedPagination!==this.nbElements&&(this.selectedPagination=this.nbElements,this.onPaginationChanged.emit(this.selectedPagination))},o.prototype.goFirstPage=function(){1!==this.selectedPagination&&(this.selectedPagination=1,this.onPaginationChanged.emit(this.selectedPagination))},o.prototype.getPaginationItems=function(){var e=this.selectedPagination,t=Math.floor(this.nbVisibleElements/2);return this.nbElements||(this.nbElements=1),this.nbElements<=this.nbVisibleElements?this.createNumbersTab(1,this.nbElements):e<t+2?concat(this.createNumbersTab(1,this.nbVisibleElements-1),[o.TRI_POINT,this.nbElements]):e>this.nbElements-t?concat([1,o.TRI_POINT],this.createNumbersTab(this.nbElements-this.nbVisibleElements+2,this.nbElements)):concat([1,o.TRI_POINT],this.createNumbersTab(e-t+1,e+t-1),[o.TRI_POINT,this.nbElements])},o.prototype.createNumbersTab=function(e,t){var o=e-1;return times(t-e+1,function(){return++o})},o.TRI_POINT="...",o.decorators=[{type:core$1.Component,args:[{selector:"asi-pagination",host:{"class":"asi-component asi-pagination"},template:'<div class="action-panel">\r\n <div [ngClass]="{ \'disabled\' : onFirstPage()}">\r\n <span (click)="goFirstPage()" class="paginate-boutton action" [innerHTML]="\'‹‹\'"></span>\r\n <span (click)="previousPage()" class="paginate-boutton action" [innerHTML]="\'‹\'"></span>\r\n </div>\r\n</div>\r\n<span *ngFor="let paginationItem of getPaginationItems()" [ngClass]="{\'selected\' : isCurrentPagination(paginationItem) , \'paginate-boutton\' : paginationItem != \'...\'}"\r\n (click)="changePagination(paginationItem)" [innerHTML]="paginationItem"></span>\r\n<div class="action-panel">\r\n <div [ngClass]="{ \'disabled\' : onLastPage()}">\r\n <span (click)="nextPage()" class="paginate-boutton action" [innerHTML]="\'›\'"></span>\r\n <span (click)="goLastPage()" class="paginate-boutton action" [innerHTML]="\'››\'"></span>\r\n </div>\r\n</div>'}]}],o.propDecorators={nbElements:[{type:core$1.Input}],nbVisibleElements:[{type:core$1.Input}],selectedPagination:[{type:core$1.Input}],onPaginationChanged:[{type:core$1.Output}]},o}(),AsiPaginationModule=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:core$1.NgModule,args:[{declarations:[AsiPaginationComponent],imports:[AsiNgToolsBaseModule.forRoot()],exports:[AsiNgToolsBaseModule,AsiPaginationComponent],entryComponents:[],providers:[]}]}],e}(),AsiTableSelectionModel=function Yd(e,t){this.nbItemsSelected=0,this.itemsIncluded=[],this.itemsExcluded=[],this.allChecked=!1,this.config={selectionId:e,multipage:t}},AsiTableRequest=function _d(){},AsiTableData=function ae(){this.pageIndex=1,this.results=null,this.totalElements=0,this.totalPages=0,this.paginate=!1},AsiTable=function(){function AsiTable(e){this.paginateService=e,this.autoSort=!1,this.autoPaginate=!1,this.nbElementParPage=25,this.selectionModel=new AsiTableSelectionModel("id",!1),this.fireRefreshOnInit=!0,this.changePageOnTop=!1,this.columns=new Array,this.data=new AsiTableData,this.searchDone=!1,this.loading=!1,this.allChecked=!1}return AsiTable.prototype.getColumns=function(){var t=this;return filter(this.columns,function(e){return t.filtreColumn(e)&&!e.inlineColumn})},AsiTable.prototype.getInlineColumns=function(){var t=this;return filter(this.columns,function(e){return t.filtreColumn(e)&&e.inlineColumn})},AsiTable.prototype.filtreColumn=function(e){return(null==e.showIf||e.showIf)&&(null==e.hideIf||!e.hideIf)},AsiTable.prototype.getHeaderClass=function(e){var t={};return e.columnClass&&(e.columnClass instanceof Object?t=__assign({},e.columnClass):"string"==typeof e.columnClass&&(t[""+e.columnClass]=!0)),t.sortable=e.sortable,t.asc=e.asc,t.desc=!1===e.asc,t},AsiTable.prototype.fireRefresh=function(){this.data.pageIndex=1,this.requestData()},AsiTable.prototype.updateData=function(e){this.data=e,this.autoPaginate?(this.noPaginateResults=e.results,this.paginateDatas()):this.initCheckbox(),this.autoSort&&this.sortDatas()},AsiTable.prototype.onSort=function(e){e.sortable&&(null!=this.sortedColumn&&this.sortedColumn!==e&&this.sortedColumn.unsort(),(this.sortedColumn=e).toggleSort(),this.autoSort?this.sortDatas():this.requestData())},AsiTable.prototype.onPaginationChanged=function(e){this.data.pageIndex=e,this.autoPaginate?this.paginateDatas():this.requestData(),this.changePageOnTop&&this.topElement.nativeElement.scrollIntoView()},AsiTable.prototype.paginateDatas=function(){this.data.results=this.paginateService.getPage(this.noPaginateResults,this.nbElementParPage,this.data.pageIndex),this.data.totalPages=this.paginateService.getNbPages(this.noPaginateResults,this.nbElementParPage),this.data.totalElements=this.noPaginateResults.length,this.initCheckbox()},AsiTable.prototype.requestData=function(){var t=this,e=this.getAsiTableRequest();this.onRequestData&&(null!=this.requestDataSubcription&&this.requestDataSubcription.unsubscribe(),this.requestDataSubcription=observe(this.onRequestData(e)).subscribe(function(e){t.updateData(e)}))},AsiTable.prototype.getAsiTableRequest=function(){var e=new AsiTableRequest;return e.pageIndex=this.data.pageIndex,e.nbElementsParPage=this.nbElementParPage,null!=this.sortedColumn&&(e.tri=this.sortedColumn.getSortName(),e.asc=this.sortedColumn.getAsc()),e},AsiTable.prototype.sortDatas=function(){null!=this.sortedColumn&&(this.autoPaginate?(this.noPaginateResults=this.internalSortData(this.noPaginateResults),this.paginateDatas()):this.data.results=this.internalSortData(this.data.results),this.loading=!1)},AsiTable.prototype.internalSortData=function(e){var t={sort:this.sortedColumn.getSortName(),asc:this.sortedColumn.getAsc()};return this.sortedColumn.customSort?this.sortedColumn.customSort(e,t):this.customSort?this.customSort(e,t):orderByWithoutCase(e,this.sortedColumn.getSortName(),this.sortedColumn.getAsc()?"asc":"desc"),e},AsiTable.prototype.getCellValue=function(e,t){return this.getProperty(e,t.name)},AsiTable.prototype.getProperty=function(e,t){return get(e,t)},AsiTable.prototype.initCheckbox=function(){var n=this;this.columns.forEach(function(e){"checkbox"===e.type&&(n.selectionModel.allChecked?forEach(n.data.results,function(e){var t=n.getProperty(e,n.selectionModel.config.selectionId),o=null!=find(n.selectionModel.itemsExcluded,function(e){return n.matchRow(t,e)});e.checked=!o}):forEach(n.data.results,function(e){var t=n.getProperty(e,n.selectionModel.config.selectionId),o=null!=find(n.selectionModel.itemsIncluded,function(e){return n.matchRow(t,e)});e.checked=o}))})},AsiTable.prototype.onAllChecked=function(e){var t=this;this.selectionModel.allChecked=this.allChecked,this.selectionModel.itemsIncluded=[],this.selectionModel.itemsExcluded=[],forEach(this.data.results,function(e){e.checked=t.selectionModel.allChecked}),this.selectionModel.allChecked?this.selectionModel.config.multipage?this.selectionModel.nbItemsSelected=this.data.totalElements:this.selectionModel.nbItemsSelected=this.data.results.length:this.selectionModel.nbItemsSelected=0,e.onAllChecked.emit(this.selectionModel.allChecked)},AsiTable.prototype.onChecked=function(e,t){var o=this,n=this.getProperty(e,this.selectionModel.config.selectionId);this.selectionModel.allChecked?e.checked?(remove(this.selectionModel.itemsExcluded,function(e){return o.matchRow(n,e)}),this.selectionModel.nbItemsSelected++):(this.selectionModel.itemsExcluded.push(e),this.selectionModel.nbItemsSelected--):e.checked?(this.selectionModel.itemsIncluded.push(e),this.selectionModel.nbItemsSelected++):(remove(this.selectionModel.itemsIncluded,function(e){return o.matchRow(n,e)}),this.selectionModel.nbItemsSelected--),t.onChecked.emit(e),this.updateAllChecked()},AsiTable.prototype.matchRow=function(e,t){return e===this.getProperty(t,this.selectionModel.config.selectionId)},AsiTable.prototype.updateAllChecked=function(){this.selectionModel.config.multipage?this.allChecked=0<this.selectionModel.nbItemsSelected&&this.selectionModel.nbItemsSelected===this.data.totalElements:this.allChecked=0<this.selectionModel.nbItemsSelected&&this.selectionModel.nbItemsSelected===this.data.results.length},AsiTable.prototype.getRowClass=function(row){if(null!=row&&null!=this.rowClass){if(this.isFunction(this.rowClass))return this.rowClass(row);var rowClassStr=JSON.stringify(this.rowClass);rowClassStr=replace(rowClassStr,new RegExp("{row}","g"),"row"),rowClassStr=replace(rowClassStr,new RegExp("'","g"),'"');var jsonRowClass=JSON.parse(rowClassStr);for(var key in jsonRowClass)jsonRowClass.hasOwnProperty(key)&&(jsonRowClass[key]=eval(jsonRowClass[key]));return jsonRowClass}},AsiTable.prototype.isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)},AsiTable.prototype.ngAfterContentInit=function(){var t=this;this.queryColumns.forEach(function(e){t.columns.push(e)}),this.fireRefreshOnInit&&this.requestData()},AsiTable.decorators=[{type:core$1.Component,args:[{selector:"asi-table",host:{"class":"asi-component asi-table"},template:'<table #table>\r\n <thead>\r\n <tr>\r\n <th *ngFor="let column of getColumns()" [ngClass]="getHeaderClass(column)" (click)="onSort(column)">\r\n <ng-container *ngIf="column.type == \'text\'">\r\n <span class="header">\r\n <span *ngIf="!column.headerDef">{{column.libelle | translate}}</span>\r\n <ng-template *ngIf="column.headerDef" [ngTemplateOutlet]="column.headerDef.template" [ngTemplateOutletContext]="{$implicit : column}"></ng-template>\r\n <span class="sortIconDesc" [innerHtml]="\'▼\'"></span>\r\n <span class="sortIconAsc" [innerHtml]="\'▲\'"></span>\r\n </span>\r\n </ng-container>\r\n <asi-checkbox *ngIf="column.type == \'checkbox\'" [(ngModel)]="allChecked" (onValueChange)="onAllChecked(column)"></asi-checkbox>\r\n </th>\r\n </tr>\r\n </thead>\r\n <ng-container *ngFor="let row of data?.results">\r\n <tbody [ngClass]="getRowClass(row)">\r\n <tr>\r\n <td *ngFor="let column of getColumns()" [ngClass]="column.columnClass">\r\n <ng-container *ngIf="column.type == \'text\'">\r\n <span *ngIf="!column.cellDef">{{getCellValue(row, column)}}</span>\r\n <ng-template *ngIf="column.cellDef" [ngTemplateOutlet]="column.cellDef.template" [ngTemplateOutletContext]="{$implicit : row}"></ng-template>\r\n </ng-container>\r\n <asi-checkbox *ngIf="column.type == \'checkbox\'" [(ngModel)]="row.checked" (onValueChange)="onChecked(row, column)"></asi-checkbox>\r\n </td>\r\n </tr>\r\n <tr *ngFor="let inlineColumn of getInlineColumns()" class="inlined" [ngClass]="inlineColumn.columnClass">\r\n <td *ngIf="inlineColumn.inliners.length == 0" [attr.colspan]="getColumns().length" class="inlined">\r\n <span *ngIf="!inlineColumn.cellDef">{{getCellValue(row, inlineColumn)}}</span>\r\n <ng-template *ngIf="inlineColumn.cellDef" [ngTemplateOutlet]="inlineColumn.cellDef.template" [ngTemplateOutletContext]="{$implicit : row}"></ng-template>\r\n </td>\r\n <ng-container *ngIf="inlineColumn.inliners.length > 0">\r\n <td *ngFor="let inliner of inlineColumn.inliners" [attr.colspan]="inliner.colSpan" [ngClass]="inliner.columnClass">\r\n <span *ngIf="!inliner.cellDef">{{getCellValue(row, inlineColumn)}}</span>\r\n