ng-expandable-area
Version:
Expandable area for Angular4+
2 lines • 2.54 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("ng-expandable-area",["exports","@angular/core","@angular/common"],t):t(e["ng-expandable-area"]={},e.ng.core,e.ng.common)}(this,function(e,t,n){"use strict";var o=function(){function e(e,t){this._elementRef=e,this.renderer=t}return e.prototype.ngOnInit=function(){this.opened&&this.show()},e.prototype.showArea=function(){this._elementRef.nativeElement.classList.contains("active")?this.hide():this.show()},e.prototype.show=function(){this.renderer.addClass(this._elementRef.nativeElement,"active")},e.prototype.hide=function(){this.renderer.removeClass(this._elementRef.nativeElement,"active")},e.decorators=[{type:t.Component,args:[{selector:"ng-expandable-area",template:'<div class="ep-collapse-title" (click)="showArea()">\n {{ title }}\n <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h\n 0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT\n 0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZmlsbD0iIzY0NTM5NCIgZmlsbC1ydWxlPSJub256Z\n XJvIiBkPSJNMTUuODg0IDkuMjk0TDEyIDEzLjE3IDguMTE2IDkuMjk0YS45OTcuOTk3IDAgMSAw\n LTEuNDEgMS40MWw0LjU4NyA0LjU4OWExIDEgMCAwIDAgMS40MTQgMGw0LjU4OC00LjU4OGEuOTk\n 4Ljk5OCAwIDAgMC0xLjQxLTEuNDF6Ii8+CiAgICAgICAgPHBhdGggZD0iTTAgMGgyNHYyNEgwei\n IvPgogICAgPC9nPgo8L3N2Zz4K">\n</div>\n<div class="ep-collapse-area">\n <ng-content></ng-content>\n</div>\n',styles:[".ep-collapse-title{opacity:.9;font-size:1em;font-weight:700;line-height:1.33;text-align:left;color:#000;text-transform:uppercase;position:relative;padding-right:28px;margin:15px 0}.ep-collapse-title:hover{cursor:pointer}.ep-collapse-title img{position:absolute;width:24px;height:24px;right:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ep-collapse-area{margin:15px 0;display:none}.ep-collapse-area.active{display:block}:host.active .ep-collapse-area{display:block}:host.active .ep-collapse-title img{-webkit-transform:rotate(0);transform:rotate(0)}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={title:[{type:t.Input}],opened:[{type:t.Input}]},e}(),i=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[o],exports:[o]}]}],e}();e.ExpandableAreaModule=i,e.ɵa=o,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ng-expandable-area.umd.min.js.map