UNPKG

angular2-collapsible

Version:

Angular collapsible component styled with Materialize CSS.

16 lines (14 loc) 26.2 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("@angular/animations"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("angular2-collapsible",["exports","@angular/core","@angular/common","rxjs","@angular/animations","@angular/platform-browser"],t):t((e=e||self)["angular2-collapsible"]={},e.ng.core,e.ng.common,e.rxjs,e.ng.animations,e.ng.platformBrowser)}(this,(function(e,t,o,l,i,s){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],l=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&l>=e.length&&(e=void 0),{value:e&&e[l++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var r=function(){function e(){this.headers=new Array,this.bodies=new Array}return e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getCollapsibleTable=function(){return this.collapsibleTable},e.prototype.setCollapsibleTable=function(e){this.collapsibleTable=e},e.prototype.addListHeader=function(e){this.headers.push(e)},e.prototype.addListBody=function(e){this.bodies.push(e)},e.prototype.collapseAll=function(){this.bodies.forEach((function(e){e.expanded=!1,e.expandedState=e.expanded.toString(),e.toggleState.emit(!1)}))},e.decorators=[{type:t.Injectable}],e}();var a=function(){};var p=function(){function e(){this.toggleCollapsibleItemSource=new l.Subject,this.toggleCollapsibleItem$=this.toggleCollapsibleItemSource.asObservable()}return e.prototype.toggleCollapsibleItem=function(e){this.toggleCollapsibleItemSource.next(e)},e.prototype.unsubscribe=function(){this.toggleCollapsibleItemSource.unsubscribe()},e.decorators=[{type:t.Injectable}],e}();var c=function(){function e(){}return e.collapsibleBodyAnimations=function(t){return[i.trigger(t,[i.state("*",i.style({height:0,paddingTop:0,paddingBottom:0,borderBottom:"none",boxShadow:"none",overflow:"hidden"})),i.state("true",i.style({boxShadow:"inset 0 4px 4px -2px rgb(208, 208, 208), inset 0 -3px 2px -1px rgb(208, 208, 208)",overflow:"inherit"})),i.transition("* => true",i.animate(e.collapsibleBodyAnimationDuration+" "+e.easeInQuad)),i.transition("* => false",i.animate(e.collapsibleBodyAnimationDuration+" "+e.easeOutQuad))])]},e.collapsibleBodyAnimationDuration="0.2s",e.easeInQuad="cubic-bezier(0.55, 0.085, 0.68, 0.53)",e.easeOutQuad="cubic-bezier(0.25, 0.46, 0.45, 0.94)",e.collapsibleTableRowAnimationDuration="0.2s",e.decorators=[{type:t.Injectable}],e}();var d=function(){function e(e,o,l){this.el=e,this.collapsibleService=o,this.eventService=l,this.toggleState=new t.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this.eventService.toggleCollapsibleItem$.subscribe((function(){e.toggleCollapsibleItem()}))},e.prototype.hasContent=function(){var e,t;try{for(var o=n(this.el.nativeElement.childNodes),l=o.next();!l.done;l=o.next()){if(null!=l.value.tagName)return!0}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return!1},e.prototype.toggleCollapsibleItem=function(){if(this.hasContent()){if("accordion"===this.collapsibleService.getType()){var e=this.expanded;this.collapsibleService.collapseAll(),this.expanded=e}this.expanded=!this.expanded,this.expandedState=this.expanded.toString(),this.toggleState.emit(this.expanded)}},e.prototype.ngOnChanges=function(e){var t,o;if(this.hasContent())try{for(var l=n(Object.keys(e)),i=l.next();!i.done;i=l.next()){"expanded"===i.value&&null!=e.expanded.currentValue&&(this.expandedState=this.expanded.toString())}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=l.return)&&o.call(l)}finally{if(t)throw t.error}}},e.prototype.ngOnDestroy=function(){this.eventService.unsubscribe()},e.decorators=[{type:t.Component,args:[{selector:"collapsible-body",template:"<ng-content></ng-content>",animations:c.collapsibleBodyAnimations("collapsibleBodyState"),styles:["\n :host {\n display: block;\n border-bottom: 1px solid #ddd;\n box-sizing: border-box;\n padding: 2rem;\n }\n\n .side-nav :host {\n padding: 0;\n }\n\n .side-nav :host,\n .side-nav.fixed :host {\n border: 0;\n background-color: #fff;\n }\n "]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:r},{type:p}]},e.propDecorators={expandedState:[{type:t.HostBinding,args:["@collapsibleBodyState"]}],expanded:[{type:t.Input}],toggleState:[{type:t.Output}]},e}();var h=function(){function e(e){this.collapsibleService=e}return e.prototype.ngAfterContentInit=function(){var e=this;this.contentListBodies.forEach((function(t){e.collapsibleService.addListBody(t)}))},e.decorators=[{type:t.Component,args:[{selector:"collapsible-list-item",template:'\n <ng-content select="collapsible-header"></ng-content>\n <ng-content select="collapsible-body"></ng-content>\n ',providers:[p]}]}],e.ctorParameters=function(){return[{type:r}]},e.propDecorators={contentListBodies:[{type:t.ContentChildren,args:[d]}]},e}();var u=function(){function e(e){this.collapsibleService=e,this.type="accordion"}return e.prototype.ngOnInit=function(){this.collapsibleService.setType(this.type)},e.prototype.ngOnChanges=function(e){for(var t in e)"type"===t&&(this.type=e.type.currentValue,this.collapsibleService.setType(this.type))},e.decorators=[{type:t.Component,args:[{selector:"collapsible-list",template:'<ng-content select="collapsible-list-item"></ng-content>',providers:[r],styles:["\n :host {\n display: block;\n margin: 0.5rem 0 1rem 0;\n border-top: 1px solid #ddd;\n border-right: 1px solid #ddd;\n border-left: 1px solid #ddd;\n box-shadow:\n 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n }\n\n .side-nav :host,\n .side-nav.fixed :host {\n border: none;\n box-shadow: none;\n }\n\n :host(.popout) {\n border: none;\n box-shadow: none;\n }\n\n :host(.popout) > li {\n box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);\n margin: 0 24px;\n transition: margin 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n }\n\n .side-nav :host {\n margin: 0;\n }\n "]}]}],e.ctorParameters=function(){return[{type:r}]},e.propDecorators={type:[{type:t.Input}],contentListItems:[{type:t.ContentChildren,args:[h]}]},e}();var b=function(){function e(e){this.eventService=e}return e.prototype.click=function(){this.eventService.toggleCollapsibleItem()},e.decorators=[{type:t.Component,args:[{selector:"collapsible-header",template:"<ng-content></ng-content>",styles:["\n :host {\n display: block;\n cursor: pointer;\n min-height: 3rem;\n line-height: 3rem;\n padding: 0 1rem;\n background-color: #fff;\n border-bottom: 1px solid #ddd;\n }\n "]}]}],e.ctorParameters=function(){return[{type:p}]},e.propDecorators={click:[{type:t.HostListener,args:["click"]}]},e}();var g=function(){function e(e){this.collapsibleService=e,this.subject=new l.Subject}return e.prototype.ngOnInit=function(){var e=this;this.subject.asObservable().subscribe((function(){e.viewListBodies.forEach((function(e){e.toggleCollapsibleItem()}))}))},e.prototype.ngAfterViewInit=function(){var e=this;this.viewListBodies.forEach((function(t){e.collapsibleService.addListBody(t)}))},e.decorators=[{type:t.Component,args:[{selector:"collapsible-table-row-detail",template:'\n <td colspan="100%">\n <collapsible-list-item>\n <collapsible-body>\n <ng-content></ng-content>\n </collapsible-body>\n </collapsible-list-item>\n </td>\n ',styles:["\n :host {\n display: table-row;\n }\n\n :host collapsible-body,\n :host td {\n padding: 0;\n }\n "]}]}],e.ctorParameters=function(){return[{type:r}]},e.propDecorators={expanded:[{type:t.Input}],viewListBodies:[{type:t.ViewChildren,args:[d]}]},e}();var w=function(){function e(t,o,l){this.el=t,this.sanitizer=o,this.collapsibleService=l,this.backgroundTransitionDuration="0.3s",this.backgroundTransitionTimingFunction=this.sanitizer.bypassSecurityTrustStyle(e.EASE_OUT_QUAD),this.isHeadRow=!1,this.isBodyRow=!1,this.isOddRow=!1,this.isEvenRow=!1,this.isParentStriped=!1,this.isParentHighlight=!1,this.parentAllowsSelect=!1,this.parentAllowsSelectMultipleRows=!1,this.parentAllowsDeselectingRows=!1,this.dragSelection=!1}return e.prototype.ngOnInit=function(){var t=this.el.nativeElement,o=t.parentElement;if("TBODY"===o.tagName)for(var l=o.querySelectorAll("collapsible-table-row"),i=0;i<l.length;i++){if(l[i]===t){this.index=i+1;break}}this.parentCollapsibleTable=this.collapsibleService.getCollapsibleTable(),null!=this.parentCollapsibleTable&&(this.isParentStriped=this.parentCollapsibleTable.striped,this.isParentHighlight=this.parentCollapsibleTable.highlight,this.parentHighlightRowBackgroundColor=this.parentCollapsibleTable.highlightColor||e.DEFAULT_HIGHLIGHT_ROW_COLOR,this.parentHighlightRowTextColor=this.parentCollapsibleTable.highlightTextColor||e.DEFAULT_ROW_TEXT_COLOR,this.activeRowBackgroundColor=this.parentCollapsibleTable.activeColor||e.DEFAULT_ACTIVE_ROW_COLOR,this.activeRowTextColor=this.parentCollapsibleTable.activeTextColor||e.DEFAULT_ROW_TEXT_COLOR,this.parentAllowsSelect=this.parentCollapsibleTable.select,this.parentAllowsSelectMultipleRows=this.parentCollapsibleTable.selectMultipleRows,this.selectedRowBackgroundColor=this.parentCollapsibleTable.selectColor||e.DEFAULT_SELECTED_ROW_COLOR,this.selectedRowTextColor=this.parentCollapsibleTable.selectTextColor||e.DEFAULT_ROW_TEXT_COLOR,this.parentAllowsDeselectingRows=null!=this.parentCollapsibleTable.allowDeselectingRows&&this.parentCollapsibleTable.allowDeselectingRows)},e.prototype.ngAfterContentInit=function(){this.updateRow()},e.prototype.updateRow=function(){var t=this.el.nativeElement;if(null!=t.querySelector("th")&&(this.isHeadRow=!0),null!=t.querySelector("td"))switch(this.isBodyRow=!0,this.index%2==0?(this.isEvenRow=!0,this.parentStripedRowBackgroundColor=this.parentCollapsibleTable.stripedEvenColor||e.DEFAULT_STRIPED_EVEN_ROW_COLOR,this.parentStripedRowTextColor=this.parentCollapsibleTable.stripedEvenTextColor||e.DEFAULT_ROW_TEXT_COLOR):(this.isOddRow=!0,this.parentStripedRowBackgroundColor=this.parentCollapsibleTable.stripedOddColor||e.DEFAULT_STRIPED_ODD_ROW_COLOR,this.parentStripedRowTextColor=this.parentCollapsibleTable.stripedOddTextColor||e.DEFAULT_ROW_TEXT_COLOR),!0){case this.parentAllowsSelect&&this.selected:this.rowBackgroundColor=this.selectedRowBackgroundColor,this.rowTextColor=this.selectedRowTextColor;break;case this.isParentStriped:this.rowBackgroundColor=this.parentStripedRowBackgroundColor,this.rowTextColor=this.parentStripedRowTextColor}},e.prototype.getHeight=function(){return this.el.nativeElement.offsetHeight},e.prototype.isLeftMouseButton=function(e){var t=e.button,o=e.which,l=e.target||e.srcElement||e.currentTarget;return["TR","TD"].indexOf(l.tagName)>-1&&("button"in e?0===t:1===(o||t))},e.prototype.mousedown=function(e){this.isLeftMouseButton(e)&&this.isBodyRow&&(this.parentCollapsibleTable.noTextSelect&&e.preventDefault(),this.isBodyRow&&(this.parentAllowsSelect&&!this.parentAllowsDeselectingRows&&(this.prevSelectedRows=this.parentCollapsibleTable.selectedRows,this.parentCollapsibleTable.clearSelectedRows(),this.parentCollapsibleTable.deselectAllRows()),this.rowBackgroundColor=this.activeRowBackgroundColor,this.rowTextColor=this.activeRowTextColor))},e.prototype.mouseup=function(e){if(this.isLeftMouseButton(e)&&this.isBodyRow){if(this.parentAllowsSelect&&(this.parentAllowsDeselectingRows?this.dragSelection||this.parentCollapsibleTable.toggleRowSelection(this.index):this.parentCollapsibleTable.selectRow(this.index)),this.parentCollapsibleTable.updateTable(),this.parentAllowsSelect&&this.parentAllowsSelectMultipleRows&&null!=e&&e.shiftKey&&null!=this.prevSelectedRows&&this.prevSelectedRows.length>0&&this.parentCollapsibleTable.selectedRows.length>0){var t=this.prevSelectedRows.concat(this.parentCollapsibleTable.selectedRows);t.sort((function(e,t){return e-t}));var o=Math.min.apply(null,t),l=Math.max.apply(null,t);this.parentCollapsibleTable.selectRows(o,l)}this.dragSelection=!1,this.parentCollapsibleTable.focus()}},e.prototype.mouseenter=function(e){if(this.isBodyRow)switch(!0){case this.parentAllowsSelect&&this.parentAllowsSelectMultipleRows&&this.parentCollapsibleTable.mouseDownHold:this.parentCollapsibleTable.selectRow(this.index),this.dragSelection=!0;break;case this.parentAllowsSelect&&this.selected:break;case this.isParentHighlight:this.rowBackgroundColor=this.parentHighlightRowBackgroundColor,this.rowTextColor=this.parentHighlightRowTextColor}},e.prototype.mouseleave=function(e){if(this.isBodyRow)switch(!0){case this.parentAllowsSelect&&this.parentAllowsSelectMultipleRows&&this.parentCollapsibleTable.mouseDownHold:this.parentCollapsibleTable.selectRow(this.index),this.dragSelection=!1;break;case this.parentAllowsSelect&&this.selected:break;case this.isParentStriped:this.rowBackgroundColor=this.parentStripedRowBackgroundColor,this.rowTextColor=this.parentStripedRowTextColor;break;default:this.rowBackgroundColor=void 0,this.rowTextColor=void 0}},e.prototype.click=function(e){if(null!=this.detail){var t=e.target||e.srcElement||e.currentTarget;null!=t&&["TR","TD"].indexOf(t.tagName)>-1&&this.detail.subject.next()}},e.EASE_OUT_QUAD="cubic-bezier(0.25, 0.46, 0.45, 0.94)",e.DEFAULT_STRIPED_ODD_ROW_COLOR="rgba(242,242,242,0.8)",e.DEFAULT_STRIPED_EVEN_ROW_COLOR="transparent",e.DEFAULT_HIGHLIGHT_ROW_COLOR="rgba(222,222,222, 0.8)",e.DEFAULT_ACTIVE_ROW_COLOR="rgba(212,212,212, 0.8)",e.DEFAULT_SELECTED_ROW_COLOR="rgba(212,212,212, 0.8)",e.DEFAULT_ROW_TEXT_COLOR="black",e.decorators=[{type:t.Component,args:[{selector:"collapsible-table-row",template:"<ng-content></ng-content>",styles:["\n :host {\n display: table-row;\n transition-property: background-color, color;\n }\n "]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:s.DomSanitizer},{type:r}]},e.propDecorators={detail:[{type:t.Input}],rowTextColor:[{type:t.HostBinding,args:["style.color"]}],rowBackgroundColor:[{type:t.HostBinding,args:["style.background-color"]}],backgroundTransitionDuration:[{type:t.HostBinding,args:["style.transition-duration"]}],backgroundTransitionTimingFunction:[{type:t.HostBinding,args:["style.transition-timing-function"]}],selected:[{type:t.HostBinding,args:["class.selected"]}],mousedown:[{type:t.HostListener,args:["mousedown",["$event"]]}],mouseup:[{type:t.HostListener,args:["mouseup",["$event"]]}],mouseenter:[{type:t.HostListener,args:["mouseenter",["$event"]]}],mouseleave:[{type:t.HostListener,args:["mouseleave",["$event"]]}],click:[{type:t.HostListener,args:["click",["$event"]]}]},e}();var y=function(){function e(e,t){this.el=e,this.collapsibleService=t,this.allowKeyboardNavigation=!0,this.fixedTableHeight="auto",this.tabindex=0,this.selectedRows=[],this.type="accordion",this.mouseDownHold=!1}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){},e.prototype.ngOnChanges=function(e){for(var t in e)if(e.hasOwnProperty(t)){if(null!=this.collapsibleTableRows)switch(t){case"striped":case"stripedOddColor":case"stripedOddTextColor":case"stripedEvenColor":case"stripedEvenTextColor":this.updateTable("striped");break;case"highlight":case"highlightColor":case"highlightTextColor":this.updateTable("highlight");break;case"activeColor":case"activeTextColor":this.updateTable("active");break;case"select":case"selectColor":case"selectTextColor":case"selectMultipleRows":case"allowDeselectingRows":this.updateTable("select")}"type"===t&&(this.type=e.type.currentValue,this.collapsibleService.setType(this.type))}this.collapsibleService.setCollapsibleTable(this)},e.prototype.focus=function(){this.el.nativeElement.focus()},e.prototype.addSelectedRow=function(e){switch(!0){case this.selectMultipleRows&&-1===this.selectedRows.indexOf(e):this.selectedRows.push(e),this.selectedRows.sort((function(e,t){return e-t}));break;case!this.selectMultipleRows:this.selectedRows=[],this.deselectAllRows(),this.selectedRows.push(e),this.selectedRows.sort((function(e,t){return e-t}))}},e.prototype.removeSelectedRow=function(e){-1!==this.selectedRows.indexOf(e)&&this.selectedRows.splice(this.selectedRows.indexOf(e),1)},e.prototype.clearSelectedRows=function(){this.selectedRows=[]},e.prototype.deselectAllRows=function(){this.collapsibleTableRows.forEach((function(e){e.selected=!1,e.updateRow()}))},e.prototype.selectRow=function(e){var t=this;if(this.select)switch(!0){case 0===e:this.selectRow(1);break;case e===this.collapsibleTableRows.length:this.selectRow(this.collapsibleTableRows.length-1);break;case 0<e&&e<=this.collapsibleTableRows.length-1:this.addSelectedRow(e),this.collapsibleTableRows.forEach((function(o,l){e!==l?t.selectMultipleRows||(o.selected=!1):o.selected=!0,o.updateRow()}))}},e.prototype.selectRows=function(e,t){var o=this;this.selectMultipleRows&&0<e&&e<t&&t<=this.collapsibleTableRows.length-1&&(this.clearSelectedRows(),this.collapsibleTableRows.forEach((function(l,i){e<=i&&i<=t?(o.addSelectedRow(i),l.selected=!0):l.selected=!1,l.updateRow()})))},e.prototype.toggleRowSelection=function(e){var t=this;this.select&&0<e&&e<=this.collapsibleTableRows.length-1&&this.collapsibleTableRows.forEach((function(o,l){e===l&&(o.selected?t.removeSelectedRow(e):t.addSelectedRow(e),o.selected=!o.selected,o.updateRow())}))},e.prototype.updateStriped=function(e){this.striped&&e.isBodyRow?(e.isParentStriped=!0,e.isOddRow?(e.parentStripedRowBackgroundColor=this.stripedOddColor||w.DEFAULT_STRIPED_ODD_ROW_COLOR,e.parentStripedRowTextColor=this.stripedOddTextColor||w.DEFAULT_ROW_TEXT_COLOR,e.rowBackgroundColor=e.parentStripedRowBackgroundColor,e.rowTextColor=e.parentStripedRowTextColor):(e.parentStripedRowBackgroundColor=this.stripedEvenColor||w.DEFAULT_STRIPED_EVEN_ROW_COLOR,e.parentStripedRowTextColor=this.stripedEvenTextColor||w.DEFAULT_ROW_TEXT_COLOR,e.rowBackgroundColor=e.parentStripedRowBackgroundColor,e.rowTextColor=e.parentStripedRowTextColor)):(e.isParentStriped=!1,e.rowBackgroundColor=void 0,e.rowTextColor=void 0)},e.prototype.updateHighlight=function(e){e.isParentHighlight=this.highlight,e.parentHighlightRowBackgroundColor=this.highlightColor||w.DEFAULT_HIGHLIGHT_ROW_COLOR,e.parentHighlightRowTextColor=this.highlightTextColor||w.DEFAULT_ROW_TEXT_COLOR},e.prototype.updateActive=function(e){e.activeRowBackgroundColor=this.activeColor||w.DEFAULT_ACTIVE_ROW_COLOR,e.activeRowTextColor=this.activeTextColor||w.DEFAULT_ROW_TEXT_COLOR},e.prototype.updateSelect=function(e){e.parentAllowsSelect=this.select,e.parentAllowsSelectMultipleRows=this.selectMultipleRows,e.parentAllowsDeselectingRows=this.allowDeselectingRows,e.selected&&(e.selectedRowBackgroundColor=this.selectColor||w.DEFAULT_SELECTED_ROW_COLOR,e.selectedRowTextColor=this.selectTextColor||w.DEFAULT_ROW_TEXT_COLOR,e.rowBackgroundColor=e.selectedRowBackgroundColor,e.rowTextColor=e.selectedRowTextColor)},e.prototype.updateTable=function(e){var t=this;if(null!=this.collapsibleTableRows)if(null!=e)switch(e){case"striped":this.collapsibleTableRows.forEach((function(e){t.updateStriped(e)}));break;case"highlight":this.collapsibleTableRows.forEach((function(e){t.updateHighlight(e)}));break;case"active":this.collapsibleTableRows.forEach((function(e){t.updateActive(e)}));break;case"select":this.collapsibleTableRows.forEach((function(e){t.updateSelect(e)}))}else this.collapsibleTableRows.forEach((function(e){t.updateStriped(e),t.updateHighlight(e),t.updateSelect(e),t.updateActive(e)}))},e.prototype.keydown=function(e){if(this.select&&this.allowKeyboardNavigation){var t={arrowUp:38,arrowDown:40,home:36,end:35};t[t.arrowUp]="arrowUp",t[t.arrowDown]="arrowDown",t[t.home]="home",t[t.end]="end";var o=1,l=e.which;if(null!=t[l]){switch(e.preventDefault(),e.stopPropagation(),l){case t.arrowUp:this.selectedRows.length>0&&(o=this.selectedRows[this.selectedRows.length-1],o--);break;case t.arrowDown:this.selectedRows.length>0&&(o=this.selectedRows[this.selectedRows.length-1],o++);break;case t.home:o=1;break;case t.end:o=this.collapsibleTableRows.length-1}this.clearSelectedRows(),this.deselectAllRows(),this.selectRow(o),this.updateTable()}}},e.prototype.mousedown=function(){this.mouseDownHold=!0},e.prototype.mouseup=function(){this.mouseDownHold=!1},e.decorators=[{type:t.Component,args:[{selector:"collapsible-table",template:"<ng-content></ng-content>",providers:[r],styles:["\n :host {\n display: table;\n position: relative;\n width: 100%;\n border-collapse: collapse;\n }\n\n :host thead {\n border-bottom: 1px solid #d0d0d0;\n }\n\n :host /deep/ tbody /deep/ collapsible-table-row {\n cursor: pointer;\n }\n\n :host /deep/ collapsible-table-row th,\n :host /deep/ collapsible-table-row td {\n border-radius: 0;\n }\n\n :host[bordered='true'] {\n border-top: 1px solid #d0d0d0;\n border-right: 1px solid #d0d0d0;\n border-left: 1px solid #d0d0d0;\n }\n\n :host[bordered='true'] /deep/ collapsible-table-row,\n :host[borderedHorizontally='true'] /deep/ collapsible-table-row {\n border-bottom: 1px solid #d0d0d0;\n }\n\n :host[bordered='true'] /deep/ collapsible-table-row th,\n :host[bordered='true'] /deep/ collapsible-table-row td,\n :host[borderedVertically='true'] /deep/ collapsible-table-row th:not(:last-child),\n :host[borderedVertically='true'] /deep/ collapsible-table-row td:not(:last-child) {\n border-right: 1px solid #d0d0d0;\n }\n\n :host(.centered) /deep/ * {\n text-align: center;\n }\n\n :host(.noTextSelect) /deep/ collapsible-table-row th,\n :host(.noTextSelect) /deep/ collapsible-table-row td {\n user-select: none;\n }\n "]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:r}]},e.propDecorators={bordered:[{type:t.Input},{type:t.HostBinding,args:["attr.bordered"]}],borderedHorizontally:[{type:t.Input},{type:t.HostBinding,args:["attr.borderedHorizontally"]}],borderedVertically:[{type:t.Input},{type:t.HostBinding,args:["attr.borderedVertically"]}],striped:[{type:t.Input},{type:t.HostBinding,args:["attr.striped"]}],stripedOddColor:[{type:t.Input},{type:t.HostBinding,args:["attr.stripedOddColor"]}],stripedOddTextColor:[{type:t.Input},{type:t.HostBinding,args:["attr.stripedOddTextColor"]}],stripedEvenColor:[{type:t.Input},{type:t.HostBinding,args:["attr.stripedEvenColor"]}],stripedEvenTextColor:[{type:t.Input},{type:t.HostBinding,args:["attr.stripedEvenTextColor"]}],highlight:[{type:t.Input},{type:t.HostBinding,args:["attr.highlight"]}],highlightColor:[{type:t.Input},{type:t.HostBinding,args:["attr.highlightColor"]}],highlightTextColor:[{type:t.Input},{type:t.HostBinding,args:["attr.highlightTextColor"]}],activeColor:[{type:t.Input},{type:t.HostBinding,args:["attr.activeColor"]}],activeTextColor:[{type:t.Input},{type:t.HostBinding,args:["attr.activeTextColor"]}],centered:[{type:t.Input},{type:t.HostBinding,args:["class.centered"]},{type:t.HostBinding,args:["attr.centered"]}],responsive:[{type:t.Input},{type:t.HostBinding,args:["attr.responsive"]}],select:[{type:t.Input},{type:t.HostBinding,args:["attr.select"]}],selectMultipleRows:[{type:t.Input},{type:t.HostBinding,args:["attr.selectMultipleRows"]}],selectColor:[{type:t.Input},{type:t.HostBinding,args:["attr.selectColor"]}],selectTextColor:[{type:t.Input},{type:t.HostBinding,args:["attr.selectTextColor"]}],allowDeselectingRows:[{type:t.Input},{type:t.HostBinding,args:["attr.allowDeselectingRows"]}],allowKeyboardNavigation:[{type:t.Input},{type:t.HostBinding,args:["attr.allowKeyboardNavigation"]}],noTextSelect:[{type:t.Input},{type:t.HostBinding,args:["class.noTextSelect"]},{type:t.HostBinding,args:["attr.noTextSelect"]}],tabindex:[{type:t.HostBinding,args:["attr.tabindex"]}],type:[{type:t.Input},{type:t.HostBinding,args:["attr.type"]}],collapsibleTableRows:[{type:t.ContentChildren,args:[w]}],keydown:[{type:t.HostListener,args:["keydown",["$event"]]}],mousedown:[{type:t.HostListener,args:["mousedown"]}],mouseup:[{type:t.HostListener,args:["mouseup"]}]},e}();var C=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[e]}},e.decorators=[{type:t.NgModule,args:[{imports:[o.CommonModule],declarations:[u,h,b,d,y,w,g],exports:[u,h,b,d,y,w,g],providers:[r,p,c]}]}],e}();e.CollapsibleAnimationsService=c,e.CollapsibleBodyComponent=d,e.CollapsibleEvent=a,e.CollapsibleEventService=p,e.CollapsibleHeaderComponent=b,e.CollapsibleListComponent=u,e.CollapsibleListItemComponent=h,e.CollapsibleModule=C,e.CollapsibleService=r,e.CollapsibleTableComponent=y,e.CollapsibleTableRowComponent=w,e.CollapsibleTableRowDetailComponent=g,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=angular2-collapsible.umd.min.js.map