UNPKG

e5core-angular-ui

Version:

e5 Anywhere Angular UI

1 lines 260 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("primeng/fileupload"),require("primeng/treetable"),require("highcharts-angular"),require("@angular/common/http"),require("@angular/platform-browser"),require("rxjs/operators"),require("@angular/animations"),require("guid-typescript"),require("@angular/cdk/table"),require("@angular/material"),require("highcharts/highstock"),require("rxjs"),require("e5core-angular-services"),require("@angular/common"),require("@angular/forms"),require("@angular/core"),require("ngx-material-timepicker")):"function"==typeof define&&define.amd?define("e5core-angular-ui",["exports","primeng/fileupload","primeng/treetable","highcharts-angular","@angular/common/http","@angular/platform-browser","rxjs/operators","@angular/animations","guid-typescript","@angular/cdk/table","@angular/material","highcharts/highstock","rxjs","e5core-angular-services","@angular/common","@angular/forms","@angular/core","ngx-material-timepicker"],t):t(e["e5core-angular-ui"]={},e.fileupload,e.treetable,e.highchartsAngular,e.ng.common.http,e.ng.platformBrowser,e.rxjs.operators,e.ng.animations,e.guidTypescript,e.ng.cdk.table,e.ng.material,e.Highcharts,e.rxjs,e.i1$1,e.ng.common,e.ng.forms,e.ng.core,e.ngxMaterialTimepicker)}(this,function(e,t,n,o,r,i,s,a,l,c,u,p,f,d,h,m,y,g){"use strict";var w=function(e,t){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function v(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var I=function(){return(I=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function k(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)a.push(o.value)}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a}function C(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(k(arguments[t]));return e}var b=function(t){function e(){var e=t.call(this)||this;return e.menus=null,e.tabs=null,e.workId=null,e.fieldsets=null,e.properties=null,e}return v(e,t),e}(d.UIWorkItemModel);function S(e,t,n){var o=undefined;if(e&&t&&e.properties){var r=e.properties.find(function(e){return e.propertyId==t});o=r?r.value:undefined}return o==undefined&&n?n:o}function D(e,t,n){var o=undefined;if(e&&t&&e.properties){var r=e.properties.find(function(e){return e.propertyId==t});o=r?r.resolvedValue:undefined}return o==undefined&&n?n:o}function $(){return new b}var x=function(){function e(e,t){this.getNextService=e,this.uiWorkItemService=t}return e.prototype.getNextWorkItem=function(o,e){var r=this,i=new f.Subject;return this.getNextService.getNextWorkItem({lockWorkItem:e}).subscribe(function(e){var t=e.workItem;if(t&&t.id&&!t.id.isEmpty)r.uiWorkItemService.getAll(t.id).subscribe(function(e){var t=o.getValue(),n=I({},t,e);o.next(n),i.next(n)},function(e){i.error(e)},function(){i.complete()});else{var n=$();o.next(n),i.next(n)}},function(e){return i.error(e)}),i},e.prototype.getWorkItem=function(e,n,t){var o=new f.Subject;return this.uiWorkItemService.getAll(e).subscribe(function(e){var t=I({},n.getValue(),e);n.next(t),o.next(t)},function(e){o.error(e)},function(){o.complete()}),o},e.decorators=[{type:y.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:d.WorkGetNextService},{type:d.UiWorkItemService}]},e.ngInjectableDef=y.defineInjectable({factory:function(){return new e(y.inject(d.WorkGetNextService),y.inject(d.UiWorkItemService))},token:e,providedIn:"root"}),e}(),T=function(){function e(e){this.workDelivery=e}return e.prototype.ngOnInit=function(){null!=this.workItem$||console.error("e5core-angular-ui-get-next [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.prototype.getNext=function(){this.workDelivery.getNextWorkItem(this.workItem$,!!this.lock).subscribe(function(e){},function(e){return console.error(e)})},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-get-next",template:'<p>\n <button mat-raised-button (click)="getNext()">Get Next</button>\n</p>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:x}]},e.propDecorators={workItem$:[{type:y.Input}],lock:[{type:y.Input}]},e}(),O={Box:0,Bootstrap:1,Material:2};O[O.Box]="Box",O[O.Bootstrap]="Bootstrap",O[O.Material]="Material";var E=function(){function e(){}return e.prototype.current=function(){return O.Material},e.decorators=[{type:y.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=y.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),M=function(){function e(e){this.style=e}return e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?this.workItem$.subscribe(function(e){t.workItemModel=e}):console.error("e5core-ui-work-menu-item [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.prototype.onClick=function(e){alert("You clicked "+e.menuCode)},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-item",template:"\n <span [ngSwitch]=\"style.current()\">\n <e5core-ui-work-menu-item-box (clickEvent)='onClick($event)' *ngSwitchCase='0' [workItem$]='workItem$' [menuItem]='menuItem'></e5core-ui-work-menu-item-box>\n <e5core-ui-work-menu-item-bootstrap (clickEvent)='onClick($event)' *ngSwitchCase='1' [workItem$]='workItem$' [menuItem]='menuItem'></e5core-ui-work-menu-item-bootstrap>\n <e5core-ui-work-menu-item-material (clickEvent)='onClick($event)' *ngSwitchCase='2' [workItem$]='workItem$' [menuItem]='menuItem'></e5core-ui-work-menu-item-material>\n </span>\n ",changeDetection:y.ChangeDetectionStrategy.Default}]}],e.ctorParameters=function(){return[{type:E}]},e.propDecorators={workItem$:[{type:y.Input}],menuItem:[{type:y.Input}]},e}(),F=function(){function e(){this.clickEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.onClick=function(e,t){this.clickEvent.emit({$event:e,menuCode:t})},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-item-box",template:"<div class='e5-component'>\n <div class='e5-title'>e5core-ui-work-menu-item</div>\n <div class='e5-content'>\n <code>{{menuItem | json}}</code>\n </div>\n </div>",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],menuItem:[{type:y.Input}],clickEvent:[{type:y.Output}]},e}(),R=function(){function e(){this.clickEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.onClick=function(e,t){this.clickEvent.emit({$event:e,menuCode:t})},e.prototype.mapIcon=function(e){switch(e.toLowerCase()){case"saveandclose":return"close";case"diarise":return"date_range";case"complete":return"assignment_turned_in";case"endgetnext":return"stop";case"clonewithoptions":return"file_copy";case"reject":return"highlight_off"}return e},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-item-material",template:"<button (click)='onClick($event,menuItem.code)' mat-menu-item>\n <mat-icon>{{mapIcon(menuItem.code)}}</mat-icon>\n <span>{{menuItem.label}}</span>\n</button>",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],menuItem:[{type:y.Input}],clickEvent:[{type:y.Output}]},e}(),A=function(){function e(){this.clickEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.onClick=function(e,t){this.clickEvent.emit({$event:e,menuCode:t})},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-item-bootstrap",template:'<button (click)=\'onClick($event,menuItem.code)\' type="button" class="btn btn-secondary" >{{menuItem.label}}</button>&nbsp;',styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],menuItem:[{type:y.Input}],clickEvent:[{type:y.Output}]},e}(),P=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-box",template:"<div class='e5-component' *ngIf='workItem$'>\n <div class='e5-title'>e5core-ui-work-menu {{(workItem$ | async).workId}}</div>\n <div class='e5-content' *ngIf='menuItems'>\n <div *ngFor='let menuItem of menuItems'>\n <e5core-ui-work-menu-item [workItem$]='workItem$' [menuItem]='menuItem'></e5core-ui-work-menu-item>\n </div>\n </div>\n</div>",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],menuItems:[{type:y.Input}]},e}(),V=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-bootstrap",template:"<div>\n <e5core-ui-work-menu-item *ngFor='let menuItem of menuItems' [workItem$]='workItem$' [menuItem]='menuItem'></e5core-ui-work-menu-item>\n</div>",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],menuItems:[{type:y.Input}]},e}(),W=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu-material",template:"<button mat-icon-button [matMenuTriggerFor]=\"menu\">\n<mat-icon>more_vert</mat-icon>\n</button>\n<mat-menu #menu=\"matMenu\">\n <e5core-ui-work-menu-item\n *ngFor='let menuItem of menuItems'\n [workItem$]='workItem$'\n [menuItem]='menuItem'>\n </e5core-ui-work-menu-item>\n</mat-menu>",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],menuItems:[{type:y.Input}]},e}(),z=function(){function e(e,t){this.style=e,this.cd=t}return e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?this.workItem$.subscribe(function(e){t.workItemModel=e,t.menuItems=[],t.workItemModel&&t.workItemModel.menus&&(t.menuItems=t.workItemModel.menus),t.cd.markForCheck()},function(e){return t.menuItems=null}):console.error("e5core-ui-work-menu [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-menu",template:"\n <span [ngSwitch]=\"style.current()\">\n <e5core-ui-work-menu-box *ngSwitchCase='0' [workItem$]='workItem$' [menuItems]='menuItems'></e5core-ui-work-menu-box>\n <e5core-ui-work-menu-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [menuItems]='menuItems'></e5core-ui-work-menu-bootstrap>\n <e5core-ui-work-menu-material *ngSwitchCase='2' [workItem$]='workItem$' [menuItems]='menuItems'></e5core-ui-work-menu-material>\n </span>\n ",changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E},{type:y.ChangeDetectorRef}]},e.propDecorators={workItem$:[{type:y.Input}]},e}(),U=function(){function e(e,t){this.style=e,this.cd=t}return e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?this.workItem$.subscribe(function(e){t.workItem=e,t.cd.markForCheck()},function(e){return t.workItem=null}):console.error("e5core-ui-work-item [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-item",template:"\n <span [ngSwitch]=\"style.current()\">\n <e5core-ui-work-item-box *ngSwitchCase='0' [workItem$]='workItem$' [workItem]='workItem'></e5core-ui-work-item-box>\n <e5core-ui-work-item-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [workItem]='workItem'></e5core-ui-work-item-bootstrap>\n <e5core-ui-work-item-material *ngSwitchCase='2' [workItem$]='workItem$' [workItem]='workItem'></e5core-ui-work-item-material>\n </span>\n ",changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E},{type:y.ChangeDetectorRef}]},e.propDecorators={workItem$:[{type:y.Input}]},e}(),L=function(){function e(e,t){this.style=e,this.cd=t}return e.prototype.updateTabModel=function(e){var t=this;if(this.tab=null,this.fieldSetIds=[],this.workItemModel&&this.workItemModel.tabs&&this.workItemModel.tabs){var n=this.workItemModel.tabs.find(function(e){return e.tabId==t.tabId});n?(this.tab=n,this.fieldSetIds=n.fieldSetIds):console.warn("tabId "+this.tabId+" is not in parent e5core-ui-work-tab-set")}},e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?null!=this.tabId?this.workItem$.subscribe(function(e){t.workItemModel=e,t.updateTabModel(t.tabId),t.cd.markForCheck()}):console.error("e5core-ui-work-tab [tabId] must have a number value"):console.error("e5core-ui-work-tab [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab",template:"\n <span *ngIf=\"workItem$ && tabId\" [ngSwitch]=\"style.current()\">\n <e5core-ui-work-tab-box *ngSwitchCase='0' [workItem$]='workItem$' [tab]='tab' [fieldSetIds]='fieldSetIds' ></e5core-ui-work-tab-box>\n <e5core-ui-work-tab-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [tab]='tab' [fieldSetIds]='fieldSetIds' ></e5core-ui-work-tab-bootstrap>\n <e5core-ui-work-tab-material *ngSwitchCase='2' [workItem$]='workItem$' [tab]='tab' [fieldSetIds]='fieldSetIds' ></e5core-ui-work-tab-material>\n </span>\n <div *ngIf=\"!(workItem$ && tabId)\" class=\"e5core-component-error\">&lt;e5core-ui-work-tab&gt; [tabId] must be > 0 and [workItem$] must have a BehaviorSubject&lt;WorkItemModel&gt;</div>",changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E},{type:y.ChangeDetectorRef}]},e.propDecorators={workItem$:[{type:y.Input}],tabId:[{type:y.Input}]},e}(),N=function(){function e(e,t){this.style=e,this.cd=t}return e.prototype.updateFieldSetModel=function(e){var t=this;if(this.fieldSet=null,this.fields=[],this.workItemModel&&this.workItemModel.fieldsets){var n=this.workItemModel.fieldsets.find(function(e){return e.fieldSetId==t.fieldSetId});n?(this.fieldSet=n,this.fields=n.fields):console.error("fieldSetId "+this.fieldSetId+" not found in workItem$")}else console.error("No fieldsets in workItem$");this.cd.markForCheck()},e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?null!=this.fieldSetId?this.workItem$.subscribe(function(e){t.workItemModel=e,t.updateFieldSetModel(t.fieldSetId),t.cd.markForCheck()}):console.error("e5core-ui-work-field-set [fieldSetId] must have a number value"):console.error("e5core-ui-work-field-set [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-field-set",template:"\n <span *ngIf=\"workItem$ && fieldSetId\" [ngSwitch]=\"style.current()\">\n <e5core-ui-work-field-set-box *ngSwitchCase='0' [workItem$]='workItem$' [fieldSet]='fieldSet' [fields]='fields' [readonly]='readonly'></e5core-ui-work-field-set-box>\n <e5core-ui-work-field-set-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [fieldSet]='fieldSet' [fields]='fields' [readonly]='readonly'></e5core-ui-work-field-set-bootstrap>\n <e5core-ui-work-field-set-material *ngSwitchCase='2' [workItem$]='workItem$' [fieldSet]='fieldSet' [fields]='fields' [readonly]='readonly'></e5core-ui-work-field-set-material>\n </span>\n <div *ngIf=\"!(workItem$ && fieldSetId)\" class=\"e5core-component-error\">&lt;e5core-ui-work-field-set&gt; [fieldSetId] must be > 0 and [workItem$] must have a BehaviorSubject&lt;WorkItemModel&gt;</div>"}]}],e.ctorParameters=function(){return[{type:E},{type:y.ChangeDetectorRef}]},e.propDecorators={workItem$:[{type:y.Input}],fieldSetId:[{type:y.Input}],readonly:[{type:y.Input}]},e}(),j=function(){function e(e){this.style=e}return e.prototype.ngOnInit=function(){var r=this;null!=this.workItem$?null!==this.fieldSetId&&""!==this.propertyId?this.workItem$.subscribe(function(e){if(r.workItemModel=e,r.field=null,r.property=null,r.workItemModel&&r.workItemModel.fieldsets&&r.workItemModel.properties){var t=r.workItemModel.fieldsets.find(function(e){return e.fieldSetId==r.fieldSetId});if(t){var n=t.fields.find(function(e){return e.propertyId==r.propertyId});if(n){var o=r.workItemModel.properties.find(function(e){return e.propertyId==r.propertyId});o?(r.field=n,r.property=o):console.warn("propertyId "+r.propertyId+" from found in workItem$ properties")}else console.warn("propertyId "+r.propertyId+" from found in workItem$ fields")}else console.warn("fieldSetId "+r.fieldSetId+" not found in workItem$")}}):console.error("e5core-ui-work-field [propertyId] and [fieldSetId] must have a value"):console.error("e5core-ui-work-field [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-field",template:"\n <span *ngIf=\"workItem$ && fieldSetId && propertyId && property && field\" [ngSwitch]=\"style.current()\">\n <e5core-ui-work-field-box *ngSwitchCase='0' [workItem$]='workItem$' [field]='field' [property]='property' [readonly]='readonly' ></e5core-ui-work-field-box>\n <e5core-ui-work-field-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [field]='field' [property]='property' [readonly]='readonly' ></e5core-ui-work-field-bootstrap>\n <e5core-ui-work-field-material *ngSwitchCase='2' [workItem$]='workItem$' [field]='field' [property]='property' [readonly]='readonly' ></e5core-ui-work-field-material>\n </span>\n <div *ngIf=\"!(workItem$ && fieldSetId && propertyId)\" class=\"e5core-component-error\">&lt;e5core-ui-work-field-set&gt; missing [fieldSetId], [propertyId] and [workItem$] must have a BehaviorSubject&lt;WorkItemModel&gt;</div>"}]}],e.ctorParameters=function(){return[{type:E}]},e.propDecorators={workItem$:[{type:y.Input}],fieldSetId:[{type:y.Input}],propertyId:[{type:y.Input}],readonly:[{type:y.Input}]},e}(),B=function(){function e(e,t){this.style=e,this.cd=t}return e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?this.workItem$.subscribe(function(e){t.workItem=e,t.tabs=e.tabs,t.cd.markForCheck()},function(e){return t.workItem=null}):console.error("e5core-ui-work-tab-set [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.prototype.errorCount=function(e){if(!this.workItem||!this.workItem.fieldsets)return 0;this.workItem.fieldsets;return 0},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-set",template:"\n <span [ngSwitch]=\"style.current()\">\n <e5core-ui-work-tab-set-box *ngSwitchCase='0' [workItem$]='workItem$' [tabs]='tabs'></e5core-ui-work-tab-set-box>\n <e5core-ui-work-tab-set-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [tabs]='tabs'></e5core-ui-work-tab-set-bootstrap>\n <e5core-ui-work-tab-set-material *ngSwitchCase='2' [workItem$]='workItem$' [tabs]='tabs'></e5core-ui-work-tab-set-material>\n </span>",changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E},{type:y.ChangeDetectorRef}]},e.propDecorators={workItem$:[{type:y.Input}]},e}(),G=function(){function e(){}return e.prototype.ngOnInit=function(){},e.propDecorators={workItem$:[{type:y.Input}],readonly:[{type:y.Input}],pagesizes:[{type:y.Input}]},e}(),_=function Co(){},q=function(){function e(e,t){this.http=e,this.config=t}return e.prototype.getWorkAttachments=function(e,n,o,t){var r=new f.BehaviorSubject(new _),i=this.config.settings.apiServer.baseUrl,a=this.config.settings.apiServer.scope,s=n*o,l=i+"/"+a+"/odata/Ui/Attachments/"+e.toString()+"?$count=true&$top="+(o||10)+"&$skip="+(s||0);return t&&t.orderby&&""!==t.orderby&&(l+="&$orderby="+encodeURIComponent(t.orderby)),this.http.get(l).subscribe(function(e){var t=new _;t.count=e["@odata.count"],t.page=n,t.pagesize=o,t.data=e.value,r.next(t)},function(e){console.error(e),r.error(e)}),r},e.decorators=[{type:y.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r.HttpClient},{type:d.E5ConfigurationService}]},e.ngInjectableDef=y.defineInjectable({factory:function(){return new e(y.inject(r.HttpClient),y.inject(d.E5ConfigurationService))},token:e,providedIn:"root"}),e}(),Y=function(o){function e(e,t){var n=o.call(this)||this;return n.workId=e,n.workAttachmentsService=t,n.subject$=new f.BehaviorSubject([]),n.orderby={active:"Id",direction:"desc"},n.loading$=new f.BehaviorSubject(!1),n}return v(e,o),Object.defineProperty(e.prototype,"paginator",{set:function(e){var t=this;this._paginator=e,this._paginator.page.subscribe(function(e){t.update()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sort",{set:function(e){var t=this;this._sort=e,this._sort.sortChange.subscribe(function(e){t.orderby=e,t.update()})},enumerable:!0,configurable:!0}),e.prototype.setWorkId=function(e){this.workId=e,this.update()},Object.defineProperty(e.prototype,"loadingEvents",{get:function(){return this.loading$},enumerable:!0,configurable:!0}),e.prototype.update=function(){var t=this;if(this.workId&&l.Guid.isGuid(this.workId)&&this.workId.toString()!==l.Guid.EMPTY){var e=this._paginator?this._paginator.pageIndex:0,n=this._paginator?this._paginator.pageSize:10,o={},r=this.orderby;r&&r.direction&&r.active&&(o.orderby=r.active+" "+r.direction),this.loading$.next(!0),this.workAttachmentsService.getWorkAttachments(this.workId,e,n,o).subscribe(function(e){t._paginator.length=e.count,t.subject$.next(e.data),t.loading$.next(!1)},function(e){console.error(e),t.loading$.next(!1)})}else this.subject$.next([])},e.prototype.connect=function(){return this.update(),this.subject$},e.prototype.disconnect=function(){},e}(c.DataSource),H=function(n){function e(e){var t=n.call(this)||this;return t.workAttachments=e,t.attachmentDownloadEvent=new y.EventEmitter,t.attachmentSelectEvent=new y.EventEmitter,t.displayedColumns=["Select","Menu","Name","Type"],t.isLoading=!0,t.length=0,t.pageSize=10,t}return v(e,n),e.prototype.ngOnInit=function(){var t=this;this.pageSizeOptions=this.pagesizes&&0<this.pagesizes.length?this.pagesizes:[5,10,25,50],this.dataSource=new Y(l.Guid.EMPTY,this.workAttachments),this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.dataSource.loadingEvents.subscribe(function(e){t.isLoading=e}),"undefined"!=typeof this.workItem$&&this.workItem$.subscribe(function(e){t.dataSource.setWorkId(e.workId)}),"undefined"!=typeof this.fileUpload$&&this.fileUpload$.subscribe(function(e){t.dataSource.setWorkId(e.workId)})},e.prototype.refresh=function(){this.dataSource.update()},e.prototype.onAttachmentDownload=function(e,t){this.attachmentDownloadEvent.emit({event:e,element:t})},e.prototype.onAttachmentSelect=function(e,t){this.attachmentSelectEvent.emit({workId:t.WorkId,type:"E5SharepointAttachment",attachmentId:t.Id,fullUrl:null,name:null})},e.prototype.setPageSizeOptions=function(e){this.pageSizeOptions=e.split(",").map(function(e){return+e})},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-attachments-material",template:'<div class="e5core-ui-work-attachments">\n\n <div *ngIf="isLoading" class="mat-spinner-holder" align="center">\n <mat-spinner></mat-spinner>\n </div>\n\n <table mat-table [dataSource]="dataSource" matSort class="e5core-ui-work-attachments">\n\n\n \x3c!-- Select --\x3e\n <ng-container matColumnDef="Select">\n <th mat-header-cell *matHeaderCellDef> </th>\n <td mat-cell *matCellDef="let element"> \n <button (click)=\'onAttachmentSelect($event, element)\' mat-icon-button>\n <mat-icon>attach_file</mat-icon>\n </button>\n </td>\n </ng-container>\n\n \x3c!-- Menu --\x3e\n <ng-container matColumnDef="Menu">\n <th mat-header-cell *matHeaderCellDef> </th>\n <td mat-cell *matCellDef="let element"> \n <button mat-icon-button [matMenuTriggerFor]="menu">\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #menu="matMenu">\n <button (click)=\'onAttachmentDownload($event, element)\' mat-menu-item>\n <mat-icon>cloud_download</mat-icon>\n <span>Download</span>\n </button>\n </mat-menu>\n </td>\n </ng-container>\n\n \x3c!-- Name --\x3e\n <ng-container matColumnDef="Name">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>\n <td mat-cell *matCellDef="let element"> {{element.Name}} </td>\n </ng-container>\n\n \x3c!-- Type --\x3e\n <ng-container matColumnDef="Type">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Type </th>\n <td mat-cell *matCellDef="let element"> {{element.Type}} </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n\n <mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" (page)="pageEvent = $event" showFirstLastButtons></mat-paginator>\n</div>',styles:["table.e5core-ui-work-attachments{width:100%}table.e5core-ui-work-attachments tr th:nth-child(1),table.e5core-ui-work-attachments tr th:nth-child(2){width:50pt}table.e5core-ui-work-attachments tr th:nth-child(3){width:220pt}.e5core-ui-work-attachments .mat-spinner-holder{width:100%;padding:20pt;position:relative;top:30px;height:1px}.e5core-ui-work-attachments .mat-paginator{margin-top:0;background:0 0}"]}]}],e.ctorParameters=function(){return[{type:q}]},e.propDecorators={workItem$:[{type:y.Input}],fileUpload$:[{type:y.Input}],attachmentDownloadEvent:[{type:y.Output}],attachmentSelectEvent:[{type:y.Output}],sort:[{type:y.ViewChild,args:[u.MatSort]}],paginator:[{type:y.ViewChild,args:[u.MatPaginator]}]},e}(G),Z=function(){function e(e,t,n){this.style=e,this.config=t,this.changeDetectorRef=n,this.attachmentDownloadEvent=new y.EventEmitter,this.attachmentSelectEvent=new y.EventEmitter,this.downloadUrl=""}return e.prototype.ngOnInit=function(){var t=this;"undefined"!=typeof this.workItem$?("undefined"!=typeof this.workItem$&&this.workItem$.subscribe(function(e){t.updateData()}),"undefined"!=typeof this.fileUpload$&&this.fileUpload$.subscribe(function(e){t.updateData()})):console.error("e5core-ui-work-attachments [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.prototype.ngAfterViewInit=function(){},e.prototype.refresh=function(){this.workAttachmentsMaterialComponent.refresh()},e.prototype.onAttachmentDownload=function(e){var t=this,n=this.config.settings.apiServer.baseUrl,o=this.config.settings.apiServer.scope,r=this.workItem$.getValue();this.downloadUrl=n+"/"+o+"/api/ui/Attachment/Download/"+r.workId+"/"+e.element.Id,this.changeDetectorRef.detectChanges(),setTimeout(function(){t.downloadUrl=""},200),this.attachmentDownloadEvent.emit(e)},e.prototype.onAttachmentSelect=function(e){this.attachmentSelectEvent.emit(e)},e.prototype.updateData=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-attachments",template:'\n <span *ngIf="workItem$" [ngSwitch]="style.current()">\n <e5core-ui-work-attachments-material *ngSwitchCase=\'2\' [workItem$]=\'workItem$\' [readonly]=\'readonly\' [pagesizes]=\'pagesizes\' (attachmentDownloadEvent)=\'onAttachmentDownload($event)\' (attachmentSelectEvent)=\'onAttachmentSelect($event)\' ></e5core-ui-work-attachments-material>\n </span>\n <div *ngIf="!(workItem$)" class="e5core-component-error">&lt;e5core-ui-work-attachments&gt; [workItem$] must have a BehaviorSubject&lt;WorkItemModel&gt;</div>\n <iframe width="0" height="0" *ngIf="!(downloadUrl == \'\')" [src]="downloadUrl | safe" style="width:0;height:0;border:0; border:none; position: absolute;"></iframe>',changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E},{type:d.E5ConfigurationService},{type:y.ChangeDetectorRef}]},e.propDecorators={workItem$:[{type:y.Input}],fileUpload$:[{type:y.Input}],readonly:[{type:y.Input}],pagesizes:[{type:y.Input}],attachmentDownloadEvent:[{type:y.Output}],attachmentSelectEvent:[{type:y.Output}],workAttachmentsMaterialComponent:[{type:y.ViewChild,args:[H]}]},e}(),Q=function(){function e(){}return e.prototype.ngOnInit=function(){var t=this;null!=this.workItem$?this.workItem$.subscribe(function(e){t.workItemModel=e}):console.error("e5core-ui-work-field-type-input [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.prototype.dispatchPropertyChange=function(t,e,n){var o=I({},this.workItem$.getValue()),r=o.properties.find(function(e){return e.propertyId==t});r.resolvedValue=e,r.value=e,this.workItem$.next(o)},e.propDecorators={workItem$:[{type:y.Input}],field:[{type:y.Input}],property:[{type:y.Input}],readonly:[{type:y.Input}]},e}(),X=function(n){function e(e){var t=n.call(this)||this;return t.style=e,t}return v(e,n),e.prototype.valueChange=function(e){this.dispatchPropertyChange(this.property.propertyId,e.value,e.error)},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-field-type-input",template:"\n <span [ngSwitch]=\"style.current()\">\n <e5core-ui-work-field-type-input-box *ngSwitchCase='0' [workItem$]='workItem$' [field]='field' [property]='property' [pattern]='pattern' (valueChange)='valueChange($event)' [readonly]='readonly'></e5core-ui-work-field-type-input-box>\n <e5core-ui-work-field-type-input-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [field]='field' [property]='property' [pattern]='pattern' (valueChange)='valueChange($event)' [readonly]='readonly'></e5core-ui-work-field-type-input-bootstrap>\n <e5core-ui-work-field-type-input-material *ngSwitchCase='2' [workItem$]='workItem$' [field]='field' [property]='property' [pattern]='pattern' (valueChange)='valueChange($event)' [readonly]='readonly'></e5core-ui-work-field-type-input-material>\n </span>",changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E}]},e.propDecorators={pattern:[{type:y.Input}]},e}(Q),J=function(n){function e(e){var t=n.call(this)||this;return t.style=e,t}return v(e,n),e.prototype.valueChange=function(e){this.dispatchPropertyChange(this.property.propertyId,e.value,e.error)},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-field-type-integer",template:"\n <span [ngSwitch]=\"style.current()\">\n <e5core-ui-work-field-type-integer-box *ngSwitchCase='0' [workItem$]='workItem$' [field]='field' [property]='property' (valueChange)='valueChange($event)' [readonly]='readonly'></e5core-ui-work-field-type-integer-box>\n <e5core-ui-work-field-type-integer-bootstrap *ngSwitchCase='1' [workItem$]='workItem$' [field]='field' [property]='property' (valueChange)='valueChange($event)' [readonly]='readonly'></e5core-ui-work-field-type-integer-bootstrap>\n <e5core-ui-work-field-type-integer-material *ngSwitchCase='2' [workItem$]='workItem$' [field]='field' [property]='property' (valueChange)='valueChange($event)' [readonly]='readonly'></e5core-ui-work-field-type-integer-material>\n </span>",changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E}]},e}(Q),K=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-item-box",template:"<div class='e5-component' *ngIf=\"workItem$\">\n <div class='e5-title'>e5core-ui-work-item {{workItem.workId}}</div>\n <div class='e5-content'>\n <e5core-ui-work-menu [workItem$]=\"workItem$\"></e5core-ui-work-menu>\n <e5core-ui-work-tab-set [workItem$]=\"workItem$\"></e5core-ui-work-tab-set>\n <e5core-ui-work-history></e5core-ui-work-history>\n <e5core-ui-work-attachments></e5core-ui-work-attachments>\n <e5core-ui-work-casenotes></e5core-ui-work-casenotes>\n </div>\n</div>\n",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],workItem:[{type:y.Input}]},e}(),ee=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-item-bootstrap",template:'<div class="card" *ngIf="workItem$">\n <div class="card-body">\n <h5 class="card-title">{{(workItem$ | async).workId}}</h5>\n \x3c!-- <h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6> --\x3e\n <p class="card-text">\n <e5core-ui-work-menu [workItem$]="workItem$"></e5core-ui-work-menu>\n <e5core-ui-work-tab-set [workItem$]="workItem$"></e5core-ui-work-tab-set>\n <e5core-ui-work-history></e5core-ui-work-history>\n <e5core-ui-work-attachments></e5core-ui-work-attachments>\n <e5core-ui-work-casenotes></e5core-ui-work-casenotes>\n </p>\n <a href="#" class="card-link">Save</a>\n <a href="#" class="card-link">Cancel</a>\n </div>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],workItem:[{type:y.Input}]},e}(),te=function bo(){this.workId=l.Guid.EMPTY,this.name=null};function ne(){return new te}var oe=function So(){this.workId=l.Guid.EMPTY,this.name=null,this.id="",this.fullUrl=null,this.features=null};function re(){return new oe}var ie={Popup:0,Inline:1};ie[ie.Popup]="Popup",ie[ie.Inline]="Inline";var ae=function(){function e(e,t){this.e5ConfigurationService=e,this.changeDetectorRef=t,this.viewerDisplayedEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){},e.prototype.showInlineViewer=function(e){this.constructViewerUrl(e,null),this.raiseEvent(e)},e.prototype.showPopViewer=function(e){var n=this;this.constructViewerUrl(e,function(e,t){return n.performWindowPopup(e,t)})},e.prototype.performWindowPopup=function(e,t){window.open(t,"E5AttachmentViewer",this.popupWindowFeatures),this.raiseEvent(e)},e.prototype.constructViewerUrl=function(e,t){},e.prototype.raiseEvent=function(e){},e.propDecorators={behaviourType:[{type:y.Input}],popupWindowFeatures:[{type:y.Input}],readonly:[{type:y.Input}],viewerDisplayedEvent:[{type:y.Output}]},e}(),se=function(){function e(){this.behaviourType=0,this.popupWindowFeatures="top=0,left=0,width=500,height=700,directories=no,location=no,menubar=no,status=no,resizable=yes,titlebar=yes,toolbar=no",this.readonly=!0,this.viewerDisplayedEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){},e.prototype.showViewer=function(t){if(this.attachmentViewerComponents!=undefined)switch(+this.behaviourType){case ie.Inline:this.attachmentViewerComponents.forEach(function(e){e.showInlineViewer(t)});break;case ie.Popup:this.attachmentViewerComponents.forEach(function(e){e.showPopViewer(t)})}},e.prototype.onViewerDisplayed=function(e){this.viewerDisplayedEvent.emit(e)},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-attachment-viewer",template:'\n <span [ngSwitch]="viewerType">\n <e5core-ui-e5-attachment-viewer *ngSwitchCase=\'0\' [behaviourType]="behaviourType" [popupWindowFeatures]="popupWindowFeatures" [readonly]="readonly" (viewerDisplayedEvent)="onViewerDisplayed($event)"></e5core-ui-e5-attachment-viewer>\n <e5core-ui-weburi-attachment-viewer *ngSwitchCase=\'1\' [behaviourType]="behaviourType" [popupWindowFeatures]="popupWindowFeatures" [readonly]="readonly" (viewerDisplayedEvent)="onViewerDisplayed($event)"></e5core-ui-weburi-attachment-viewer>\n <e5core-ui-webdav-weburi-attachment-viewer *ngSwitchCase=\'2\' [behaviourType]="behaviourType" [popupWindowFeatures]="popupWindowFeatures" [readonly]="readonly" (viewerDisplayedEvent)="onViewerDisplayed($event)"></e5core-ui-webdav-weburi-attachment-viewer>\n </span>',changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[]},e.propDecorators={viewerType:[{type:y.Input}],behaviourType:[{type:y.Input}],popupWindowFeatures:[{type:y.Input}],readonly:[{type:y.Input}],viewerDisplayedEvent:[{type:y.Output}],attachmentViewerComponents:[{type:y.ViewChildren,args:[ae]}]},e}(),le=function(){function e(e,t){this.e5ConfigurationService=e,this.configurationScopeService=t,this.viewerDisplayedEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){},e.prototype.showInlineViewer=function(e){this.constructViewerUrl(e,null),this.raiseEvent(e)},e.prototype.showPopViewer=function(e){this.constructViewerUrl(e,this.performWindowPopup)},e.prototype.performWindowPopup=function(e){window.open(e.fullUrl,"E5ConversationViewer",e.features),this.raiseEvent(e)},e.prototype.constructViewerUrl=function(r,i){var a=this.e5ConfigurationService.settings.apiServer.baseUrl;r.features=this.popupWindowFeatures,this.configurationScopeService.get(this.e5ConfigurationService.settings.apiServer.scope).subscribe(function(e){var t=e.siteId,n=e.instanceId,o=a+"/Web/app/conversation/conversation.view.standalone.html?workid="+r.workId+"&source=GetNext&instance="+n+"&department="+t;r.fullUrl=o,i&&i(r)},function(e){console.error(e)})},e.prototype.raiseEvent=function(e){this.viewerDisplayedEvent.emit({workId:e.workId,type:"EmailConversation",attachmentId:null,fullUrl:null,name:null})},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-email-conversation-viewer",template:'\n <span *ngIf="1==+behaviourType">\n <iframe *ngIf="!(conversationViewerUrl == \'\')" [src]="conversationViewerUrl | safe"></iframe>\n </span>',changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:d.E5ConfigurationService},{type:d.ConfigurationScopeService}]},e.propDecorators={behaviourType:[{type:y.Input}],popupWindowFeatures:[{type:y.Input}],readonly:[{type:y.Input}],viewerDisplayedEvent:[{type:y.Output}]},e}(),ce=function(){function e(e){this.style=e,this.popupWindowFeatures="top=0,left=0,width=500,height=700,directories=no,location=no,menubar=no,status=no,resizable=yes,titlebar=yes,toolbar=no",this.readonly=!1,this.viewerDisplayedEvent=new y.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){},e.prototype.showViewer=function(e){if(this.emailConversationViewerComponent!=undefined)switch(+this.behaviourType){case ie.Inline:this.emailConversationViewerComponent.showInlineViewer(e);break;case ie.Popup:this.emailConversationViewerComponent.showPopViewer(e)}},e.prototype.onViewerDisplayed=function(e){this.viewerDisplayedEvent.emit(e)},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-conversation-viewer",template:'\n <span>\n <e5core-ui-email-conversation-viewer [behaviourType]="behaviourType" [popupWindowFeatures]="popupWindowFeatures" [readonly]="readonly" (viewerDisplayedEvent)="onViewerDisplayed($event)"></e5core-ui-email-conversation-viewer>\n </span>',changeDetection:y.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:E}]},e.propDecorators={behaviourType:[{type:y.Input}],popupWindowFeatures:[{type:y.Input}],readonly:[{type:y.Input}],viewerDisplayedEvent:[{type:y.Output}],emailConversationViewerComponent:[{type:y.ViewChild,args:[le]}]},e}(),ue=function(){function e(){this.workRelatedItemFields=[{key:"Category1Name",value:"Product"},{key:"Category2Name",value:"Business Unit"},{key:"Category3Name",value:"Category"},{key:"StatusName",value:"Status"},{key:"Reference",value:""},{key:"AssignedUser",value:""}],this.selectFromListFields=[{fieldId:"FullUrl",fieldCode:"fullUrl",name:"Full Url",display:!1},{fieldId:"FileLeafRef",fieldCode:"fileLeafRef",name:"Document Name",display:!0},{fieldId:"_dlc_DocId",fieldCode:"_dlc_DocId",name:"Policy No",display:!0},{fieldId:"_UIVersionString",fieldCode:"_UIVersionString",name:"Version No",display:!0},{fieldId:"Synonym",fieldCode:"synonym",name:"Synonyms",display:!0}]}return e.prototype.ngOnInit=function(){var t=this,e=ne();this.fileUpload$=new f.BehaviorSubject(e),this.fileUpload$.subscribe(function(e){},function(e){console.error(e)}),"undefined"!=typeof this.workItem$?"undefined"!=typeof this.workItem$&&this.workItem$.subscribe(function(e){null!=e.workId&&e.workId!=l.Guid.EMPTY&&(t.workId=e.workId)}):console.error("e5core-ui-work-related-items [workItem$] must have a BehaviorSubject<WorkItemModel>")},e.prototype.onConversationView=function(e){var t=re();t.workId=this.workId,this.conversationViewerComponent.forEach(function(e){e.showViewer(t)})},e.prototype.onAttachmentSelect=function(e){var t=re();t.id=e.attachmentId,t.workId=e.workId,this.attachmentViewerComponents.forEach(function(e){"0"==e.viewerType&&e.showViewer(t)})},e.prototype.onGenerateDocument=function(e){var t=re();t.fullUrl=e.fullUrl,t.workId=e.workId,this.attachmentViewerComponents.forEach(function(e){"2"==e.viewerType&&e.showViewer(t)})},e.prototype.onListItemViewEvent=function(e){var t=re();t.name=e.name,t.fullUrl=e.fullUrl,this.attachmentViewerComponents.forEach(function(e){"1"==e.viewerType&&e.showViewer(t)})},e.prototype.onListItemSelectEvent=function(e){alert("You have selected: "+e.element.fileLeafRef)},e.prototype.onWorkItemSelect=function(e){alert("You are opening : "+e.workId)},e.prototype.onDiarisePeriodOptionClick=function(e){},e.prototype.onDiariseButtonClick=function(e){},e.prototype.onDateChange=function(e){},e.prototype.onDiariseReasonTextChange=function(e){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-item-material",template:'<mat-card class="example-card">\n <mat-card-header>\n <div mat-card-avatar><e5core-ui-work-menu [workItem$]="workItem$"></e5core-ui-work-menu> </div>\n <mat-card-title>e5 Work Item</mat-card-title>\n <mat-card-subtitle>{{workItem.workId}}</mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <e5core-ui-work-attachment-viewer behaviourType="0" viewerType="0" ></e5core-ui-work-attachment-viewer>\n\n <e5core-ui-work-tab-set [workItem$]="workItem$"></e5core-ui-work-tab-set>\n \x3c!-- <e5core-ui-work-history></e5core-ui-work-history>\n <e5core-ui-work-attachments></e5core-ui-work-attachments>\n <e5core-ui-work-casenotes></e5core-ui-work-casenotes> --\x3e\n\n <mat-tab-group>\n <mat-tab label="History" >\n <e5core-ui-work-history [workItem$]="workItem$"></e5core-ui-work-history>\n </mat-tab>\n <mat-tab label="Attachments">\n <e5core-ui-file-upload [workItem$]="workItem$"\n [fileUpload$]="fileUpload$">\n </e5core-ui-file-upload>\n <e5core-ui-work-attachments [workItem$]="workItem$" (attachmentSelectEvent)="onAttachmentSelect($event)"></e5core-ui-work-attachments>\n </mat-tab>\n <mat-tab label="Case Notes">\n <e5core-ui-work-casenotes [workItem$]="workItem$"></e5core-ui-work-casenotes>\n </mat-tab>\n <mat-tab label="Documents">\n <e5core-ui-work-attachment-viewer behaviourType="0" viewerType="1"></e5core-ui-work-attachment-viewer>\n <e5core-ui-select-from-list [workItem$]=\'workItem$\' [libraryId]="5" [fieldsToShow]="selectFromListFields" (listItemViewEvent)="onListItemViewEvent($event)" (listItemSelectEvent)="onListItemSelectEvent($event)"></e5core-ui-select-from-list>\n </mat-tab>\n <mat-tab label="Related">\n <e5core-ui-work-related-items [workItem$]=\'workItem$\' [createButtonText]="\'Refer\'" [showDefinedChildrenOnly]="false" [findId]="1" [fieldsToShow]="workRelatedItemFields" (workItemSelectEvent)="onWorkItemSelect($event)" (attachmentSelectEvent)="onAttachmentSelect($event)" ></e5core-ui-work-related-items>\n </mat-tab>\n <mat-tab label="Diarise">\n <e5core-ui-work-diarise \n [workItem$]="workItem$"\n [periodOptions]=\'[\n { label:"Tomorrow", diariseUnit:"Days", value:"1" },\n { label:"2 Days", diariseUnit:"Days", value:"2" },\n { label:"Next Week", diariseUnit:"Weeks", value:"1" }]\' \n [displayedDate] =\'displayedDate\' \n [displayedTime] = \'displayedTime\' \n [diariseReasonPropertyId] =\'"AssessmentExplanationcode"\' \n [diariseReasonPlaceHolder] =\'"Enter the diarise reason here"\' \n [diariseReasonTextValue]=\'diariseReasonTextValue\' \n [showDiariseButton]=true \n [showDiariseTime]=true \n [showDiariseReasonDropdown] = false\n (periodChange)=\'onDiarisePeriodOptionClick($event)\' \n (diariseClick)=\'onDiariseButtonClick($event)\' \n (dateChange)=\'onDateChange($event)\' \n (reasonTextChange)=\'onDiariseReasonTextChange($event)\'></e5core-ui-work-diarise> \n </mat-tab>\n <mat-tab label="Others">\n <p>\n <button mat-raised-button (click)="onConversationView($event)">Conversation Viewer</button>\n </p>\n <e5core-ui-conversation-viewer behaviourType="0" ></e5core-ui-conversation-viewer>\n <e5core-ui-work-attachment-viewer behaviourType="0" viewerType="2"></e5core-ui-work-attachment-viewer>\n <e5core-ui-generate-document [workItem$]=\'workItem$\' [fileUpload$]="fileUpload$" [showGenerateButton]="true" (generateDocumentEvent)="onGenerateDocument($event)"></e5core-ui-generate-document>\n </mat-tab>\n </mat-tab-group>\n\n </mat-card-content>\n</mat-card>',styles:[".example-header-image{background-image:url(https://material.angular.io/assets/img/examples/shiba1.jpg);background-size:cover}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],workItem:[{type:y.Input}],attachmentViewerComponents:[{type:y.ViewChildren,args:[se]}],conversationViewerComponent:[{type:y.ViewChildren,args:[ce]}]},e}(),pe=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-set-material",template:"<mat-tab-group *ngIf='workItem$'>\n <div *ngIf='tabs && tabs.length > 0'>\n <div *ngFor='let tab of tabs'>\n \x3c!-- <e5core-ui-work-tab [workItem$]='workItem$' [tabId]='tab.tabId'></e5core-ui-work-tab> --\x3e\n <mat-tab label=\"{{tab.name}}\">\n <ng-template mat-tab-label>\n \x3c!-- <span *ngIf='tab.errorCount > 0' matBadge=\"{{tab.errorCount}}\" matBadgeOverlap=\"false\" matBadgeColor=\"warn\">{{tab.name}}</span> --\x3e\n <span>{{tab.name}}</span>\n </ng-template>\n <e5core-ui-work-tab [workItem$]='workItem$' [tabId]='tab.tabId'></e5core-ui-work-tab>\n </mat-tab>\n </div>\n </div>\n</mat-tab-group>\n",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],tabs:[{type:y.Input}]},e}(),de=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-set-box",template:"<div class='e5-component' *ngIf='workItem$'>\n <div class='e5-title'>e5core-ui-work-tab-set {{(workItem$ | async).workId}}</div>\n <div class='e5-content'>\n\n <div *ngIf='tabs && tabs.length > 0'>\n <div *ngFor='let tab of tabs'>\n <e5core-ui-work-tab [workItem$]='workItem$' [tabId]='tab.tabId'></e5core-ui-work-tab>\n </div>\n </div>\n </div>\n</div>\n",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],tabs:[{type:y.Input}]},e}(),he=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-set-bootstrap",template:"<div class='e5-component' *ngIf='workItem$'>\n\n <ul class=\"nav nav-tabs\">\n <li *ngFor='let tab of tabs'><a href=\"#\">{{tab.name}}</a></li>\n </ul>\n\n <div *ngIf='tabs && tabs.length > 0' >\n <e5core-ui-work-tab *ngFor='let tab of tabs' [workItem$]='workItem$' [tabId]='tab.tabId'></e5core-ui-work-tab>\n </div>\n\n</div>",styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={workItem$:[{type:y.Input}],tabs:[{type:y.Input}]},e}(),me=function(){function e(){}return e.prototype.ngOnInit=function(){},e.propDecorators={workItem$:[{type:y.Input}],tab:[{type:y.Input}],fieldSetIds:[{type:y.Input}]},e}(),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-bootstrap",template:"<div class='panel panel-default e5-component' *ngIf='workItem$'>\n <div class='panel-body' *ngIf='fieldSetIds && fieldSetIds.length > 0'>\n <e5core-ui-work-field-set *ngFor='let fieldSetId of fieldSetIds' [workItem$]='workItem$' [fieldSetId]='fieldSetId'></e5core-ui-work-field-set>\n </div>\n</div>\n",styles:[""]}]}],t}(me),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-box",template:"<div class='e5-component'>\n <div class='e5-title'>e5core-ui-work-tab {{(workItem$ | async).workId}} / {{tab.tabId}}</div>\n <div class='e5-content'>\n <code>{{tab | json}}</code>\n \x3c!-- <e5core-ui-work-field-set></e5core-ui-work-field-set> --\x3e\n <div *ngIf='fieldSetIds && fieldSetIds.length > 0'>\n <div *ngFor='let fieldSetId of fieldSetIds'>\n <e5core-ui-work-field-set [workItem$]='workItem$' [fieldSetId]='fieldSetId'></e5core-ui-work-field-set>\n </div>\n </div>\n </div>\n</div>",styles:[""]}]}],t}(me),ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-tab-material",template:"<mat-card class='e5-work-tab' *ngIf='fieldSetIds && fieldSetIds.length > 0'>\n <div *ngFor='let fieldSetId of fieldSetIds'>\n <e5core-ui-work-field-set [workItem$]='workItem$' [fieldSetId]='fieldSetId'></e5core-ui-work-field-set>\n </div>\n</mat-card>\n",styles:[""]}]}],t}(me),we=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"e5core-ui-work-field-set-box",template:"<div class='e5-component' *ngIf='workItem$'>\n <div class='e5-title'>e5core-ui-work-field-set {{(workItem$ | async).workId}} / {{fieldSet.fieldSetId}}</div>\n <div class='e5-content'>\n {{fields | json}}\n <div *ngIf='fields && fields.length > 0'>\n <div *ngFor='let field of fields'>\n <e5core-ui-work-field [workItem$]='workItem$' [fieldSetId]='fieldSet.fieldSetId' [propertyId]='field.propertyId' [readonly]='readonly'></e5core-ui-work-field>\n </div>\n </div>\n\n </div>\n</div>",styles:[""]}]}],e.ctorParameters=function(