@hpe/angular-toolkit
Version:
Hewlett-Packard Enterprise : Angular toolkit for rapid project development
2 lines • 38.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@hpe/angular-toolkit/model"),require("@hpe/angular-toolkit/service"),require("@angular/animations"),require("@hpe/angular-toolkit/lib"),require("primeng/components/common/messageservice"),require("@angular/common"),require("@angular/material"),require("primeng/primeng"),require("primeng/contextmenu"),require("primeng/dropdown"),require("primeng/multiselect"),require("primeng/table"),require("primeng/toast"),require("@hpe/angular-toolkit/gui/directive")):"function"==typeof define&&define.amd?define("@hpe/angular-toolkit/gui/panel",["exports","@angular/core","@hpe/angular-toolkit/model","@hpe/angular-toolkit/service","@angular/animations","@hpe/angular-toolkit/lib","primeng/components/common/messageservice","@angular/common","@angular/material","primeng/primeng","primeng/contextmenu","primeng/dropdown","primeng/multiselect","primeng/table","primeng/toast","@hpe/angular-toolkit/gui/directive"],e):e((t.hpe=t.hpe||{},t.hpe["angular-toolkit"]=t.hpe["angular-toolkit"]||{},t.hpe["angular-toolkit"].gui=t.hpe["angular-toolkit"].gui||{},t.hpe["angular-toolkit"].gui.panel={}),t.ng.core,t.hpe["angular-toolkit"].model,t.hpe["angular-toolkit"].service,t.ng.animations,t.hpe["angular-toolkit"].lib,null,t.ng.common,t.ng.material,null,null,null,null,null,null,t.hpe["angular-toolkit"].gui.directive)}(this,function(t,i,a,e,n,s,o,l,r,c,p,u,d,h,g,f){"use strict";var m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function b(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var y=function(o){function t(t,e){var n=o.call(this,t)||this;return n.changeDetectorRef=e,n.submitting=!1,o.prototype.subscribeToApp.call(n,a.AppEvent.SUBMIT_START,function(){return n.onSubmitStart()}),o.prototype.subscribeToApp.call(n,a.AppEvent.SUBMIT_END,function(){return n.onSubmitEnd()}),n}return b(t,o),t.prototype.getComponentClass=function(){var t=["row"];return this.submitting&&t.push("disabled"),t},t.prototype.onSubmitStart=function(){this.submitting=!0,this.changeDetectorRef.detectChanges()},t.prototype.onSubmitEnd=function(){this.submitting=!1,this.changeDetectorRef.detectChanges()},t.decorators=[{type:i.Component,args:[{selector:"hpe-button-panel",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<div [ngClass]="getComponentClass()">\n <ng-content></ng-content>\n </div>\n',styles:[".row{display:flex;padding:1rem;border-top:1px solid #e1e1e1;justify-content:center;background-color:#f6f6f6}.disabled{pointer-events:none;background-color:#c6c9ca}"]}]}],t.ctorParameters=function(){return[{type:e.EventBusService},{type:i.ChangeDetectorRef}]},t}(e.AbstractSubscriber),v=function(){function t(t){this.labelService=t,this.toggleButton=!0,this.overflowUnset=!0,this.state="open"}return Object.defineProperty(t.prototype,"cardOpen",{get:function(){return"open"==this.state},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tooltip",{get:function(){return this.labelService.getLabel("card-panel","toggle.tooltip")},enumerable:!0,configurable:!0}),t.prototype.onToggleClick=function(){this.state="open"==this.state?"closed":"open"},t.prototype.animationStart=function(t){this.overflowUnset=!1},t.prototype.animationEnd=function(t){this.overflowUnset=this.cardOpen},t.decorators=[{type:i.Component,args:[{selector:"hpe-card-panel",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<mat-card>\n\t<hpe-title-panel icon="{{icon}}" title="{{title}}" >\n\t\t<ng-content select="[cpPostTitle]" tpPostTitle></ng-content>\n\n\t\t<ng-content select="[cpControl]" tpControl></ng-content>\n\n\t\t<button mat-button *ngIf="toggleButton" (click)="onToggleClick()" [title]="tooltip" tpControl class="buttonStyle">\n\t\t\t<hpe-title-icon name="fa-angle-up" *ngIf="cardOpen"></hpe-title-icon>\n\t\t\t<hpe-title-icon name="fa-angle-down" *ngIf="!cardOpen"></hpe-title-icon>\n\t\t</button>\n\n\t</hpe-title-panel>\n\n\t<div [@focusPanel] = "state"\n\t\t (@focusPanel.start)= "animationStart($event)"\n\t\t (@focusPanel.done) = "animationEnd($event)"\n\t\t [style.overflow] = "overflowUnset ? \'unset\' : \'hidden\'">\n\n\t\t<ng-content select="[cpBody]"></ng-content>\n\t</div>\n\n</mat-card>\n',styles:["mat-card{margin:1rem;padding:0}.buttonStyle{min-width:0;padding:0 8px}"],animations:[n.trigger("focusPanel",[n.state("open",n.style({height:"*"})),n.state("closed",n.style({height:0})),n.transition("open => closed",n.animate("500ms ease-in")),n.transition("closed => open",n.animate("500ms ease-out"))])]}]}],t.ctorParameters=function(){return[{type:e.LabelService}]},t.propDecorators={icon:[{type:i.Input}],title:[{type:i.Input}],toggleButton:[{type:i.Input}]},t}(),C=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-global-css",template:"\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n",styles:[".ui-contextmenu{width:auto}.ui-contextmenu .ui-menuitem-link:hover{background-color:#00a982}.ui-contextmenu .ui-menuitem-link{text-decoration:none}.ui-toast-message-error{color:#ab1a0f;background-color:#ffcbc8}.ui-toast-message-warn{color:#8a6714;background-color:#ffe9b5}.ui-toast-message-success{color:#2c832f;background-color:#b4f0b6}.ui-toast-message-info{color:#1765a3;background-color:#bfe0fa}"],encapsulation:i.ViewEncapsulation.None}]}],t}(),S=function(){function t(){}return Object.defineProperty(t.prototype,"content",{get:function(){return this.isFontAwesomeIcon()?null:this.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){var t=["iconStyle"];return this.isFontAwesomeIcon()?(t.push("fa"),t.push(this.name)):t.push("material-icons"),t},enumerable:!0,configurable:!0}),t.prototype.isFontAwesomeIcon=function(){return null!=this.name&&this.name.startsWith("fa-")},t.decorators=[{type:i.Component,args:[{selector:"hpe-icon",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<i [ngClass]="iconClass">{{content}}</i>\n',styles:[".iconStyle{vertical-align:middle}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={name:[{type:i.Input}]},t}(),w=function(){function t(t){this.labelService=t,this.onRowSelected=new i.EventEmitter,this.onRowUnselected=new i.EventEmitter}return t.prototype.refresh=function(){var e=this;this.loading=!1,this.failed=!1,this.overflow=!1,(this.filteredSize=null)!=this.service&&(this.loading=!0,this.service().subscribe(function(t){e.loading=!1,e.data=t.results,e.filteredSize=t.results.length,e.overflow=t.overflow},function(t){console.log("Service raised an error : "+JSON.stringify(t)),e.data=[],e.loading=!1,e.failed=!0}))},Object.defineProperty(t.prototype,"color",{get:function(){return this.overflow?"orange":"slate"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exportSelTooltip",{get:function(){return this.loc("exportSel.tooltip")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exportAllTooltip",{get:function(){return this.loc("exportAll.tooltip")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"refreshTooltip",{get:function(){return this.loc("refresh.tooltip")},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.refresh()},t.prototype.onFilterChange=function(t){this.filteredSize=t.filteredSize},t.prototype.onRowSelect=function(t){this.onRowSelected.emit(t.row)},t.prototype.onRowUnselect=function(t){this.onRowUnselected.emit(t.row)},t.prototype.loc=function(t){return this.labelService.getLabel("list-panel",t)},t.decorators=[{type:i.Component,args:[{selector:"hpe-list-panel",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<hpe-card-panel icon="{{icon}}" title="{{title}}">\n\t<hpe-rounded-text [text]="filteredSize" [color]="color" cpPostTitle></hpe-rounded-text>\n\n\t<ng-content select="lpButtons"></ng-content>\n\n\t<hpe-title-button cpControl\n\t icon = "fa-file-o"\n\t [tooltip] = "exportSelTooltip"\n\t [disabled] = "loading || failed"\n\t (click) = "lt.exportSelected()"\n\t\t\t\t\t></hpe-title-button>\n\n\t<hpe-title-button cpControl\n\t\t\t\t\ticon = "fa-files-o"\n\t\t\t\t\t[tooltip] = "exportAllTooltip"\n\t\t\t\t\t[disabled] = "loading || failed"\n\t\t\t\t\t(click) = "lt.exportAll()"\n\t\t\t\t\t></hpe-title-button>\n\n\t<hpe-title-button cpControl\n\t\t\t\t\ticon = "fa-refresh"\n\t\t\t\t\t[tooltip] = "refreshTooltip"\n\t\t\t\t\t[disabled] = "loading"\n\t\t\t\t\t(click) = "refresh()"\n\t\t\t\t\t></hpe-title-button>\n\n\t\x3c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\x3e\n\n\t<div cpBody class="innerPanel">\n\t\t<hpe-list-table #lt\n\t\t\t\t\t[rowId] = "rowId"\n\t\t\t\t\t[columns] = "columns"\n\t\t\t\t\t[visibleColumns] = "visibleColumns"\n\t\t\t\t\t[data] = "data"\n\t\t\t\t\t[contextMenu] = "contextMenu"\n\t\t\t\t\t[multiSelection] = "multiSelection"\n\t\t\t\t\t[menuSelector] = "menuSelector"\n\t\t\t\t\t[loading] = "loading"\n\t\t\t\t\t[labelGroup] = "labelGroup"\n\t\t\t\t\t(onFilterChange) = "onFilterChange($event)"\n\t\t\t\t\t(onRowSelected) = "onRowSelect($event)"\n\t\t (onRowUnselected)= "onRowUnselect($event)"\n\t\t\t\t\t></hpe-list-table>\n\n\t\t<ng-content select="lpControls"></ng-content>\n\t</div>\n\n</hpe-card-panel>\n',styles:[".innerPanel{padding:8px}"]}]}],t.ctorParameters=function(){return[{type:e.LabelService}]},t.propDecorators={icon:[{type:i.Input}],title:[{type:i.Input}],rowId:[{type:i.Input}],columns:[{type:i.Input}],visibleColumns:[{type:i.Input}],multiSelection:[{type:i.Input}],contextMenu:[{type:i.Input}],menuSelector:[{type:i.Input}],service:[{type:i.Input}],labelGroup:[{type:i.Input}],onRowSelected:[{type:i.Output}],onRowUnselected:[{type:i.Output}]},t}(),x=function(o){function t(t,e){var n=o.call(this,t)||this;return n.labelService=e,n.onFilterChange=new i.EventEmitter,n.onRowSelected=new i.EventEmitter,n.onRowUnselected=new i.EventEmitter,n.alignMap={left:"alignLeft",center:"alignCenter",right:"alignRight"},n.rowsPerPage=8,n.rowSet=[4,8,12,16,20,50],n.loading=!1,n.multiSelection=!1,n}return b(t,o),t.prototype.exportAll=function(){this.pTable.exportCSV()},t.prototype.exportSelected=function(){this.pTable.exportCSV({selectionOnly:!0})},Object.defineProperty(t.prototype,"allValue",{get:function(){return this.labelService.getLabel("list-table","all")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"noRecords",{get:function(){return this.labelService.getLabel("list-table","noRecords")},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=!1;t.columns&&(this.initColumns(),e=!0),t.data&&(this.initData(),e=!0),t.visibleColumns&&this.initVisibleColumns(),e&&this.initColumnValues()},t.prototype.onRowSelect=function(t){var e=this.restoreRow(t.data),n=this.calcSelectedRows(this.selectedRow);this.onRowSelected.emit(new a.RowSelectedEvent(e,n))},t.prototype.onRowUnselect=function(t){var e=this.restoreRow(t.data),n=this.calcSelectedRows(this.selectedRow);this.onRowUnselected.emit(new a.RowUnselectedEvent(e,n))},t.prototype.onContextMenuSelect=function(t){var e=this.restoreRow(t.data),n=this.calcSelectedRows(this.selectedRow),o=new a.RowSelectedEvent(e,n);this.onRowSelected.emit(o),this.activeMenu=this.selectMenuItems(this.contextMenu,o,null)},t.prototype.onFilter=function(t){this.onFilterChange.emit(new a.FilterChangeEvent(this.getFilteredSize()))},t.prototype.filter=function(t,e){this.pTable.filter(t,e.field,e.filterMatchMode)},t.prototype.initColumns=function(){var e=this;if(console.log("Initializing columns : "+JSON.stringify(this.columns)),this.colToIndex=new Map,null==this.columns);else{var n=0;this.columns.forEach(function(t){e.colToIndex.set(t.field,n++),t.displayHeader=e.calcHeader(t),t.filterMatchMode=e.calcFilterMatchMode(t)})}},t.prototype.calcHeader=function(t){return t.header||this.labelGroup&&this.labelService.getLabel(this.labelGroup,t.field)||t.field},t.prototype.calcFilterMatchMode=function(t){return null==t.filter?"contains":"select"==t.filter?"equals":"list"==t.filter?"in":null},t.prototype.initData=function(){var a=this;console.log("Initializing data : "+JSON.stringify(this.data)),null==this.columns||null==this.data?this.displayData=null:(this.displayData=[],this.data.forEach(function(t){var e={};for(var n in a.displayData.push(e),t){var o=new I;e[n]=o;var i=t[n],l=a.colToIndex.get(n),r=a.columns[l];o.originalValue=i,o.displayValue=a.calcDisplayValue(t,r,i),o.style=a.calcDisplayStyle(t,r,i)}}))},t.prototype.calcDisplayValue=function(t,e,n){return null!=e.transcoder&&(n=e.transcoder.transcode(n)),null!=n?n.toString():null},t.prototype.calcDisplayStyle=function(t,e,n){var o=["cell"];if(null!=e.alignment&&o.push(this.alignMap[e.alignment]),null!=e.styler){var i=e.styler.style(n,t);null!=i.icon&&(o.push("fa"),o.push(i.icon)),null!=i.extraClass&&o.push(i.extraClass)}return o},t.prototype.initVisibleColumns=function(){var n=this;console.log("Initializing visible columns : "+JSON.stringify(this.visibleColumns)),null==this.columns||null==this.visibleColumns?this.displayColumns=null:(this.displayColumns=[],this.visibleColumns.forEach(function(t){var e=n.colToIndex.get(t);null!=e&&n.displayColumns.push(n.columns[e])}))},t.prototype.initColumnValues=function(){var e=this;if(this.columnValues=new Map,null==this.columns||null==this.data)return null;console.log("Calculating column values for : "),this.columns.forEach(function(t){console.log(" --\x3e "+t.field),e.columnValues.set(t.field,e.getColumnValues(t))})},t.prototype.getColumnValues=function(n){var o=n.field,i=new Set;this.data.forEach(function(t){var e=t[o];null!=e&&i.add(e)});var l=[];return"select"==n.filter&&l.push({label:this.allValue,value:null}),i.forEach(function(t){null!=n.transcoder&&(t=n.transcoder.transcode(t));var e=null!=t?t.toString():null;l.push({label:e,value:e})}),l},t.prototype.getFilteredSize=function(){return this.pTable&&this.pTable.filteredValue?this.pTable.filteredValue.length:this.data?this.data.length:null},t.prototype.restoreRow=function(t){var e={};for(var n in t)e[n]=t[n].originalValue;return e},t.prototype.calcSelectedRows=function(t){var e=this,n=[];return null!=t&&t.forEach(function(t){n.push(e.restoreRow(t))}),n},t.prototype.selectMenuItems=function(t,o,i){var l=this,r=[];return t.forEach(function(t){var e=s.Lib.menu.clone(t);if(null!=i&&(e.id=i+"."+e.id),e.command=function(t){l.fireEvent(e.id,o)},null==l.menuSelector)r.push(e);else{var n=l.menuSelector.select(e.id,o);e.disabled=n==a.MenuSelectionMode.DISABLE,n==a.MenuSelectionMode.EXCLUDE||r.push(e)}null!=t.items&&(e.items=l.selectMenuItems(t.items,o,e.id),null!=t.items&&null==e.items&&(e.disabled=!0))}),0!=r.length?r:null},t.prototype.fireEvent=function(t,e){this.pContextMenu.hide();var n={code:t,params:e};o.prototype.emitToApp.call(this,n)},t.decorators=[{type:i.Component,args:[{selector:"hpe-list-table",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<p-table #tt\n\t\t[columns] = "displayColumns"\n\t\t[value] = "displayData"\n\t\t[dataKey] = "rowId"\n\t\t[selectionMode] = "multiSelection ? \'multiple\' : \'single\'"\n\t\t[paginator] = "true"\n\t\t[rows] = "rowsPerPage"\n\t\t[rowsPerPageOptions] = "rowSet"\n\t\t[pageLinks] = "10"\n\t\t[loading] = "loading"\n\t\t[metaKeySelection] = "true"\n\t\t[contextMenu] = "cm"\n\t\t[(selection)] = "selectedRow"\n\t\t(onRowSelect) = "onRowSelect($event)"\n\t\t(onRowUnselect) = "onRowUnselect($event)"\n\t\tcontextMenuSelectionMode = "joint"\n\t\t(onContextMenuSelect) = "onContextMenuSelect($event)"\n\t\t(onFilter) = "onFilter($event)">\n\n\t<ng-template pTemplate="header" let-columns>\n\t\t<tr>\n\t\t\t<th *ngFor="let col of columns" [pSortableColumn]="col.field">\n\t\t\t\t{{col.displayHeader}}\n\t\t\t\t<p-sortIcon [field]="col.field"></p-sortIcon>\n\t\t\t</th>\n\t\t</tr>\n\n\t\t<tr class="ui-fluid">\n\t\t\t<th *ngFor="let col of columns">\n\n\t\t\t\t<input *ngIf="col.filter == null"\n\t\t\t\t\t\t\t\tpInputText\n\t\t\t\t\t\t\t\ttype = "text"\n\t\t\t\t\t\t\t\t(input) = "filter($event.target.value, col)"\n\t\t\t\t\t\t\t\tclass = "filter">\n\n\t\t\t\t<p-dropdown *ngIf = "col.filter == \'select\'"\n\t\t\t\t\t\t\t\t[options] = "columnValues.get(col.field)"\n\t\t\t\t\t\t\t\t[style] = "{\'width\':\'100%\'}"\n\t\t\t\t\t\t\t\t(onChange) = "filter($event.value, col)"\n\t\t\t\t\t\t\t\t></p-dropdown>\n\n\t\t\t\t<p-multiSelect *ngIf = "col.filter == \'list\'"\n\t\t\t\t\t\t\t\t[options] = "columnValues.get(col.field)"\n\t\t\t\t\t\t\t\t[defaultLabel] = "allValue"\n\t\t\t\t\t\t\t\t(onChange) = "filter($event.value, col)"\n\t\t\t\t\t\t\t\tclass = "filter"></p-multiSelect>\n\n\t\t\t</th>\n\t\t</tr>\n\t</ng-template>\n\n\t<ng-template pTemplate="body" let-row let-columns="columns">\n\t\t<tr [pSelectableRow]="row" [pContextMenuRow]="row">\n\t\t\t<td *ngFor="let col of columns">\n\t\t\t\t<span [ngClass]="row[col.field].style">{{row[col.field]}}</span>\n\t\t\t</td>\n\t\t</tr>\n\t</ng-template>\n\n\t<ng-template pTemplate="emptymessage" let-columns>\n\t\t<tr>\n\t\t\t<td [attr.colspan]="columns.length">\n\t\t\t\t{{noRecords}}\n\t\t\t</td>\n\t\t</tr>\n\t</ng-template>\n</p-table>\n\n<p-contextMenu #cm [model]="activeMenu" appendTo="body"></p-contextMenu>\n',styles:[".cell{width:100%;display:inline-block;padding:.7em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filter{width:100%}.alignLeft{text-align:left}.alignCenter{text-align:center}.alignRight{text-align:right}:host ::ng-deep .ui-paginator{border:none;background-image:inherit}:host ::ng-deep .ui-table .ui-table-thead>tr>th{border:none}:host ::ng-deep .ui-table .ui-table-thead>tr>th:not(.ui-state-highlight){background-color:#fff}:host ::ng-deep .ui-table .ui-table-thead>tr>th:hover{background-color:#c6c9ca}:host ::ng-deep .ui-table .ui-table-tbody>tr.ui-state-highlight{background-color:#a0c0c0}:host ::ng-deep .ui-table .ui-table-thead>tr:last-child{border-bottom:2px solid #c6c9ca}:host ::ng-deep .ui-table .ui-sortable-column.ui-state-highlight{background-color:#5f7a76}:host ::ng-deep .ui-table .ui-table-tbody>tr>td{border-left:none;border-right:none}"]}]}],t.ctorParameters=function(){return[{type:e.EventBusService},{type:e.LabelService}]},t.propDecorators={rowId:[{type:i.Input}],columns:[{type:i.Input}],data:[{type:i.Input}],visibleColumns:[{type:i.Input}],multiSelection:[{type:i.Input}],rowsPerPage:[{type:i.Input}],rowSet:[{type:i.Input}],loading:[{type:i.Input}],labelGroup:[{type:i.Input}],contextMenu:[{type:i.Input}],menuSelector:[{type:i.Input}],onFilterChange:[{type:i.Output}],onRowSelected:[{type:i.Output}],onRowUnselected:[{type:i.Output}],pTable:[{type:i.ViewChild,args:["tt"]}],pContextMenu:[{type:i.ViewChild,args:["cm"]}]},t}(e.AbstractSubscriber),I=function(){function t(){}return t.prototype.toString=function(){return this.displayValue},t}(),E=function(o){function t(t,e){var n=o.call(this,t)||this;return n.changeDetectorRef=e,n.state="loaded",n.classes={loading:"fa-pulse",loaded:"loaded"},o.prototype.subscribeToApp.call(n,a.AppEvent.SUBMIT_START,function(t){return n.onSubmitStart(t)}),o.prototype.subscribeToApp.call(n,a.AppEvent.SUBMIT_END,function(t){return n.onSubmitEnd(t)}),n}return b(t,o),t.prototype.onSubmitStart=function(t){this.state="loading",this.changeDetectorRef.detectChanges()},t.prototype.onSubmitEnd=function(t){this.state="loaded",this.changeDetectorRef.detectChanges()},t.decorators=[{type:i.Component,args:[{selector:"hpe-loading-spinner",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<div class="loadingContainer" >\n\t<i class="fa fa-circle-o-notch fa-2x" [ngClass]="classes[state]"></i>\n</div>\n',styles:[".loadingContainer{height:100%;display:flex;align-items:center}.loaded{display:none}"]}]}],t.ctorParameters=function(){return[{type:e.EventBusService},{type:i.ChangeDetectorRef}]},t}(e.AbstractSubscriber),P=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-logo",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<div class="logoContainer">\n\t<img alt="Hewlett-Packard Enterprise" width="143" height="56" class="logo" src="asset/image/hpe-logo.png">\n</div>\n',styles:[".logoContainer{height:100%;display:flex;align-items:center}.logo{vertical-align:middle;padding-left:8px;padding-right:8px}"]}]}],t}(),M=function(){function t(t){this.eventBusService=t}return t.prototype.onClick=function(){var t=new a.AppEvent(a.AppEvent.MENU_BUTTON_CLICK);this.eventBusService.emitToApp(t)},t.decorators=[{type:i.Component,args:[{selector:"hpe-menu-button",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<hpe-toolbar-button icon="menu" (click)="onClick()"></hpe-toolbar-button>\n',styles:[""]}]}],t.ctorParameters=function(){return[{type:e.EventBusService}]},t}(),k=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-menu-panel",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<p-panelMenu [model]="menu"></p-panelMenu>\n',styles:[":host ::ng-deep .ui-widget-content{border:none}:host ::ng-deep .ui-state-default{border:none}:host ::ng-deep .ui-panelmenu-header.ui-state-active a{background-color:#425563}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={menu:[{type:i.Input}]},t}(),T=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-message-toast",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<p-toast position="top-center"></p-toast>\n',styles:[""]}]}],t.ctorParameters=function(){return[]},t}(),L=function(){function t(t){var e=this;this.messageList=[],this.unreadMessages=!1,this.subscription=t.messageObserver.subscribe(function(t){return e.onMessage(t)})}return t.prototype.ngOnDestroy=function(){null!=this.subscription&&this.subscription.unsubscribe()},t.prototype.onClick=function(t){this.unreadMessages=!1},t.prototype.onMessage=function(t){var e=this;t instanceof Array?t.forEach(function(t){return e.messageList.unshift(t)}):this.messageList.unshift(t),this.unreadMessages=!0},t.decorators=[{type:i.Component,args:[{selector:"hpe-notification-button",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<hpe-toolbar-button icon="fa-bell" [toggle]="true" [highlighted]="unreadMessages" (click)="onClick($event)" [disabled]="messageList.length == 0">\n\t<hpe-notification-item *ngFor="let msg of messageList" [message]="msg"></hpe-notification-item>\n</hpe-toolbar-button>\n',styles:[""]}]}],t.ctorParameters=function(){return[{type:o.MessageService}]},t}(),D=function(){function t(){this.icons={success:"fa-check",info:"fa-info-circle",warn:"fa-exclamation-circle",error:"fa-times-circle"}}return t.decorators=[{type:i.Component,args:[{selector:"hpe-notification-item",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<div class="item" [ngClass]="message.severity">\n\t<i class="fa" [ngClass]="icons[message.severity]"></i> \n\t<b>{{message.summary}}</b>\n\t<p class="message">{{message.detail}}</p>\n</div>\n',styles:[".item{padding:4px 4px 1px;font-size:.9rem;margin:0;line-height:1rem;border-bottom:1px solid #c6c9ca;white-space:normal;max-width:800px}.message{margin-top:4px;margin-bottom:4px}.error{color:#ab1a0f;background-color:#ffcbc8}.warn{color:#8a6714;background-color:#ffe9b5}.success{color:#2c832f;background-color:#b4f0b6}.info{color:#1765a3;background-color:#bfe0fa}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={message:[{type:i.Input}]},t}(),R=function(){function t(t){this.labelService=t,this.onClose=new i.EventEmitter}return Object.defineProperty(t.prototype,"closeTooltip",{get:function(){return this.labelService.getLabel("right-title","close.tooltip")},enumerable:!0,configurable:!0}),t.prototype.close=function(t){this.onClose.emit(t)},t.decorators=[{type:i.Component,args:[{selector:"hpe-right-title",template:'<hpe-title-panel [icon]="icon" [title]="title" >\n\t<hpe-title-button tpControl\n\t icon = "cancel"\n\t [tooltip]= "closeTooltip"\n\t (click) = "close($event)"\n\t></hpe-title-button>\n</hpe-title-panel>\n',styles:[""]}]}],t.ctorParameters=function(){return[{type:e.LabelService}]},t.propDecorators={icon:[{type:i.Input}],title:[{type:i.Input}],onClose:[{type:i.Output}]},t}(),U=function(){function t(){this.text=null,this.color="green"}return Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(t){this._text=t,this.displayedText=null==t?"...":t},enumerable:!0,configurable:!0}),t.prototype.getClassColor=function(){var t=["roundedStyle"];return null!=this.color&&t.push(this.color),t},t.decorators=[{type:i.Component,args:[{selector:"hpe-rounded-text",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<span [ngClass]="getClassColor()" [innerText]="displayedText"></span>\n',styles:[".roundedStyle{padding:6px 10px 3px;font-size:1.1rem;border-radius:25px;border:1px solid}.black{border-color:#202020;color:#202020}.red{border-color:#e74c3c;color:#e74c3c}.green{border-color:#00a982;color:#00a982}.orange{border-color:#ff8d6d;color:#ff8d6d}.slate{border-color:#425563;color:#425563}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={color:[{type:i.Input}],text:[{type:i.Input}]},t}(),O=function(){function t(){this.onClick=new i.EventEmitter}return t.decorators=[{type:i.Component,args:[{selector:"hpe-title-button",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<button mat-button [title]="tooltip" [disabled]="disabled" (click)="onClick.emit($event)" class="buttonStyle">\n\t<hpe-title-icon [name]="icon"></hpe-title-icon>\n</button>\n',styles:[".buttonStyle{min-width:0;padding:0 8px}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={icon:[{type:i.Input}],tooltip:[{type:i.Input}],disabled:[{type:i.Input}],onClick:[{type:i.Output}]},t}(),N=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-title-icon",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<hpe-icon [name]="name" class="iconStyle"></hpe-icon>\n',styles:[".iconStyle{color:#425563;font-size:24px}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={name:[{type:i.Input}]},t}(),H=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-title-panel",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<mat-toolbar class="toolbar">\n\n\t<hpe-title-icon [name]="icon"></hpe-title-icon>\n\t<div class="panelTitle">{{title}}</div>\n\t<ng-content select="[tpPostTitle]"></ng-content>\n\n\t<span class="horizFiller"></span>\n\n\t<ng-content select="[tpControl]"></ng-content>\n\n</mat-toolbar>\n',styles:[".toolbar{background-color:#ebedf0;height:46px;min-height:46px}.panelTitle{font-size:1.4rem;color:#425563;margin-left:16px;margin-right:16px}.horizFiller{flex:1 1 auto}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={icon:[{type:i.Input}],title:[{type:i.Input}]},t}(),A=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-toolbar",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<mat-toolbar class="toolbar">\n\n\t<ng-content select="[tbLeft]"></ng-content>\n\t<span class="horizFiller"></span>\n\t<ng-content select="[tbRight]"></ng-content>\n\n</mat-toolbar>\n',styles:[".toolbar{background-color:#425563;padding-left:0;padding-right:0;color:#fff;align-items:stretch;height:58px}.horizFiller{flex:1 1 auto}"]}]}],t}(),B=function(){function t(){this.onClick=new i.EventEmitter,this.toggle=!1,this.highlighted=!1,this.selected=!1}return t.prototype.onButtonClick=function(t){this.toggle&&(this.selected=!this.selected,this.overlayPanel.toggle(t)),this.onClick.emit(t)},t.decorators=[{type:i.Component,args:[{selector:"hpe-toolbar-button",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<button mat-button \tclass = "button"\n\t\t\t\t\t(click) = "onButtonClick($event)"\n\t\t\t\t\t[ngClass] = "{\'selected\':selected, \'highlighted\':highlighted, \'disabled\':disabled}"\n\t\t\t\t\t[disabled]= "disabled">\n\t<hpe-toolbar-icon [name]="icon"></hpe-toolbar-icon>\n</button>\n\n<p-overlayPanel #op [dismissable]="false" styleClass="content">\n\t<ng-content></ng-content>\n</p-overlayPanel>\n',styles:[".button{min-width:100%;height:100%;color:#fff}.selected{background-color:rgba(0,0,0,.2)}:host .highlighted{color:#ff8d6d}:host .disabled{color:#c6c9ca}:host ::ng-deep .ui-overlaypanel{display:block!important}:host ::ng-deep .ui-overlaypanel-content{max-height:30rem;overflow-y:auto;padding:0}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={icon:[{type:i.Input}],toggle:[{type:i.Input}],highlighted:[{type:i.Input}],disabled:[{type:i.Input}],onClick:[{type:i.Output}],overlayPanel:[{type:i.ViewChild,args:["op"]}]},t}(),V=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-toolbar-icon",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<hpe-icon [name]="name" class="iconStyle"></hpe-icon>\n',styles:[".iconStyle{font-size:24px}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={name:[{type:i.Input}]},t}(),F=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-toolbar-title",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<div class="titleContainer">\n\t<span class="title">{{title}}</span>\n</div>\n',styles:[".titleContainer{height:100%;display:flex;align-items:center}.title{color:#fff;font-size:1.5rem}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={title:[{type:i.Input}]},t}(),z=function(){function t(){}return t.decorators=[{type:i.Component,args:[{selector:"hpe-user-button",template:'\x3c!--\n=============================================================================\n===\n=== (C) Copyright 2018 Hewlett Packard Enterprise Development LP.\n===\n=== Use of this source code is governed by an MIT-style license that can be\n=== found in the LICENSE file\n=============================================================================\n--\x3e\n\n<hpe-toolbar-button icon="account_circle" [toggle]="true">\n\t<ng-content></ng-content>\n</hpe-toolbar-button>\n',styles:[":host ::ng-deep .material-icons{font-size:44px}:host ::ng-deep .mat-button{padding:0}"]}]}],t.ctorParameters=function(){return[]},t}(),_=function(){function t(){}return t.decorators=[{type:i.NgModule,args:[{imports:[l.CommonModule,r.MatCardModule,r.MatToolbarModule,r.MatButtonModule,c.MessageModule,c.MessagesModule,c.OverlayPanelModule,c.PanelMenuModule,p.ContextMenuModule,u.DropdownModule,d.MultiSelectModule,h.TableModule,g.ToastModule,f.HpeDirectiveModule,e.HpeServiceModule],declarations:[y,v,C,S,w,x,E,P,M,k,T,L,D,R,U,O,N,H,A,B,V,F,z],exports:[y,v,C,S,w,x,E,P,M,k,T,L,D,R,U,O,N,H,A,B,V,F,z],providers:[]}]}],t}();t.HpePanelModule=_,t.ButtonPanel=y,t.CardPanel=v,t.GlobalCss=C,t.Icon=S,t.ListPanel=w,t.ListTable=x,t.LoadingSpinner=E,t.Logo=P,t.MenuButton=M,t.MessageToast=T,t.NotificationButton=L,t.NotificationItem=D,t.RightTitle=R,t.RoundedText=U,t.TitleButton=O,t.TitleIcon=N,t.TitlePanel=H,t.Toolbar=A,t.ToolbarButton=B,t.ToolbarIcon=V,t.ToolbarTitle=F,t.UserButton=z,t.ɵa=k,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=hpe-angular-toolkit-gui-panel.umd.min.js.map