UNPKG

md2

Version:

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Chips(Tags), Collapse, Colorpicker, Data Table, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.

92 lines 3.03 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { Directive, EventEmitter, Input, Output, } from '@angular/core'; var Md2Collapse = (function () { function Md2Collapse() { this._collapse = true; this._collapsing = false; this.collapsed = new EventEmitter(); this.expanded = new EventEmitter(); } Object.defineProperty(Md2Collapse.prototype, "collapse", { get: function () { return this._collapse; }, set: function (value) { this._collapse = value; this.toggle(); }, enumerable: true, configurable: true }); /** * toggle collapse */ Md2Collapse.prototype.toggle = function () { if (this._collapse) { this.hide(); } else { this.show(); } }; /** * show collapse */ Md2Collapse.prototype.show = function () { var _this = this; this._collapsing = true; this._collapse = true; setTimeout(function () { _this._collapsing = false; }, 4); this.expanded.emit(); }; /** * hide collapse */ Md2Collapse.prototype.hide = function () { var _this = this; this._collapsing = true; this._collapse = false; setTimeout(function () { _this._collapsing = false; }, 4); this.collapsed.emit(); }; return Md2Collapse; }()); __decorate([ Output(), __metadata("design:type", EventEmitter) ], Md2Collapse.prototype, "collapsed", void 0); __decorate([ Output(), __metadata("design:type", EventEmitter) ], Md2Collapse.prototype, "expanded", void 0); __decorate([ Input(), __metadata("design:type", Boolean), __metadata("design:paramtypes", [Boolean]) ], Md2Collapse.prototype, "collapse", null); Md2Collapse = __decorate([ Directive({ selector: '[collapse]', host: { 'role': 'collapse', '[class.in]': '_collapse', '[class.collapse]': 'true', '[class.collapsing]': '_collapsing', '[attr.aria-expanded]': '_collapse', '[attr.aria-hidden]': '!_collapse' }, exportAs: 'md2Collapse' }) ], Md2Collapse); export { Md2Collapse }; //# sourceMappingURL=collapse.js.map